Add trusted access context for MCP metadata (#40992)

## What changed

- Add `TrustedAccessContext` to fetch account-bound cyber verified-access grants and attach them as host-owned `openai/entitlementContext` metadata.
- Replace caller-supplied entitlement metadata and return an `unknown` status when authentication, identity consistency, response validation, size limits, or the lookup deadline cannot be verified.
- Add `HttpResponseBodyStream::from_chunks` for lightweight in-memory streaming clients.

## Testing

- Cover grant mapping, unsupported authentication, account and workspace changes, malformed or oversized responses, duplicate programs, and lookup timeouts.

GitOrigin-RevId: 343b6a6608c98c45a34939ef507c2183516a11c1
This commit is contained in:
soyeon-oai authored and copyberry committed 2026-08-26 22:54:10 +00:00
1 parent b9c4b9a0cf
commit a98b94625e
4 files changed
+909

No files matched your search

+2
View File
@@ -25,6 +25,7 @@ pub use runtime::SandboxState;
pub use runtime::apply_http_headers_helper;
pub use tool_catalog_cache::McpToolCatalogCache;
pub use tools::ToolInfo;
pub use trusted_access::TrustedAccessContext;
/// Backward-compatible name for the shared Codex Apps tools runtime.
pub type CodexAppsToolsCache = codex_connectors::ConnectorRuntimeManager<ToolInfo>;
@@ -112,3 +113,4 @@ pub(crate) mod runtime;
pub(crate) mod server;
mod tool_catalog_cache;
pub(crate) mod tools;
mod trusted_access;