Skip to main content

Environment Variables

Atomic accepts environment variables for configuration, provider credentials, and subprocess context. Atomic-prefixed application variables take precedence over their legacy Pi aliases when both are set.

Application configuration

PI_CACHE_RETENTION=long is a provider/upstream prompt-cache option and intentionally has no Atomic-prefixed alias. VISUAL and EDITOR select the Ctrl+G external editor when externalEditor is unset. PI_TUI_ESC_TIMEOUT belongs to the installed pi-tui renderer and also keeps its upstream name: it sets how long the renderer waits after a lone ESC before treating it as the Escape key, in milliseconds. The default is 100 over SSH and 10 otherwise; increase it if Alt-key input is misread as Escape.

Subprocess attribution

AI_AGENT=atomic is set by the CLI, RPC, and compiled binary entry points and forced into every Atomic-owned child-process environment, including bash/tool commands, isolated RPC children, subagent and workflow runners, MCP servers, web-access subprocesses, and the intercom broker. This follows upstream’s overwrite policy: a caller-supplied AI_AGENT is replaced in the Atomic process and child environment, but the caller’s environment object is never mutated.

Provider credentials

Provider keys include ANTHROPIC_API_KEY, OPENAI_API_KEY, AZURE_OPENAI_API_KEY, GEMINI_API_KEY, AWS/Bedrock credentials, and the variables listed in Providers. ANTHROPIC_AUTH_TOKEN is a distinct header-only bearer credential for Anthropic-compatible gateways: Atomic sends Authorization: Bearer … without requiring or inventing an API key, including normal turns, isolated execution, branch summaries, and Verbatim Compaction. Custom headers remain independent.

Bash session environment

Every built-in, factory-created, direct, workflow-stage, and isolated bash execution receives one execution-time snapshot: Atomic clears these ten reserved names before overlaying the current snapshot, preventing stale metadata from another session or workflow stage. Unrelated inherited/caller variables remain intact. The snapshot is taken when execution begins, so a resumed session or later model change is reflected. SDK createBashTool() exposes it by default; set exposeSessionEnvironment: false to opt out. See Using Atomic and RPC direct bash for execution and streaming behavior.