Security

Sandboxing AI coding agents in isolated VMs under SOC 2

Capy team

Isolate each agent task in its own microVM with a separate Linux kernel, keep long-lived git and cloud credentials off the machine, and enforce merges through GitHub branch protection. In Capy, every cloud thread boots its own isolated microVM that sleeps about two minutes after idle and deletes after 14 days asleep, while git and gh traffic routes through a server-side git proxy so no GitHub token lands on the VM. Cloud access uses per-project short-lived OIDC tokens whose subject identifies the thread in AWS, Google Cloud, Azure, or Vault logs, and private services connect through ephemeral Tailscale nodes governed by your ACLs. Capy is SOC 2 Type II compliant, with the report available on request from its Trust Center, does not train models on non-public customer content, and offers zero data retention on request and run-in-your-own-cloud deployment on Enterprise.

Why laptop sessions and shared runners fail as sandboxes

A coding agent on a developer's laptop runs with that person's local SSH keys, cloud profiles, browser sessions, and full disk access. A linked folder in a desktop app sets the working directory, not a security boundary. Shared build runners carry a similar risk when concurrent tasks share a filesystem or environment variables.

Isolating an agent on a production codebase requires per-task VM boundaries paired with short-lived credentials. In Capy, every cloud thread boots its own isolated microVM with a dedicated Linux kernel, memory, and disk. Inside that VM, the agent has passwordless sudo and can run Docker without touching any other machine. Subagents either share their parent's VM for read-only work or boot a separate microVM for isolated edits.

Machines sleep about two minutes after a thread stops working. The disk survives sleep, while memory and running processes stop. After 14 days asleep, Capy deletes the VM along with anything not pushed to git or saved to Drive.

Keeping git tokens, secrets, and cloud keys off the VM

VM isolation limits blast radius across tasks, while credential architecture limits what a single compromised or misdirected task can reach. For the broader evaluation list across every control, see A security checklist for coding agents.

  • Server-side git proxy. Cloud machines hold no GitHub token. git and gh commands route through Capy's git proxy, which holds the token server-side, so any tool trying to read a raw $GH_TOKEN inside the VM fails. You choose which repositories the GitHub App installation covers, review machines can read but cannot push, and an optional read-only Dependency reader app handles private dependencies Capy only needs to fetch.
  • Encrypted environment variables. Project secrets are encrypted at rest, decrypted only when a machine that needs them is prepared, written to a protected file outside repositories, excluded from diffs and snapshots, and sourced into every shell. Scopes split into Shared for a project, Personal, and Thread. The model sees each variable's name and whether it has a value, never the value itself. Because Capy does not scrub command stdout, code that prints a variable puts that value in the transcript, so pass only scoped, revocable credentials.
  • Short-lived OIDC cloud credentials. Capy acts as an OIDC issuer and writes a short-lived signed token to a file on each machine. AWS AssumeRoleWithWebIdentity, Google Cloud Workload Identity Federation, Azure federated credentials, HashiCorp Vault JWT auth, or generic OIDC exchanges that token for temporary credentials with zero static keys stored in Capy. Trusts map per project, the token's subject names the thread in your cloud audit logs, and editing or deleting the trust on your side revokes access. Read the full walkthrough in Giving coding agents cloud access without stored keys.
  • Private reach through Tailscale. When a VM needs a staging database or internal API, Tailscale joins the machine to your tailnet at boot as an ephemeral tagged node, and your tailnet ACLs decide exactly which hosts and ports it can reach. See Connecting cloud coding agents to private APIs.

Compliance, audit logs, and merge boundaries

Security teams reviewing an agent platform usually ask for third-party attestation, data retention terms, identity controls, and hard merge gates.

Control areaHow Capy handles it
Compliance reportsSOC 2 Type II, with the report on request from the Trust Center, plus a Data Processing Addendum
Model training and ZDRNo training on non-public code, messages, or files unless you opt in or agree in writing; zero data retention for Capy's storage on request on Enterprise; per-model ZDR status listed on Capy credits
Keys and provider controlsOn your own API keys, requests run under your provider agreement; admins can lock a model to an org key with Only or disable personal keys
Identity and accessSSO via Google Workspace, Okta, Microsoft Entra ID, or SAML 2.0, enforceable as required; MFA and passkeys; owner, admin, and member roles; private threads, Captains, and projects
Audit trailFull thread transcripts of messages, tool calls, and outputs; Settings → Org → Audit log for organization changes, visible to admins and owners; OIDC subject logged per thread in your cloud
Deployment and supportRun in your own cloud and 24/7 support in Slack Connect backed by an SLA on Enterprise

On merges, Capy's core instructions forbid merging a pull request or enabling auto-merge unless someone asks in the current conversation. Neither AGENTS.md nor project rules can override the bans on unasked merges, exposing secrets, or fabricating results. Keep GitHub branch protection and required human reviews enabled as the hard control on your repositories.

A worked example: debugging a production settlement issue safely

A payments team needs an agent to trace a rounding bug in production logs without handing any VM write access to production systems or static cloud keys.

  1. An admin installs Capy's GitHub App only on payments-core, keeps GitHub branch protection requiring two human approvals on main, and sets up an AWS OIDC trust giving that project a read-only role on settlement logs.
  2. Tailscale ACLs allow ephemeral Capy-tagged nodes to reach only the staging ledger replica on port 5432, leaving production databases unreachable.
  3. An engineer opens a cloud thread. The isolated microVM clones payments-core through the git proxy, exchanges its OIDC JWT via AssumeRoleWithWebIdentity to read the failing settlement trace, and reproduces the mismatch against staging over Tailscale.
  4. Your AWS audit log records the read under the thread's OIDC subject. The agent pushes a fix branch and opens a pull request, cannot merge it, and the microVM sleeps about two minutes after the thread stops working.

Where Capy fits

Every Capy cloud thread gets its own VM and credentials your security team can trace:

  • Runs each cloud thread in an isolated microVM with its own Linux kernel, passwordless sudo inside its own VM, Docker support, sleep after about two minutes idle, and deletion after 14 days asleep.
  • Keeps GitHub tokens in a server-side proxy, encrypts environment variables at rest, issues per-project OIDC tokens, and connects private services through ephemeral Tailscale nodes.
  • Backs procurement with SOC 2 Type II attestation on the Trust Center, SAML 2.0 SSO, an organization audit log, zero data retention on request, and Enterprise deployment in your own cloud. Full details live in the security documentation and on the security overview.

And where it doesn't:

  • Cloud VMs can reach the public internet, and Capy does not publish egress IP addresses. Contact support before turning on an IP allow-list, route private services through Tailscale ACLs with scoped credentials, and ask about running Capy in your own cloud on Enterprise if your network policy needs more than that. A fully air-gapped deployment is not a documented option.
  • Capy does not scrub command stdout, so a script that prints an environment variable puts it into the thread transcript. Use OIDC and narrow, revocable credentials rather than broad static keys.
  • Capy works with repositories on GitHub.com only. GitHub Enterprise Server and other git hosts aren't supported.
  • For one engineer running a single local agent where nobody else needs cloud transcripts or shared isolation, a local Docker container or devcontainer is simpler and cheaper.

Follow-up questions

Can a coding agent extract the GitHub token from its cloud VM?

No. Cloud machines hold no GitHub token. git and gh traffic passes through Capy's server-side git proxy, so any script attempting to read $GH_TOKEN fails.

Are threads run through the desktop app sandboxed the same way?

No. A thread running on your own computer through the desktop app executes commands as you with your local git credentials, and a linked folder is not a sandbox. Use cloud threads whenever you need isolated microVMs.

How long does data stay on a cloud microVM after work stops?

A cloud machine sleeps about two minutes after the thread stops working, clearing memory and running processes while keeping its disk. After 14 days asleep, Capy deletes the machine and anything on disk that was not pushed to git or saved to Drive.

What do we send our security team for a SOC 2 review?

Start with the SOC 2 Type II report, requested from the Trust Center, the Data Processing Addendum, and the security documentation. For zero data retention on Capy's storage or deploying inside your own cloud, review the Enterprise options.