Give the agent the CLI
Coding agents run shell commands. Installstyne where the agent runs (install), put your key in
STYNE_API_KEY, and tell the agent how to use it. Add this to the agent’s instruction file:
"stdout":"42\n" and "exitCode":0. CLI reference lists every
command.
Use an agent framework with the SDK
Frameworks that already run code in an E2B sandbox work unchanged withE2B_API_KEY set to your Styne key and
E2B_API_URL=https://api.styne.ai; see Switch from E2B. Wrap sbx.commands.run and sbx.files.write as the
agent’s tools.
Connect the MCP server
The server is a thin layer over the same API, so the same key, limits and billing apply. These are the settings you will use:sandbox_create, sandbox_list, sandbox_kill, sandbox_pause, sandbox_resume, run_command, run_code,
file_write, file_read, file_list, get_preview_url. The full table, output cuts and retry rules are on
MCP server.
Keep it safe
- Give the agent a key of its own, so you can revoke it without touching yours.
- An agent forgets sandboxes. Create with a short
timeoutso a lost sandbox ends by itself, and tag it withmetadata. - Do not paste secrets into a sandbox you do not control; pass them as
envsof the one command that needs them.