Expand description
The environment a child process on this machine starts from.
Every program the engine launches — a Bash / Monitor command, a command
hook, an MCP stdio server, the engine’s own git and pdftotext — gets its
environment from here, so that what a model can read with printenv is
decided in one place. The engine’s own credentials never pass by default;
everything else does unless the operator switches to an allowlist.
Which variables are credentials is decided where configuration names them:
a settings file, a plugin, the MCP policy or the host each report the
variables they read a secret from (hold_back_credential) before any
child starts under them.
Structs§
- Subprocess
Env sandbox.envin settings.json.
Enums§
- EnvPlan
- What
SubprocessEnv::resolvedecides to do to the environment a child would otherwise inherit. - EnvScope
- How much of the environment a process starts from: a mark on a
ProcessSpeca provider reads, not a list of variables, since a remote provider’s environment is not this machine’s. - Subprocess
EnvMode
Functions§
- expand_
vars_ with - Expand
$VAR,${VAR},${VAR:-default}(the default when unset or empty) and$$(a literal$) ininput, with the variableslookupgives. A variable it does not give expands to nothing. - hold_
back_ credential - From now on, treat the variable
nameas one of the engine’s own credentials: no child process inherits it unless a policy’sallownames it. Process-wide, because the environment children inherit from is. The variables a shell cannot work without are never held back, whatever a settings file names. - hold_
back_ what_ an_ mcp_ server_ reads hold_back_credentialfor every variablevariables_an_mcp_server_readsfinds inserver.- is_
engine_ credential - The engine’s own credentials: the
ANTHROPIC_*variables, the daemon’s bearer token, and whateverhold_back_credentialwas told. - referenced_
vars - The variables
inputrefers to as$VAR,${VAR}or${VAR:-…}. - variables_
an_ mcp_ server_ reads - The variables of this process’s environment an
mcp_serversentry reads when it connects: every$VARin itscommand,args,env,urlandheaders, and the variables itsoauthblock names (client_secret_env,private_key_jwt.key_env).