Every agent has a sandbox — the agent reaches for it on its own when the work calls for it. It’s created fresh for the run and discarded afterwards. The three Sandbox tools appear in the agent’s tool list as always on and can’t be switched off, because every agent gets a sandbox regardless. To steer an agent toward or away from using it, use custom instructions.
What It Does
Sandbox Write File writes the exact content the agent supplies, and can check the file as it writes — confirm it has the expected number of lines and, for a Python script, that it compiles — so a truncated or broken file is caught at write time instead of failing later in the run.
Typical uses:
- Loop one API call across hundreds of records in a single script instead of hundreds of agent turns
- Parse or reshape a CSV/JSON export the agent fetched from another tool
- Run a one-off calculation or text transformation
- Produce a file — a CSV, a chart, a PDF — for someone to download off the run
Files The Agent Leaves Behind Become Downloads
When the run ends, every file the agent left in itsworkspace/ directory is saved and attached to that run as an artifact, downloadable from the run’s page in the dashboard (and via the public API). Files the agent tucked into a hidden directory are skipped, as are the oversized tool outputs described below.
This is worth knowing for two reasons:
- It’s how the agent hands you a file. A CSV, spreadsheet, chart, or PDF the agent builds is a real deliverable you can open — it isn’t stuck inside the run.
- It’s a separate path from Generate Artifact. That tool writes a markdown report that renders inline on the run. The sandbox produces actual files you download. Turning Generate Artifact off stops the written reports; it doesn’t stop an agent that has been instructed to build a file from building one in the sandbox. If you don’t want an agent producing files, say so in its custom instructions.
