#5775·gbrain

docs/mcp/CODEX.md: 'gbrain connect --harness codex --credentials-file --install' writes the bearer token inline into config.toml, but the doc says only bootstrap harness does

Author: chrisquorumCreated Sep 30, 2026Updated Sep 30, 2026

Summary

docs/mcp/CODEX.md ("Connect without the plugin") says that on the gbrain connect path the bearer token lives in the shell environment (--bearer-token-env-var), and that only gbrain bootstrap harness writes the token inline into ~/.codex/config.toml. However, the machine-handoff form gbrain connect <url> --harness codex --credentials-file <handoff> --install, which docs/mcp/ADMIN.md and skills/mcp-access route machine clients to, also writes the token inline, inside a managed [mcp_servers.<name>] block with http_headers = { Authorization = "Bearer …" }.

Where

  • docs/mcp/CODEX.md (v0.60.11.0), "Connect without the plugin": "On THIS page's gbrain connect path the token lives in your shell env, not in Codex's config file. The exception is gbrain bootstrap harness…"
  • src/core/harness/install.ts:87-94 (v0.60.11.0): for adapter.connection === 'codex-toml', writeCodexHttpServerBlock(configPath, { name, url, bearerToken: token }). The block carries the gbrain:bootstrap-harness-v1 begin/end markers even though bootstrap harness was never run.

Observed

gbrain 0.60.11.0, macOS, Codex CLI. The client was provisioned with gbrain mcp grant … --harness codex --credentials-out <file> and installed with gbrain connect <loopback url> --harness codex --credentials-file <file> --install. After that, ~/.codex/config.toml (0600) contains the access token inline. There was no consent notice about inline storage, and no environment variable is involved.

Impact

Operators following CODEX.md believe the token is not in the Codex config file. Anything that reads or prints that file (support bundles, config diffs, agents inspecting MCP entries) exposes a live bearer token. This happened to us during a settings audit, and we rotated the token with mcp admin invalidate-tokens.

Ask

Either document that the --harness codex --credentials-file path stores the token inline (and mention it in the install receipt), or have that path use --bearer-token-env-var like the --token path.