How JoyStream gives an Organizational Agent a place to run code securely.
5 min read
Earlier this month, OpenAI shipped something special … for developers: the Agents API, which gives every agent an environment to work with files and run code. JoyStream has done something special as well … for developers and organizational agents. This post is about how ours is built, and why the one decision we made differently, where the secrets live, changes everything downstream.
OpenAI hosts the harness. You choose the compute: their hosted sandbox, your own infrastructure running their exec server, or one of nine partners such as Vercel, Cloudflare, E2B, and Modal. The harness compacts context as a session grows, loads tool definitions on demand, and delegates work to parallel subagents.
It is a developer product. You write the task, pick the model, wire the tools, and get back a running agent.
A JoyStream agent run is reproducible, auditable, and each leaves no secret behind in a VM.
When a compliance reviewer asks what the agent did on Tuesday at 6:03pm, the answer is in run ledger with the exact command, its size, and the artifact it produced.
That is what sandboxing looks like when it is built for a team that will hand the agent to someone else.
The choice that shapes everything else is the credential boundary.
OpenAI's own security guide says to keep third-party credentials outside the environment and route requests through a broker.
We agree, and we built the broker: the JoyStream MCP gateway makes every outside call, and there is no option to put a connector secret in the VM.
The Agents API leaves that door open for developers who want it. If your agent is going to run for people who didn't build it, that door has to stay shut.
| OpenAI Agents API | JoyStream | |
|---|---|---|
| Who it is for | Developers building an agent product | Teams building an agent by chat |
| Unit of work | A session, durable, can run for days | A run, bounded, written to a ledger |
| Where the model loop runs | Inside the OpenAI harness, next to the environment | In our worker, outside the VM |
| What the VM can see | A restricted executor key. Third-party secrets stay out only if the developer builds a broker | A JoyStream run token scoped to the tenant and agent run, and an API URL |
| Who picks the sandbox | From OpenAI's, your own, or a partner's | The platform, at build time, per skill |
| Model | OpenAI models | Any model, bring your own key |
| Cross-run state | Sessions persist and can be resumed | None. Artifacts carry state between steps only |
| Record of what ran | Session events | Every command, every artifact, in the run ledger |
An agent run gets a sandbox if an agent requires it. This happens when a skill need to run code, or handle files: convert a markdown report to PDF, fill a .docx template, lint a repository.
The sandbox is a fresh Linux microVM on E2B. It belongs to exactly one run. It is created on the first step that needs it and destroyed when the run ends. Nothing survives from one run to the next.
The sandbox is an execution detail of a skill, not a place the agent lives.
Three properties follow from that.
The model loop stays outside the VM. The VM only runs code. If the VM dies, the run record still knows what happened.
Only two things enter the VM. A short-lived run token scoped to this workspace, agent, and run, and the URL of our API. No connector credential and no model key.
The platform decides when a sandbox is needed. At build time we inspect each skill bundle and decide which agent execution steps need to be executed in a sandbox.
Basically, anything a Linux shell can do. The image ships Debian with Python, uv, pip, Node, pandoc, LibreOffice, poppler, git, curl, and jq, and the skill can install more.
There are two ways a skill uses it:
SKILL.md. We run it with the step's inputs in the environment and read a JSON result from stdout.Either way, whatever lands in /workspace/out is collected, scrubbed of anything that looks like a secret, capped, and stored as an artifact the next step can use.
Open Joyvis - our agent builder, use or describe a skill that needs code, say a weekly report rendered to PDF and dropped into a shared drive, and add a skill with a script in it. Build it. Run it. Then open the run record and read the sandbox commands next to the artifact they made.
If you have a workflow like that, try JoyStream and tell us what you built or send us your feedback.