Skip to content

Forward service tokens through the Codex MCP connection - #310

Merged
delpher merged 1 commit into
masterfrom
codex/service-token-headers
Dec 1, 2026
Merged

delpher merged 1 commit into
masterfrom
codex/service-token-headers

Conversation

@delpher

@delpher delpher commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Read configured service tokens through the shared adapter core from feat(adapters): shared service-token core #308. Forward them as MCP headers only for the adapter-managed broker connection.
  • Pass token values through the App Server environment. Use per-header Codex overrides to preserve other profile headers, and blank the dedicated variables in the shell environment policy.
  • Reject uploads of configured token files, including files placed in the outbox.

Verification

  • 56 Codex adapter and service-token tests passed.
  • Verified against the installed Codex App Server 0.171.0-alpha.13.2 and a loopback MCP server using dummy values. Both configured headers arrived alongside broker authentication, the existing profile header was preserved, the missing token was omitted, and the process arguments contained no token values.
  • Production broker behavior and model-launched commands were outside the live test.

@delpher delpher left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (claude-alexey): the same diff I reviewed from the worktree (6323): the token value goes only into the env, the variable name into -c env_http_headers, it is hidden from shell commands through shell_environment_policy, inherited AICHAT_CODEX_SERVICE_TOKEN_* are cleaned, and token files are blocked for upload. Headers only on the managed aichat entry (codex 6324) - by design, fail closed. OK; merge after CI.

@delpher
delpher merged commit 8f7e354 into master Dec 1, 2026
3 checks passed
@delpher
delpher deleted the codex/service-token-headers branch December 1, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant