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
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'sgbrain connectpath the token lives in your shell env, not in Codex's config file. The exception isgbrain bootstrap harness…"src/core/harness/install.ts:87-94(v0.60.11.0): foradapter.connection === 'codex-toml',writeCodexHttpServerBlock(configPath, { name, url, bearerToken: token }). The block carries thegbrain:bootstrap-harness-v1begin/end markers even thoughbootstrap harnesswas 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.
Source: garrytan/gbrain