Platform Agents Docs Pricing Security Start building →
Agent environment / codex

Run Codex in an isolated cloud sandbox.

One API call gives OpenAI's coding agent a real Linux machine — repo checked out, tools installed, network locked down, and nothing left behind when the session ends.

Prefer a full walkthrough? Run Codex in an isolated sandbox →
TEMPLATE
codex
AUTH
OPENAI_API_KEY
ISOLATION
gVisor
EGRESS
default-deny
OVRIN / SANDBOX 9A21 EXITED 0
import ovrin client = ovrin.Client() sandbox = client.sandboxes.create( template="codex", env={"OPENAI_API_KEY": key}, ) result = sandbox.run( 'codex "find and fix the failing test"' ) print(result.stdout)
isolated with gVisor19 ms
sandbox ready · /workspace mounted151 ms
Codex started2.0 s
task completed27.4 s
Why a sandbox

Codex is happiest with a whole machine.

Codex is built to read a repository, run the test suite and patch code in a loop. Left alone on a shared host it will happily install packages, spawn subprocesses and rewrite files no one asked it to touch.

01
Untrusted repos by default
Point Codex at a PR from an external contributor without giving it a lane onto your infrastructure.
02
Iterate-and-test loops stay contained
Codex runs the suite, edits, reruns — dozens of times per task. Every process lives in one disposable sandbox.
03
Network on a leash
Default-deny egress. Allowlist api.openai.com, your registry and your git host. Nothing else resolves.
What's in the template

Preinstalled, on the PATH.

codexOpenAI Codex CLI
git · ghClone, branch, open pull requests
python · nodeRuntimes with pip, uv, npm, pnpm
ripgrep · jq · fdThe tools the agent reaches for first
/workspaceWritable working directory, readable over the API
Egress policy
ALLOWapi.openai.com
ALLOWgithub.com
ALLOWpypi.org · registry.npmjs.org
DENY* everything else
Policy is per sandbox and enforced by the egress sidecar with dns+nft, not by the agent's own good behaviour.
Other environments

Same API, different agent.

Give Codex a computer.

Create an API key and run your first session in the next few minutes.

$pip install ovrin