Attach verified access context to eligible plugin MCP calls (#41005)

## What changed

- Fetch ChatGPT account access and attach `cyber_trusted_access` under
  `openai/entitlementContext` when an installed or selected plugin explicitly
  requests it from a local, read-only stdio tool with no arguments.
- Reject caller-supplied entitlement context on direct MCP calls, and fall back
  to an `unknown` status when access cannot be verified or the account changes
  during the lookup.
- Count entitlement lookup time against the MCP tool-call timeout.

## Testing

- Cover eligible calls plus unowned, remote, HTTP, mutable, argument-bearing,
  API-key, undeclared, direct, and account-switch cases in core and app-server
  integration tests.

GitOrigin-RevId: 303b61585ef4530276c373d914a2d0ccef1f4ac2
This commit is contained in:
soyeon-oai authored and copyberry committed 2026-08-27 00:02:26 +00:00
1 parent e56e4922eb
commit ae357e7250
16 files changed
+935 -31

No files matched your search

+1 -5
View File
@@ -358,10 +358,6 @@ impl Session {
})
.collect(),
);
let codex_apps_auth_manager =
codex_mcp::host_owned_codex_apps_enabled(&mcp_config, auth.as_ref())
.then(|| Arc::clone(&self.services.auth_manager));
McpRuntimeInput {
startup_policy: if matches!(desired.session_source, SessionSource::SubAgent(_)) {
McpStartupPolicy::LazyWhenCached
@@ -381,7 +377,7 @@ impl Session {
codex_apps_tools_cache_key: connector_runtime_context_key(auth.as_ref()),
client_mcp_extensions: self.services.client_mcp_extensions.for_mcp_servers(),
auth,
codex_apps_auth_manager,
auth_manager: Some(Arc::clone(&self.services.auth_manager)),
elicitation_reviewer,
elicitation_lifecycle: Some(self.mcp_elicitation_lifecycle()),
}