Inside CloudThinker's Sandbox: How Agent Commands Run Safely

Where CloudThinker runs agent commands and what they can reach: a Kubernetes pod under gVisor, connection credentials injected only when a command runs, secrets masked before the model sees output, and writes decided before they run. Covers Environments, private networks and the honest limits.

EngineeringUpdated Nov 2, 2026

Cover Image for Inside CloudThinker's Sandbox: How Agent Commands Run Safely

Inside CloudThinker's Sandbox: How Agent Commands Run Safely

It's 03:04 and an agent is twenty minutes into an incident. It has read a security group, pulled pod logs and queried a Postgres replica. Now it wants to run a short Python script it wrote a few seconds ago to parse four thousand log lines. Every one of those commands ran somewhere, with some credential, on some kernel. Where that somewhere is decides what happens when the agent is wrong, or when a log line it read carries an instruction meant for it.

Every command CloudThinker runs against your systems runs in one of two places: CloudThinker's managed sandbox, or an environment you run. This post is about the sandbox, the execution layer under CloudThinker's security model. It's built so that code an agent just wrote never talks to the host kernel, connection credentials show up only when a command runs, secrets in output are masked before the model sees them, and every write is decided before it runs.

Why the usual execution model breaks for agents

Most platforms run agent code the way CI runs a build step: start a container, run the script, keep the logs. That was fine for code a human reviewed. It breaks for agents for structural reasons.

Containers share the host kernel. Every container on a node makes system calls into the same kernel. A kernel bug is a container escape. That's acceptable for trusted build steps. It isn't for code a model wrote a second ago.

Credentials sit on disk next to the code. A long-lived key in an env file or a mounted secret stays there between tasks, readable by any script the agent generates and any dependency it installs, and nothing stops a command from printing it.

Output goes straight to the model. A command that prints a config file hands every secret in it to the model, the transcript and whatever stores the transcript.

The check comes after the fact. If the only control is reviewing what ran, a destructive command gets reviewed once it's done.

The record is optional. Shell history on one runner isn't evidence anyone can query a week later.

Where a command runs

01Request

Where you ask

  • ChatWeb app, Slack, Teams or Google Chat
  • AlertAn incident Resolve picks up
  • AutomationA schedule, webhook or probe

02Decide

CloudThinker Cloud

  • ModelSees placeholders, never secrets
  • Auto ModeEach write decided before it runs
  • Encrypted credentialsStored here, never shown in chat

03Execute

CloudThinkerSandbox

  • KubernetesgVisor podUser-space kernel
  • Connection CLIsaws, kubectl, psql and more
  • Credential at run timeInjected for the command only

One machine per workspace

04Reach

Your systems

  • AWSCloud accountsRole you created
  • KubernetesClustersService account RBAC
  • PostgreSQLDatabasesRead-only user

Your permissions are the ceiling

The model and the write decision live in CloudThinker Cloud. Commands run in the sandbox, with a credential whose reach you set at the provider.

The model, and the decision about each write, live in CloudThinker Cloud. The command itself runs in the sandbox.

The sandbox is a Kubernetes pod running under gVisor. It's a workspace machine: your whole workspace shares it, each session gets its own folder there, and it keeps the workspace's memory, skills and the files earlier runs left behind. The command-line tool for each connection (aws, kubectl, psql and the rest) is installed there.

Because the machine is shared, treat any file a run writes as visible to your teammates' runs. The boundary that keeps teams and environments apart is the workspace: agents and members in one workspace can't use another workspace's connections, data or conversations. Production and staging belong in separate workspaces.

gVisor: agent code never talks to the host kernel

An ordinary container sends its system calls straight to the host kernel. gVisor puts an application kernel, the Sentry, in between. The Sentry implements the Linux system call interface in user space, so the agent's script calls into the Sentry, not the host. The Sentry itself reaches the host through a small set of system calls filtered with seccomp. The gVisor security model explains the design in detail.

To reach the host kernel, an attacker first has to break the Sentry, then work through the narrow, filtered set of calls the Sentry is allowed to make.

gVisor isn't free. System-call-heavy work runs slower than in a plain container. An investigation spends most of its time waiting on cloud and tool APIs, so for code nobody reviewed, we take that trade.

How a credential reaches a command

01Request

A command

The agent picks a command for the connection it needs.

02Decide

Read or write

Reads run. Writes go through Auto Mode first.

03Inject

Credential

The connection secret enters the sandbox for this command.

04Run

gVisor pod

The command runs behind a user-space kernel.

05Mask

Placeholders

Secrets and identifiers are replaced before the model sees output.

One command, start to finish. The credential exists in the sandbox only while the command needs it.

Connection credentials are encrypted at rest with Fernet (AES-128 with HMAC-SHA256) under a key CloudThinker manages. A credential is injected into the sandbox only when a command runs. It's never sent to an environment and never shown back in chat.

AWS is the short-lived case. You create an IAM role with a trust policy locked to an External ID. CloudThinker assumes it through STS and gets short-lived credentials, so there's no long-lived AWS secret to leak or rotate. Each session is named cloudthinker-<workspace prefix>-<Unix timestamp>, which is how it shows up in CloudTrail:

aws cloudtrail lookup-events \
  --start-time 2026-11-01T00:00:00Z \
  --query "Events[?starts_with(Username || '', 'cloudthinker-')].[EventTime,EventName,Username]" \
  --output table

Everything else stores a long-lived secret. Access keys, client secrets, service-account JSON keys and API tokens need rotation at the provider. Replace… on the connection swaps the value and keeps its alias, settings and history.

Workspace credentials cover any other secret a command needs, such as a vendor API key. Every workspace credential is passed to every command as an environment variable, whether or not the prompt mentions it. You can't limit one to a single agent or Automation, so a secret that only some work should see belongs in a separate workspace.

In every case, the credential's own permissions are the ceiling. If the role can't delete a bucket, no prompt can make it.

What comes back out

Before command output reaches the model, the chat or stored history, CloudThinker replaces secrets and personal identifiers with placeholders:

ct:secret:v3:openai-api-key:2d9c4e7a0b16
ct:pii:v3:email:4c1f0a9e27b3 [op***@ma***.com]

Connection secrets are matched exactly. So are workspace credentials saved under a secret-sounding name (containing KEY, TOKEN, SECRET or PASSWORD) with a value of 6 or more characters. Known credential formats are caught by pattern, along with emails, phone numbers, card numbers and IBANs, which are on by default.

Within one conversation the same value always gets the same placeholder, so the agent can still tell that two log lines mention the same key. In another conversation it gets a different one. Nobody, the agent included, can turn a placeholder back into the value. When a command needs the real secret, it reads it from the environment as $KEY.

Here's an illustrative run. An engineer asks why / is filling on a staging web host. The agent runs df -h / and du -xh /var/log | sort -h | tail -5 over the SSH connection and finds one application log growing about 2 GB an hour. The app has been dumping its config into that log, AWS secret key included. The key reaches the model as a placeholder because the Cloud credentials rule matches that format, even though nobody ever saved it in CloudThinker. The agent proposes a logrotate change. That's a write, so it waits for a decision.

Writes are decided before they run

Reads always run. Every write goes through Auto Mode before the command reaches the sandbox, so you decide what runs on its own and what waits for approval. A command that sends a stored credential to another service, such as curl with $STRIPE_API_KEY in a header, is checked the same way. A write also needs the connection to allow it: if the credential is read-only, the write fails whatever Auto Mode says. The sandbox never decides whether a write is allowed. It only runs what was already decided.

Environments: when the work has to run on your machine

An environment (in beta) is a folder on a machine you run, such as a laptop, a server or a CI runner. File tools stay inside the folder. Shell commands run as your OS account and aren't sandboxed, so they can read ~/.ssh and reach your network. Connection commands still run in the managed sandbox, and the credential stays in the cloud. Run the worker process under a dedicated account with no cloud credentials in its home folder. Where Your Keys Live covers environments in detail.

Reaching private systems

Connections run from CloudThinker Cloud, so a service must accept connections from the internet. To keep one private, you have two options in CloudThinker Cloud: allowlist CloudThinker's egress IPs (ask your CloudThinker contact for the list), or run an environment inside your network with the service's own command-line tool and credentials installed on it.

When nothing may leave your perimeter, dedicated and self-hosted deployments run inside your own network, connected over Direct Connect, ExpressRoute, Cloud Interconnect or VPN. They're in early access. In the self-hosted reference designs, sandboxes run on their own node group, kept apart from the platform. Resolve and AWS PrivateLink walks through each option.

01Default

Managed sandbox

CloudThinker Cloud. Reaches services that accept traffic from the internet, ideally only from CloudThinker egress IPs.

02Beta

Environment

A folder on your machine. Shell commands run there unsandboxed; connection commands still run in the cloud.

03Early access

Self-hosted

The whole platform in your network, with sandboxes on their own node group.

Three places agent work can run. Most teams start on the managed sandbox.

The record

Every command an agent runs, and its output, stays in the conversation. The calls also land in your provider's own logs, such as CloudTrail or the Kubernetes audit log.

On Scale and above, Audit Logs records user, agent and system actions across the organization: connection and credential changes, approval decisions (including ones AI judgment granted) and every shell command run in an environment. Nobody can edit or delete an entry, entries are kept 90 days, and you can export them as CSV. There's no built-in stream to a SIEM, so export on a schedule if you need a longer record. Credential entries never include the key name or the value.

Why this beats the usual execution model

Typical agent executionCloudThinker sandbox
KernelShared with every container on the nodegVisor application kernel in user space
CredentialsLong-lived keys in env files or mountsEncrypted at rest, injected when a command runs, short-lived STS for AWS
Secrets in outputPrinted to the model and the transcriptReplaced with placeholders before the model, chat and storage
WritesWhatever the key allowsDecided through Auto Mode before the command runs
StateWhatever the image or runner leftOne machine per workspace, a folder per session
RecordShell history on one runnerThe conversation, your provider's logs and Audit Logs

The deeper difference is what you have to trust. In the usual model, safety depends on the agent behaving and on every runner being configured correctly. Here, a wrong or manipulated agent still runs behind a user-space kernel, with a credential whose reach you set at the provider, and its output is masked before the model sees it.

Honest limits

Every workspace credential reaches every command. Use separate workspaces to keep a secret away from some work.

The workspace machine is shared. Files one run writes are visible to other runs in the same workspace.

Environment shell commands aren't sandboxed. They run as the OS account you start the worker process with.

Masking catches known formats. An unusual secret format can get through. A credential saved under a plain name like REGION, or shorter than 6 characters, is masked only if it matches a known format.

Keys are CloudThinker-managed. Customer-managed encryption keys aren't offered in CloudThinker Cloud.

Audit Logs needs Scale or above. On Free and Team, audit AWS activity from CloudTrail by filtering on the role you created for CloudThinker.

Getting started

Connect a staging source with a read-only credential, then ask:

"Check disk usage on our staging web hosts and tell me what's growing. Read only. Tell me which connection you used for each check."

"Run aws sts get-caller-identity and tell me which role and session name you're running as."

Connect a source and ask your first question. The Security page covers the rest of the model.

Related reading

About the author

ST

Steve Tran

Founder & CTO, CloudThinker

Steve Tran is the founder and CTO of CloudThinker, which builds Frontier Investigation Agents for production cloud operations. He writes about incident investigation, cloud cost, and the practices teams use to safely run autonomous AI agents against production AWS, GCP, and Azure environments.

sandboxsecurityisolationzerotrustenterprisecompliance