Expand description
What a sandbox image must carry for the agent to serve, and the Dockerfile text carrying it.
Two kinds of image exist and neither is built the way the other is. AWS renders one per deployment onto a customer-supplied base image; GCP builds static images in CI. Nothing at build time reads the other side, and a value that disagrees is invisible until a session fails: an agent listening on a port no caller dials, or an exec into a uid the image never created.
So the values live here once and both kinds render the block that carries them from this
module. The same holds for the default sandbox base both kinds start from: its toolchain is
listed here once, and a probe reads that list rather than restating it. The Dockerfiles and the
tool list are committed as generated text because CI builds them with docker build and probes
them from a shell, neither of which can call a Rust function.
Structs§
- Sandbox
Image - The values an image must carry for the agent to run in it.
- Sandbox
Image Command - Root-owned metadata copied from the base image at bundle creation, never from an exec caller.
- Sandbox
Tool - A tool the default sandbox base ships, and the command that shows it runs.
Enums§
- Authorization
- How the agent decides a caller may be served.
- Isolation
- How an image ends, and the isolation that ending permits.
Constants§
- AGENT_
IDENTITY_ ARGUMENT - The agent’s first argument that prints its uid and gid and exits, touching nothing else.
- AGENT_
MODE - Mode of the agent binary, owned by
0:0so the exec uid cannot rewrite its supervisor. - AGENT_
PATH - Path the agent binary is installed at inside every sandbox image.
- AGENT_
PORT - Port the agent serves unless the platform pins another.
- AWS_
MICROVM - The Lambda MicroVM image, rendered per deployment onto a customer base image.
- AZURE_
SANDBOX - Azure serves the agent through a published port and an authenticated native file read. Its native exec path is never used for packaged images because it grants excess capabilities.
- CALLER_
AUTHORIZATION_ HEADER - Header a caller puts its own bearer in when the backend’s edge consumes
Authorizationfor its own credential (GCP). The agent, after the capability verifies, re-emits it asAuthorizationtowards127.0.0.1only. - DEFAULT_
SANDBOX_ BASE_ IMAGE - The image every default sandbox builds on, by index digest so both architectures are pinned.
- DEFAULT_
SANDBOX_ TOOLS - The toolchain of the default sandbox base, and the one list its probes read.
- DEFAULT_
SANDBOX_ UV_ IMAGE - The image uv and uvx are copied out of, by index digest.
- ENV_
CALLER_ AUTHORIZATION_ HEADER - Environment variable naming the header a backend’s callers use for their own bearer
(
authorizationwhen unset). Set on backends whose edge replacesAuthorization. - ENV_
IMAGE_ COMMAND - Turns on the image’s own command under the root boot contract. Released agents accept only
trueand refuse to start on anything else. - ENV_
IMAGE_ PERMISSIONS - JSON
crate::sandbox_image_permissions::ImagePermissionsContract: the mounts the agent performs for the image, the connections it exempts from the gateway, and the lifecycle steps. - ENV_
IMAGE_ PERMISSIONS_ VERSION - Version of the
ENV_IMAGE_PERMISSIONScontract. - ENV_
MUST_ DROP_ KUBE_ API - Comma-separated
host:portaddresses of the Kubernetes API server (its Service ClusterIP and the real endpoint IPs) that the startup gate must see dropped. The Operator sets it on every Kubernetes sandbox pod, because service links are off and the pod has noKUBERNETES_SERVICE_HOSTto learn the address from. - ENV_
MUST_ DROP_ PUBLIC - A public
host:portthe startup gate must also see dropped. The Operator sets it only where the declared egress forbids direct public traffic (none, andinternet, which goes through the gateway). It is unset when the policy allows that address, so anallowpod is not refused for reaching it. - ENV_
PROTECTED_ MOUNTS - Set by the Kubernetes backend only: the pod mounts the agent binary and
/opt/alienread-only itself, so the agent verifies that instead of building a private mount namespace (a pod’s default seccomp profile blocksunshare). The agent refuses to start if the mounts are not there, so setting it elsewhere cannot turn protection off. - EXEC_
USER - Name of the exec identity’s passwd and group entries.
- GCP_
AGENT_ LOG_ FILTER RUST_LOGfor a GCP image, which the agent needs set before it logs anything.- GCP_
AGENT_ PLATFORM - GCP keeps a root supervisor separate from the non-root command identity. Live conformance must verify root execution and capability bounds because the provider’s published custom-image requirements do not promise root support. Agent Platform serves the port the template declares; the agent keeps the shared port so a workload that binds 8080 itself does not collide with it (measured live: with the agent on 8080 a root supervisor that also binds 8080 exits at startup).
- IMAGE_
COMMAND_ PATH - Installed outside the command-writable session directory.
- IMAGE_
COMMAND_ WITH_ IMAGE_ PERMISSIONS - The
ENV_IMAGE_COMMANDvalue deployment sets when the sandbox declares image permissions or lifecycle steps. A released agent refuses it and so fails the image build’s validate hook; a current one reads it astrueplus a requirement to enforceENV_IMAGE_PERMISSIONS. - IMAGE_
PERMISSIONS_ VERSION - The only
ENV_IMAGE_PERMISSIONS_VERSIONvalue. - IMAGE_
ROOT_ CAPABILITY_ MASK IMAGE_ROOT_CAPABILITY_SETas the 32-bitCapEffmask the agent applies.- IMAGE_
ROOT_ CAPABILITY_ SET - Linux capabilities a root image process keeps: Docker’s default set without
NET_RAW. - KUBERNETES_
SANDBOX - A Kubernetes sandbox pod. The cluster’s sandboxed runtime is the tenant boundary and refuses to
start a root container here (
runAsNonRoot), so the agent starts as the exec uid and supervises under it. Anything on the cluster network can reach the pod, so a caller presents a signed capability. The exec uid is a default: a non-root baseUSERreplaces it. - MUST_
DROP_ PUBLIC_ PROBE - The public address the Operator asks the gate to probe.
- NATIVE_
TOKEN_ PATH - Per-boot agent credential read only through an authenticated native file API.
- PREVIEW_
CAPABILITY_ HEADER - Header carrying a preview capability. Never
Authorization: the caller’s own bearer token belongs to the code inside the sandbox and reaches it untouched. - PREVIEW_
CAPABILITY_ MAX_ SECONDS - Longest a preview capability lives, in seconds. A grant never outlives the session either.
- PREVIEW_
PORT_ HEADER - Header naming the sandbox port a preview request is for.
- SESSION_
ROOT_ MODE - Mode of the session root, which the exec uid owns.
- STAGED_
AGENT_ FILE - The agent’s file name inside that directory. A pod mounts directories only, never the single
file: runtimes that run the pod in a VM share a directory mount into the guest as a mount
point but do not list a single-file bind mount, so the agent could not prove the file
read-only there. The container starts the agent from
STAGED_AGENT_PATH. - STAGED_
AGENT_ NAME - File name the staging step also writes at the top of the staging directory. Agents built before the directory mount were staged that way and an Operator of that release mounts it over the image’s agent path; keeping it lets that Operator run an image built with this agent.
- STAGED_
AGENT_ PATH - Where the staged agent runs from on Kubernetes (inside the read-only
/opt/alienmount). - STAGED_
METADATA_ NAME - Name of the directory inside the staging volume that the pod mounts read-only at
/opt/alien. - STAGE_
PROTECTED_ FILES_ ARGUMENT - The agent’s first argument that stages the protected files (the Kubernetes init container).
Functions§
- contract_
env - The
ENVblock carrying the agent’s configuration contract. - entrypoint
EXPOSE, the image’s ending, and theENTRYPOINT.- gcp_
agent_ platform_ env - Every variable a GCP Agent Platform image sets: the contract, then
RUST_LOG. - identity_
setup - The
RUNstep creating the exec identity and the session root it owns.