Skip to main content

Give the agent the CLI

Coding agents run shell commands. Install styne 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:
The agent reads stdout, stderr and the exit code like for any command. The loop an agent runs looks like this:
The second call answers a record with "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 with E2B_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:
Tools: 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 timeout so a lost sandbox ends by itself, and tag it with metadata.
  • Do not paste secrets into a sandbox you do not control; pass them as envs of the one command that needs them.