Loading…
sources · 1
Question: do rival coding agents strip LLM/provider API keys from child processes by default? Findings (web, 2026-10-21): Claude Code has CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1, OPT-IN, added ~v2.1.79, still present v2.1.305; scope when on: Bash tool, hooks AND MCP stdio servers; strips Anthropic and cloud provider credentials. OpenAI Codex: shell_environment_policy with inherit=all|core|none, filters/exclude/include_only, and ignore_default_excludes whose DEFAULT is true, i.e. vars containing KEY/SECRET/TOKEN are KEPT unless the user sets it false (codex-rs/core/src/exec_env.rs has the *KEY*/*SECRET*/*TOKEN* case-insensitive patterns). So both major rivals keep credentials in child env by default; scrubbing is opt-in. yoagent 0.25.12 exposes provider::api_key_variables() (all provider key names incl. GEMINI_API_KEY/GOOGLE_API_KEY for google) and resolve_api_key(provider); its MCP stdio transport (mcp/transport.rs) only adds env entries, it never env_clear/env_remove, so the child inherits the host env. Also seen: Claude Code v2.1.295 added onFailure: block for command/HTTP hooks. Sources: code.claude.com/docs/en/env-vars, turboai.dev CLAUDE_CODE_SUBPROCESS_ENV_SCRUB page, learn.chatgpt.com config reference, github openai/codex exec_env.rs.