Skip to content
AgentOS
DocumentationSandboxed execution

Platform

Sandboxed execution

Templates, limits and network rules for agent code.

When an agent writes code, the code runs in a sandbox: a short-lived environment with its own filesystem, no credentials and no network access unless you allow it.

sandboxes/node-ci.yamlYAML
name: node-ciimage: node:22-ci@sha256:9b07d1f3   # pinned by digest resources:  cpu: 4  memory: 8Gi  disk: 16Gi  timeout: 20m network:  egress: deny                 # default  allow:    - registry.npmjs.org credentials: none              # nothing is mounted unless a task grants iton_exit: destroy

Templates

A template defines the environment a sandbox starts from. Agents refer to a template by name in their manifest.

KeyDescription
imageThe container image, pinned by digest so every sandbox starts from the same contents.
resourcesCPU, memory and disk, and the longest a sandbox may run.
networkOutbound access. Denied by default, with an allowlist of hosts.
credentialsWhat is mounted into the sandbox. Nothing, unless a task grants it.
on_exitWhat happens when the task ends. Sandboxes are destroyed.

Lifecycle

  1. A step asks to run code. Policy is checked first.
  2. A sandbox starts from the template, and the files the task needs are mounted in.
  3. The command runs. Its output, exit code and resource use are captured.
  4. Artifacts are collected, and the sandbox is destroyed.

Within one run, later steps can reuse a warm sandbox. Sandboxes are never shared between runs.

Network access

Outbound requests are checked against the template's allowlist and the hosts a task has been allowed. Anything else is blocked, and the attempt is listed in the trace.

Limits

A sandbox that reaches its time limit is stopped, and the step fails with the reason. CPU, memory and disk are capped at the values in the template.

What is captured

  • The command and its output.
  • The exit code and duration.
  • CPU time and peak memory.
  • Every outbound request, allowed or blocked.

The sandboxes view in the demo console shows sessions and templates. Sandbox compute is metered by the vCPU-hour, as described under pricing.