openai-agents-prized
Prized Sandboxes as a sandbox client for the OpenAI Agents SDK. A SandboxAgent runs its shell commands and file edits in a Prized sandbox, a Linux microVM that is deleted when the run ends.
Install
pip install openai-agents-prized
export PRIZED_API_KEY=dcp_...
export OPENAI_API_KEY=sk-...
Make the Prized key at prized.dev/dashboard/workspace/api-keys with Full access, or Custom with Sandboxes: Write. Python 3.10 or later, openai-agents 0.23.1 or later, below 0.26.
Run an agent
import asyncio
from agents import Runner
from agents.run import RunConfig
from agents.sandbox import SandboxAgent, SandboxRunConfig
from openai_agents_prized import PrizedSandboxClient, PrizedSandboxClientOptions
async def main() -> None:
agent = SandboxAgent(name="coder", instructions="Work in the sandbox with your tools.")
run_config = RunConfig(
sandbox=SandboxRunConfig(
client=PrizedSandboxClient(),
options=PrizedSandboxClientOptions(vcpu=2, memory_mb=4096),
)
)
result = await Runner.run(
agent, "Write fizzbuzz.py, run it for 15, and show me the output.", run_config=run_config
)
print(result.final_output)
asyncio.run(main())
The agent's exec_command, write_stdin, and apply_patch tools run in the sandbox as the user prized, in /home/prized/work. A manifest on the SDK's default root (/workspace) is placed there too.
Options
PrizedSandboxClientOptions maps to the Sandbox API's create:
| Option | Default | Effect |
|---|---|---|
template |
prized-base-v1 |
prized-agent-v1 adds Claude Code and Codex |
vcpu, memory_mb, disk_gb |
The template's | The sandbox's shape |
env_vars, labels |
None | Set for every command; yours to filter on |
auto_pause_min, auto_delete_min, max_runtime_min |
Off, off, 1,440 (60 on the free tier) | Automatic pause and delete |
pause_on_exit |
False |
Pause instead of delete at the end of a run, so resume() continues in the same sandbox with its files and installs (the SDK ends the run's commands before the pause) |
timeouts |
PrizedSandboxTimeouts: per-command default, startup, and archive timeouts |
PrizedSandboxClient(api_key=..., api_url=...) reads PRIZED_API_KEY and PRIZED_API_URL when they are not passed.
Pause and resume
The client implements the SDK's session lifecycle: RunState round trips, snapshots, and resume(). With pause_on_exit=True, a paused sandbox keeps memory and disk for the price of storage, and the resumed run reuses it without restoring anything. Without it, the sandbox is deleted and a resumed run starts a new one and restores the workspace from the session's snapshot.
Moving from Runloop
openai-agents removed RunloopSandboxClient. Swap the client and options; the agent stays the same:
| Runloop | Prized |
|---|---|
RunloopSandboxClient() |
PrizedSandboxClient() |
RunloopSandboxClientOptions(blueprint_name=...) |
PrizedSandboxClientOptions(template=...) |
env_vars, pause_on_exit |
Same names |
metadata |
labels |
exposed_ports, tunnels, gateways, MCP, managed secrets, mounts |
Not supported |
Runloop session state cannot be resumed on Prized; start new runs.
Limits
- No root. Commands run as
prizedwithout sudo, so manifest users other thanprized, manifest groups, and mounts are refused before a sandbox is created. - No inbound network. Sandboxes reach the internet, but nothing reaches them: no exposed ports.
- Commands. A command that outlives
exec_command's yield keeps running, andwrite_stdinpolls it or types into it (withtty=True, Ctrl-C included). It runs until it exits or the session ends, unless the tool call passes atimeout. A command run withexectakes up to an hour (PrizedSandboxTimeouts.exec_timeout_unbounded_s) and keeps the first 4 MiB of its output and of its errors. - Snapshots. Symlinks are kept as links, so a virtualenv in the workspace comes back working in a replacement sandbox; hard-linked files come back as separate copies.
- Run time. 24 hours of running by default, up to 7 days with
max_runtime_min; on the free tier 60 minutes, 2 vCPU and 4 GB. - Keys. Code in the sandbox, the model's included, can read
env_vars. Keep your Prized key out of them.
Refusals from the API raise PrizedAPIError with the API's error code; sandbox failures inside a run surface as the SDK's own SandboxError types.
When something fails
A failed or cancelled create deletes the sandbox it made, and a failed resume pauses the sandbox it woke; if even that cannot reach the API, a warning names the sandbox. An answer that never came is settled by reading the sandbox, so a pause that landed is never followed by a delete. close() waits for cleanup a cancellation left running. A command whose answer is lost is never sent again, and its error says which of three it was: it never reached the sandbox, it may or may not have run, or it ran but the answer could not be read.
Development
uv sync
uv run pytest # offline, against an in-process fake of the API
PRIZED_LIVE_TESTS=1 PRIZED_API_KEY=dcp_... uv run pytest -m live # the SDK's lifecycle test on real sandboxes
PRIZED_API_KEY=dcp_... uv run python scripts/live_agent.py # a coding agent end to end, scripted model turns
Apache-2.0.
Metadata
Release files for openai-agents-prized 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openai_agents_prized-0.1.0.tar.gz | 46.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openai_agents_prized-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.0 kB
Release files / openai_agents_prized-0.1.0.tar.gz
| Download URL | openai_agents_prized-0.1.0.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a819c13fb42574511547d768090783c9b1c56fefd26d5c01a51b051d91fef54
|
|
BLAKE2b-256 checksum How to use checksums |
42b2f1495859d2a85f669216e8641c880d4557575f4d610cee6e209b318fce8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / openai_agents_prized-0.1.0-py3-none-any.whl
| Download URL | openai_agents_prized-0.1.0-py3-none-any.whl |
|---|---|
| Size | 53.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a2f10e734fbdc46bf26864d71922db34f50a1954a51d76ae71154e55b1f4b77
|
|
BLAKE2b-256 checksum How to use checksums |
52ffc55ed1e4f14f305cfb6049998300a6b10e897c3bd55ebcdb23bf7b8d2a4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for openai-agents-prized 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for openai_agents_prized-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.