Expand description
The extra environment variables a definition launches with: the env
content blob (agent_content, content_type = "env"), one KEY=VALUE per
line, # comments and blank lines allowed. The launch reads it the way
classify does (frontend/app/view/agent/agent-model.ts): a line that
isn’t a comment and has no valid KEY= is skipped.
The operator edits the blob freely in My Agents. An agent edits it through
Agents env_set (server/app_api/agent_env.rs), and these rules bound
what it may write: no name AgentMux itself sets or that points a provider
at another home or credential, no value that looks like a secret, and a
small size. The one exception is the model endpoint of a Claude Code agent
(ENDPOINT_NAMES): an agent may point another agent at a server of its own
(a local model), on the terms in endpoint_value_problem and with the
notice and undo window of server/app_api/agent_env.rs. Everything an agent reads back has the values of
names it may not set hidden.
Structs§
- Change
- What an edit did, by name. Values of credential-looking names are
HIDDEN. - Value
Change
Enums§
- Line
- How one line reads at launch.
Constants§
- CONTENT_
TYPE - The
content_typeof the blob. - ENDPOINT_
NAMES - The Claude Code variables that choose the server and the model an agent talks to. An agent
may set them, which is why they are spelled out here and not left to the reserved patterns
(
_BASE_URL, a credential ending): the notice, the undo window and the launch rules ofspawn_env/endpoint.rsstand where the refusal stood. Other harnesses have no verified endpoint variable (providers:base_url_env_varis Claude’s alone), so nothing else is in the list. - HIDDEN
- What stands for a value an agent isn’t shown.
- MAX_
BYTES - The most bytes an agent may write.
- MAX_
LINES - The most lines (comments and blanks included) an agent may write.
- VAULT_
REF_ PREFIX - The prefix of a value that names a Vault entry:
vault:<entry id>.
Functions§
- check_
size textwithin the size an agent may write.- classify
- How the launch reads
raw: trimmed,#starts a comment, the key is everything before the first=and must be a valid name (not trimmed, soKEY = vis skipped), the value everything after it. - diff
- What changed in the variables the launch gets from
oldtonew. - edit
currentwithsetapplied andunsetremoved, every other line (and comment) as it was. A name already there has its value replaced where it stands, a new one goes at the end.- effective
- The variables the launch ends up with: a name given twice has its last value.
- endpoint_
value_ problem - Why
valueis not acceptable for the endpoint variablename, if it is not. A server address is plainhttp(s)://host[:port][/path]: no sign-in in it, no query, no fragment. A key is a reference to a Vault entry (vault:<id>; whether the agent may use that entry is the caller’s to check) or one of a few placeholder words for a server that ignores it (Ollama’s “ollama”); a real secret is never stored in the environment, where every agent that can read it would see it. The rest are numbers and model names. - is_
anthropic_ url - Whether
url(aANTHROPIC_BASE_URLvalue) is Anthropic’s own API: the one place a person’s Claude sign-in may go. Anything else, a LAN server, a proxy or another vendor, is not. - is_
credential_ name - Whether
namelooks like it holds a credential. - is_
endpoint_ name - Whether
nameis one ofENDPOINT_NAMES(any case). - is_
placeholder - is_
valid_ name ^[a-zA-Z_][a-zA-Z0-9_]*$.- looks_
like_ secret - Whether
valuehas the shape of a secret (a token with a known prefix, a private key, a JWT, …). - name_
problem - Why an agent may not set or remove
name, if it may not. A pattern, not a list of names: a variable that runs code or redirects traffic in the tools another agent launches is refused whatever it is called. - points_
at_ own_ server - Whether the environment in
textpoints the agent at a server of its own: anANTHROPIC_BASE_URLthat is not Anthropic’s. Only then does the launch ask for the modelANTHROPIC_MODELnames (endpoint_model); anywhere else it passes the model its pane’s runtime chose, which that variable cannot change. - points_
at_ own_ server_ with points_at_own_serverfor an agent with a definition: the launch puts its structuredmodel_vendor_base_urlinto the environment first, and it wins over anANTHROPIC_BASE_URLline of the text, so a set one decides alone.- redacted
textas an agent is shown it: the values of names it may not set hidden, a comment that may hold a secret and a skipped line as# [hidden], every other line as written.- resolve_
lines - The text an agent proposes as the whole environment (
lines), with the lines it can’t write kept. It is within the size, and every line is a comment, a blank or aKEY=VALUEit may write; a line that would be skipped at launch is refused rather than kept silently. A name incurrentthat the agent may not write (a credential, a reserved name, a hidden value) stays as the operator wrote it: where the agent kept the line asenv_getshowed it (NAME=[hidden], or unchanged), the operator’s line goes back in that place, and one the agent left out goes at the end. - value_
problem - Why an agent may not give a variable
value, if it may not. - vault_
ref - The Vault entry id in
value, if it is a reference to one.