The sandbox plugin gives each user a Linux sandbox where the agent runs shell and python, reads and writes files, and runs skills. It loads when SANDBOX_MCP_URL is set, and the skills plugin needs it to run a skill.
Source: packages/oracle-runtime/src/plugins/sandbox/
| Attribute | Value |
|---|---|
| Visibility | always (Node.js runtime); on-demand on the Workers runtime from 0.39.0 |
| Stability | stable |
| Category | core |
| Default state | Auto-detect (env: SANDBOX_MCP_URL) |
| Depends on | None |
Summary
Per-user Linux sandbox. sandbox_run runs shell/python (writes anywhere via shell, including /tmp for scratch). sandbox_write_file writes raw bytes, but only under /workspace/data/. Other paths are rejected; use sandbox_run with a here-doc for /tmp. The plugin passes through every upstream MCP tool verbatim and authenticates the connection with a UCAN invocation plus operator and per-user secrets as request headers. Used internally by skills for skill execution.
Environment variables
| Var | Required | Description |
|---|---|---|
SANDBOX_MCP_URL | yes | Sandbox MCP URL. Triggers auto-detect. |
ORACLE_SECRETS | no | Read but not owned (declared by the core base env schema). Each entry is forwarded as an x-os-<name> header. |
SKILLS_CAPSULES_BASE_URL | no | Read but not owned (declared by skills). When set, the plugin mints a parallel ixo:skills UCAN invocation and forwards it as X-Skills-Invocation. |
What it contributes
- Tools: every upstream MCP tool (
sandbox_run,sandbox_write_file, theartifact_*family,load_skill), passed through verbatim. By default theoracle_*management tools (oracle_list,oracle_get,oracle_health,oracle_stop,oracle_restart,oracle_get_logs) are filtered out; opt in withnew SandboxPlugin({ includeOracleManagementTools: true }).- Plus one synthetic, non-upstream tool:
sandbox_write_blob. It takes a server-storedblobId+ a sandbox path, looks the value up server-side, and forwards it tosandbox_write_file(the companion to blob storage). It is added per request only whensandbox_write_fileis present upstream and the request has a known user DID (the blob store is namespaced by user DID).
- Plus one synthetic, non-upstream tool:
- Sub-agents: none.
- Middleware: none.
- HTTP routes: none.
- Shared state: none.
On the Cloudflare Workers runtime, the manifest requires sandbox/* on ixo:sandbox. A user whose delegation doesn't grant it can't load the plugin or run its tools, and the agent is told what's missing.
From @ixo/oracle-runtime-workers 0.39.0 the plugin is on-demand on the Workers runtime. Every tool loads together, load_skill and the skill authoring tools included, because running code, its files and its artifacts depend on one another. The prompt's on-demand catalogue names it as "run code; run or publish skills; generate charts and reports". The storage rules above (where each tool may write, and that the box is scratch storage the next call must load_artifact from) moved from the summary to the plugin's operating guide, which the model gets when it loads the plugin. To bind the tools on every turn, as before:
manifestOverrides: { sandbox: { visibility: 'always' } },Opt out / opt in
const app = await createOracleApp({
config,
features: { sandbox: false }, // never load
// features: { sandbox: true }, // force load (will fail env validation if SANDBOX_MCP_URL missing)
// features: { sandbox: 'auto' }, // run autoDetect (default)
});When to use it
- Execute a skill. Call
sandbox_runwithcidso user + oracle secrets are injected; the skill folder mounts read-only at/workspace/skills/<skill-name>/. - Read a skill file (
SKILL.md, scripts, configs). Usesandbox_runwith acat/ls/grep/sed -ncommand and the skill'scid. - Hit a JSON/REST API. Write curl or python in
sandbox_run. Never use a web scraper for/api/,/v1/,/v2/,/v3/endpoints. - Generate or transform a file the user (or a later turn) will re-read. Write to
/workspace/data/output/<name>. - Re-read an attachment the user sent earlier. It is auto-archived to
/workspace/output/<filename>. - Save a large or escape-sensitive blob byte-perfect to
/workspace/data/.... Usesandbox_write_file. - Write a scratch / throwaway file. Use
sandbox_runwith a here-doc into/tmp.
When not to use it
- The value is already inline in chat. Use it as it is.
- Fetching a URL the user mentioned in this turn. Prefer
process_fileso it auto-archives. - A long human-readable page. Use
firecrawl. - Installing native deps in cwd (
pip install -e .,bun install). Install under/tmpinstead. sandbox_write_filewith a path outside/workspace/data/. The validator hard-rejects this.