docs
Agent sandboxes with Coder AI Platform
Coder gives each AI agent, and each developer, its own workspace in your cluster. The agent writes and runs code there, not on a laptop.
AI PlatformCoder is included in the AI Platform pack and in Enterprise. See the AI Platform pack →
The problem
A coding agent can run commands on its own. Without a sandbox, it has your rights on the machine it runs on: whatever you can do there, it can do too.
- One bad command breaks thingsIt can delete files, overwrite a branch or drop a database in seconds.
- It sees your secretsOn a laptop, it can read SSH keys, cloud credentials and
.envfiles, then send them anywhere. - It can be trickedA README, an issue or a web page can hide instructions, and the agent may follow them. This is called prompt injection.
- It runs what it installsA malicious package runs with the same rights as the agent.
- In the cluster, it reaches everythingWith no network rules, it can reach your other apps, their databases and the Kubernetes API.
- No budget, no record per agentAgents often share one provider key. You cannot cap what each one spends, or see what each one asked.
The solution
Coder gives each agent its own sandbox: a workspace in your cluster. If the agent makes a mistake or is tricked, your laptop and your other apps stay out of its reach.
WHO ASKS
- AI agentMCP via LiteLLM
- DeveloperCoder's web app
Each one asks Coder for a workspace
Coder
TEMPLATE
- Kubernetes
Coder starts the workspace
IN YOUR CLUSTER
- Workspaceown pod + disknamespace coderagent runs code
Model calls go through LiteLLM
- LiteLLMkey and budget
- Langfusetraces calls
Each workspace starts from the template that comes with AI Platform. Every agent gets the same dev environment, with the same tools.
Security built in
- Only the keys you give itThe agent starts with what the template gives it, plus its own key for LiteLLM, AI Platform's model gateway. No personal files, and no personal credentials unless you add them.
- The rest of the cluster is closedNetwork policies are on by default and filter traffic both ways. Inside the cluster, a workspace reaches only namespace
coder, Coder's web address, LiteLLM and DNS. Your other apps, their databases and the Kubernetes API are out of reach. - Coder is fenced in tooCoder can create pods only in namespace
coder. - A key and a budget per agentEach agent calls its models with its own LiteLLM key. You can set a budget on that key. Langfuse records every call, so you see what each agent asked.
- Easy to resetSomething broke inside the workspace? Delete it and start a fresh one from the template. Push your work first: its disk goes with it.
Two limits to keep in mind
- The Internet stays openAn agent can reach git hosts, package registries and other sites. A tricked agent could still send data out that way, so give it only the access it needs.
- Templates need trustWorkspaces share namespace
coderwith each other, the Coder server and its database. A template decides what runs there: only let people you trust edit templates.
Agents drive Coder over MCP
MCP is a standard way for agents to call tools. With Coder's MCP tools, an agent creates workspaces, runs commands and reads or writes files. It reaches them through LiteLLM, with the same key as its models: keep that key secret. An agent that drives Coder from a laptop still runs its other tools on that laptop.
Get started
Open Coder
Go to
https://coder.<domain>.Create a workspace
Start it from the Kubernetes template.
Point the agent at LiteLLM
Give it LiteLLM's address and its own key. For Claude Code:
export ANTHROPIC_BASE_URL=http://litellm.litellm.svc:4000 export ANTHROPIC_AUTH_TOKEN=sk-...
Good to know
- No backup with AI Platform aloneAI Platform does not back up workspaces. With Enterprise, the nightly backup covers namespace
coderand the workspace disks: see Backups. - Open source editionAI Platform runs Coder's open source edition, with no license. Paid features, such as audit logs, are not included. Coder's 2.38.5 docs match the installed version.