Agent definitions are binary-only. All env vars, secrets, and settings belong on
the context. The same claude binary uses different API keys in different contexts:
agents:
claude:
binary: claude
contexts:
personal:
agent: claude
env:
ANTHROPIC_API_KEY: "{{ .secrets.personal_key }}"
work:
agent: claude
env:
ANTHROPIC_API_KEY: "{{ .secrets.work_key }}"Pass a plain string and aide forwards it unchanged. No secrets file required:
env:
CLAUDE_CODE_USE_BEDROCK: "1"
AWS_REGION: "us-east-1"Three variables are available inside {{ }} expressions:
{{ .secrets.key_name }}resolves to the value ofkey_namefrom the encrypted secrets file.{{ .project_root }}resolves to the git repository root, or cwd if not in a repo.{{ .runtime_dir }}resolves to an ephemeral temp directory recreated on each launch.
Example using all three:
contexts:
work:
agent: claude
secret: work
env:
ANTHROPIC_API_KEY: "{{ .secrets.anthropic_key }}"
PROJECT_ROOT: "{{ .project_root }}"
AGENT_TMPDIR: "{{ .runtime_dir }}"aide env set KEY VALUE writes a literal value to the CWD-matched context:
aide env set CLAUDE_CODE_USE_BEDROCK 1
aide env set AWS_REGION us-east-1
aide env set CONTEXT_VAR value --context workUse --secret-key to write a template expression that references a key in the
context's secret store, rather than a raw value. --global is required because
secrets are context-scoped:
aide env set ANTHROPIC_API_KEY --secret-key anthropic_key --global
aide env set ANTHROPIC_API_KEY --secret-key anthropic_key --context work --global
aide env set ANTHROPIC_API_KEY --pick --globalThe context must already have a secret store bound (via
aide context set-secret <name>) before using --secret-key or --pick. To
read from a different store without changing the context binding, pass
--secret-store <name> explicitly alongside --secret-key or --pick.
Pass --pick instead of --secret-key to open an interactive picker. aide
decrypts the secrets file and presents available keys to choose from.
aide env list shows all env vars for the CWD-matched context with source annotations:
Context: work
ANTHROPIC_API_KEY ← secrets.anthropic_key
AWS_REGION = us-east-1
PROJECT_ROOT ← project_root
AGENT_TMPDIR ← runtime_dir
Use --context to target a specific context:
aide env list --context workaide env remove KEY deletes an env var from the CWD-matched context:
aide env remove ANTHROPIC_API_KEY
aide env remove AWS_REGION --context workEnable with --clean-env at launch or clean_env: true in the sandbox config.
The agent starts with only aide-injected vars. aide preserves standard vars (PATH, HOME,
USER, SHELL, TERM, LANG, TMPDIR, XDG_RUNTIME_DIR, XDG_CONFIG_HOME) and strips
all other inherited shell environment:
contexts:
work:
agent: claude
sandbox:
clean_env: trueClean env mode prevents credential leakage from the parent shell and makes the agent's environment predictable and controlled within a given configuration.