Expand description
The coding-agent helpers docs/AGENT-VMS.md specifies, and the Bedrock minter.
Modules§
- bedrock
- A Bedrock bearer token from the caller’s own AWS credentials (AGENT-4).
- profile
- The profile table: every agent-specific fact L3 knows, in one place, dated.
Structs§
- Agent
Spec - One agent to install, with its two overridable defaults.
- AgentVm
- One VM with coding agents in it: the
Sandboxplus the specs it was built for. - Bearer
Token - A minted bearer token. Opaque;
Debugshows only the length. - Bedrock
Access - Model access for the agents: a Bedrock bearer token minted for a region.
- Guest
File - One file to place in the guest.
- Minted
- A token and when it stops working.
- Profile
- One agent’s recipe. Every field is a default some caller-facing knob can override;
see
docs/AGENT-VMS.md, “The rule this changes”. - Prompt
Options - The knobs on one prompt.
Enums§
- Agent
- The two coding agents this library carries a recipe for. Closed on purpose (AGENT-1): an agent with no row cannot be named, so there is no path that builds an image for a CLI nobody knows how to invoke.
- Agent
Permission Mode - The permissions the guest agent may use. Does not change the VM’s UID, IAM or network.
Constants§
- AGENT_
GID - The gid to match.
- AGENT_
UID - The uid every agent runs as, and the owner of
/workspace. Created by the image. - CODEX_
CONFIG_ FILE - Codex’s provider config.
HOME=/workspacein the env file is what makes Codex read this path. - DEFAULT_
PROMPT_ TIMEOUT - The default wait for one prompt. Agent tasks run minutes, not seconds.
- DEFAULT_
SIZE - The size class agent sessions default to: a 4 GiB always-present ceiling at half the
floor cost of the 2048 default, because agent sessions are peaky (the example’s
measured choice,
examples/coding-agents-on-bedrock/microvm.toml). - ENV_
FILE - The environment file both agents source, and where the credentials live.
- MARKER_
FILE - The guest marker
install_accesswrites andinstalled_agentsreads (AGENT-6). - VERSION_
PROBE_ TIMEOUT - The daemon-side budget for one
--versionprobe. - VERSION_
PROBE_ WAIT - The client’s wait for the probe: the daemon budget plus room for the round trips.
- WORKDIR
- The image
WORKDIR, the agent’sHOME, and where a synced project lands. The same pathcrates/microvms-cli/src/sync.rsnames asREMOTE_WORKDIR, on purpose:run <DIR>andagent-up --projectput the tree in the same place.
Functions§
- agent_
vm_ egress_ posture - The egress posture every agent VM launches with (AGENT-9).
- default_
specs - The agents a VM carries when its caller names none: Claude Code alone, with its profile’s defaults.
- dockerfile
- The Dockerfile for an image carrying
specs(AGENT-2). - ensure_
request_ for AgentVm::ensure_image’s request, for a caller holding the sandbox and the specs separately: the stem as the name prefix, the agents’ Dockerfile on the managed base, and the artifact unders3://<s3_bucket>/<s3_key_prefix>/<name>/artifact.zip.- headless_
command_ template - The headless command with
<TASK>where the quoted task goes, for a caller who wants to run it throughexec --streamor read whatpromptwould do. - image_
name_ for AgentVm::image_namefor a caller holding the sandbox and the specs separately: the bindings, whose sandbox sits behind a lock shared with every session they hand out.- image_
request_ for AgentVm::image_requestfor a caller holding the sandbox and the specs separately.- image_
stem - The stem of the image name:
agent-vm-<agents>in profile order (AGENT-3). The caller appends the artifact content hash, exactly asbuild --reusedoes. - install_
access - Places the provisioning files and hands
/workspaceto the agent uid (AGENT-5). - installed_
agents - The agents a running VM was provisioned with, read from the guest marker (AGENT-10).
- installed_
version - Probe the installed executable as the guest agent UID, without sourcing credentials. Only a numeric version is returned; arbitrary guest stdout/stderr never enters reports.
- launch_
request_ for AgentVm::launch_requestfor a caller holding the specs separately.- launched_
session - The session of the launched VM
sandboxaddresses, or the refusal a call made beforelaunchmeets:AgentVm’s own, and a binding’s that holds the sandbox apart from the specs. - prompt
- Starts one task and returns its handle. Wait, stream, poll, or ack through the handle, exactly as for any other exec.
- prompt_
request - The start request for one task (AGENT-7), with an exec id from the production clock
when
optionscarries none.prompt_request_withovercrate::session::mint_exec_id. - prompt_
request_ with - The start request for one task (AGENT-7). Pure; the test reads every field.
- prompt_
sync - Starts one task, waits for it and acks it: the task’s whole result (#266).
- provisioning_
files - The files
install_accessplaces (AGENT-5, AGENT-6): the environment file, Codex’s config when Codex is present, and the marker. Pure, so a test reads the exact bytes. - require_
specs - Refuses an empty spec list and a repeated agent.
- sh_
double_ quote - Wraps
valuein double quotes forsh, escaping the four characters that are special inside them. Used for the environment file, whose values are model ids, a region, and a token (base64 plus the prefix), none of which contain them today; the escaping is what keeps that “today” from mattering. - sh_
single_ quote - Wraps
valuein single quotes forsh. A single quote inside becomes'\'', the one sequence that is literal under every POSIX shell. Used for the task text, which is the caller’s prose and may contain anything. - spec_
for - The spec in
specsforagent, or the refusalAgentVm::promptgives.