Expand description
A scoped credential for container agents, in place of the instance auth key.
A container agent is meant to see only its /workspace mount, but the
instance key (AGENTMUX_AUTH_KEY) reaches every route srv serves: host
shell creation, stream-local-file, editor reads, attachment ingest by
path. Its docker exec env therefore carries a token minted here instead,
which srv accepts only on container_route_allowed and attributes to the
agent it was minted for.
Structs§
- Container
Grant - What a container token was minted for.
Constants§
- TOKEN_
PREFIX - Prefix that marks a container token in logs and bug reports.
Functions§
- container_
exec_ env - A container turn’s
docker execenv: host-only names left out (agent_env_scope), and the instance key replaced by this block’s container token. - container_
route_ allowed - Whether a container agent may call
path. A route srv serves (served) is open to it unless its audience (crate::backend::route_audience) refuses it, with a reason each: commands on the host, the host’s files outside its mounts, the app’s own plumbing. A path under srv’s route namespaces that is neither served nor named there is refused too. Matched on the raw path, exactly as the router matches it. - grant_
for - revoke_
block - Invalidate the block’s token; its container can no longer reach srv.
- route_
needs_ identity - Routes that act on the calling agent’s own data, and so are refused to a
container token that carries no agent identity rather than falling back to
an agent named in the request body. Every route a container has been given since the
denylist (
routes) opened them all does: a handler that takes the agent from the caller serves it, one that takes it from the body does not. The memory routes always did, the session-start delivery included. - token_
for_ block - The block’s container token: minted on first use, reused on later turns, with the grant’s identity refreshed from this turn’s env.