Pick your provider
Each page has a full example in TypeScript and in Python, and the steps from a terminal.E2B
Sandbox.create with envs and an outbound allow list.Daytona
daytona.v0.create with the agent’s environment and a domain allow list.boat
boat.create with env and an allow network policy.Modal
A sandbox with
env and an outbound policy.Vercel Sandbox
A sandbox with
env and a network policy.Another provider
What a provider needs to work with OneCLI.
How it works
The names here are the TypeScript SDK’s. The Python SDK has the same ones in snake case:agent.allow_hosts, agent.setup_command, and agent.base_url(host).
1
Make an agent for the sandbox
onecli.agents.create makes an agent on one vault. Its answer holds everything the sandbox needs. The agent ends by itself after its lifetime: one hour unless you set another.2
Start the sandbox with the agent's settings
Give the sandbox
agent.env as its environment, and agent.allowHosts as its network allow list. agent.env holds the agent’s credential, so don’t log it.3
Run the setup line once
Run
agent.setupCommand in the sandbox. It writes the certificate files that agent.env points at. Until it has run, HTTPS calls in the sandbox fail with a certificate error.agent.disconnect().
The SDK pages for TypeScript and Python have every option: lifetimes, a vault by name, and which clients work through the gateway.
Providers compared
The options are named as in each provider’s TypeScript SDK. Each provider page has the Python names too.Behind an allow list by host name, Node’s
http and https modules, and clients built on them such as axios, fail: they send no host name to the gateway, so the allow list drops their calls. Give those clients agent.baseUrl(host). curl, Node fetch, Python requests, git, npm and pip work through the proxy settings.Any other provider
A provider works with OneCLI when it can do three things:- Set environment variables for the sandbox, when it starts or for each command. Give it
agent.env. - Let the sandbox reach
agent.allowHosts. With no allow list, the sandbox reaches them anyway. - Run a shell line in the sandbox, with
sh,curland root certificates installed. Runagent.setupCommandthere once.
Why OneCLI when a provider injects keys
Each provider above can also add a key to a sandbox’s outgoing calls itself, as the table shows. Like OneCLI, the sandbox then never holds the key. If you use one provider and a few fixed keys, that can be enough. What OneCLI adds:- One vault for every place your agents run: any sandbox provider, your laptop, servers and CI. You add a key once, and moving to another provider changes nothing.
- Permissions per item, and per tool for an app: let a call through, ask a person first, or block it. See Agent access.
- Rules for the whole organization: block, require approval, or limit the rate. See Rules.
- A log of every call by every agent, allowed or blocked. See Activity log.
- App connections: sign in to an app such as GitHub or Google once, and OneCLI renews its tokens. See App connections.
- An agent per sandbox, with its own credential that ends by itself or when you disconnect it.
From a terminal
Use this to connect one sandbox that is already running, from a terminal where you are signed in. You make a one-use connect token, then run one line inside the sandbox. If your code starts the sandboxes, use your provider’s page instead: the SDK makes an agent with each sandbox, with no token. You needonecli 3.4 or later, signed in with onecli login. See the Quickstart.
Make a connect token
Find the vault the agent should use:e2b, daytona, boat or vercel:
--expires-in sets another time, from 1m to 60m. The token is a credential: pass it only to the sandbox it is for, and don’t log or save it.
install_command needs only sh and curl in the sandbox. It writes agent.env (mode 0600) and a line in the shell profile that reads it, so a new login shell sends its calls through OneCLI. Run it as the user the agent runs as.
Give your machine access to the sandbox
You runinstall_command inside the sandbox with the vendor’s own CLI. That needs your vendor account on this machine. Try these in order, and stop at the first one that works.
1
Check whether this machine is signed in
- E2B
- Daytona
- boat
- Vercel Sandbox
e2b is missing, install it with npm i -g @e2b/cli.2
Sign in with your browser
Run the vendor’s sign-in in your own terminal. It opens your browser, and you type no key:Then run the check from the first step again.
- E2B
- Daytona
- boat
- Vercel Sandbox
3
If there is no browser sign-in, save a key in a file
Make an API key in the vendor’s dashboard. For E2B, that is e2b.dev/dashboard?tab=keys. Then run this in your own terminal. It asks for the key without showing it, and saves it in a file only you can read:From then on, start each vendor command with the key read from the file, so the key never shows on screen:For boat, sign the CLI in with the key once, from the file:Vercel Sandbox has no key step:
- E2B
- Daytona
- boat
sandbox login prints a link you can open on any device.Never put the key in a command as text. Once the agent is connected, you can remove the file, for example rm ~/.onecli/e2b.key.Run the line in the sandbox
Pick the running sandbox the agent works in from the list. To start a new one:- E2B
- Daytona
- boat
- Vercel Sandbox
install_command there, as it is, in place of <install_command>:
- E2B
- Daytona
- boat
- Vercel Sandbox
Check the agent is connected
401:
200, because the gateway added the Test key. A login shell reads the proxy settings that connecting wrote: