Skip to content
redactsure
Book a demo

Explore.

Data Report · RedactSure Research
Chris Sowa · Founder, RedactSure
Published
Last updated

Is Claude Code Safe to Run on Your Work Laptop?

No, not on a laptop that holds production credentials, unless what the agent reads arrives as a token. Sandboxing bounds Bash commands and can mask a credential so a command sees a sentinel, but Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks run outside it, so check which of those routes your setup leaves open.

A credential reference travels from a browser record through a bounded route to a separate API destination.

A developer laptop is a working machine. It holds the access keys in ~/.aws that deploy a service, the .env files of three projects, an SSH key for the production host and a browser logged into the same consoles, and an agent running there inherits the account that owns all of it. Claude Code's sandbox puts an operating-system boundary around the Bash tool and a proxy in front of the network that tool reaches, and it can mask a credential so a command sees a sentinel where the string would be. The same documentation places the file tools, MCP servers, hooks and WebFetch outside that boundary, which leaves routes into the model that a sandbox setting does not close. A security lead approving the install is deciding what those routes may carry, on a machine where a mistyped command and an instruction hidden in a fetched page reach as far as the developer's own account. Approval prompts, permission rules and the sandbox answer three different questions, and a team that treats them as one control will approve a command expecting it to bound what the agent reads. Whether the install is defensible turns on what sits in each of those routes on this particular machine, and on who approved a use of the value before it happened.

Key findings

  • For Claude Code to be safe on a laptop that holds production credentials, the values the model can read would have to arrive as tokens, with the real value released only at the destination a named person approved; masking a credential for a sandboxed command leaves the file tools outside (Can a Coding Agent Use a Credential It Cannot Read?).
  • It would also require a named person approving each deploy, push and credential use, and a record that separates what the agent did from what the person did, which is an identity design and not a sandbox setting (AWS, 2026).
  • The pages reviewed describe the boundary around Bash and nothing about who approves a use of a credential or what the model read outside it (Is a Sandbox Enough to Make a Coding Agent Safe?).
  • Anthropic's sandboxing page states that the sandbox "covers shell commands only," and places Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks outside it, so a file one command cannot open is still a file the agent reads (Anthropic, Sandboxing, 2026).
  • Coder's guidance for running coding agents states that "LLMs and agents can be dangerous if not run with proper boundaries" and advises separate identities with limited scope instead of full permissions on a user's behalf (Coder, 2026).
  • A preprint on adaptive attacks reports that it bypassed 12 published defenses with "attack success rate above 90% for most," a reason not to rest a laptop's safety on a model declining to use a value it was handed (Nasr et al., 2025).

What does the sandbox cover, and what does the agent read outside it?

Two controls sit on a developer laptop and they govern different surfaces. A governed browser environment covers what an agent reads and does on a rendered page: a cloud console, a repository settings page, an admin dashboard, a sign-up form. It does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. Claude Code works in the terminal, so the control that applies there is the sandbox Anthropic documents, and that page draws its own boundary: the sandbox "covers shell commands only," while Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks run outside it (Anthropic, Sandboxing, 2026).

The record for this page is a laptop with AWS keys in ~/.aws, shared between a developer and an agent working through a backlog. Sandboxing bounds the command: a Bash call that lists a bucket runs inside the operating-system sandbox, and with the key masked under sandbox.credentials the command sees a sentinel while a proxy on the laptop puts the real value on requests to the hosts in injectHosts. The Read tool is not that command. It opens ~/.aws/credentials as a file, returns the string into the model's context, and the setting that governs it is a permission rule, because "A denyRead entry doesn't stop the Read tool" and Read, Edit and Write "follow permission rules instead" (Anthropic, Sandboxing, 2026).

So the list of what sits outside the boundary is short and specific, and a laptop has all of it by default: the file tools, the web tools, MCP servers and hooks (Can a Coding Agent Read My AWS Credentials File?). Each of the four returns content into the same context the model reads on the next turn, which is why a command-level boundary cannot answer a question about what the agent saw.

What can an agent read on a laptop that the sandbox does not govern?

The four routes return different things and they arrive in the same place. The file tools return whatever file the agent opens, and on a developer laptop that includes the credentials file, the .env of the service being worked on and any key in the home directory. The web tools return the body of a page, and a page is content someone else can write. An MCP server returns whatever it chooses, under a connection string configured outside the sandbox. A hook runs a shell command on a lifecycle event with the user's access, outside the boundary the sandbox draws.

The masking setting does not cover any of them. With mask, the sandboxed command sees a sentinel and the local proxy substitutes the real value only for the hosts in injectHosts, which keeps the string out of that command's environment and not out of a file the Read tool opens (Anthropic, Sandboxing, 2026). A masked value that also sits in a file is not protected by the mask, since the tool that opens the file returns the string and the environment variable never enters the picture (Is It Safe to Give Claude Code My GitHub Token?; Do Claude Code Transcripts Contain My Credentials?).

The consequence is a design rule rather than a bug in the sandbox. Infisical's post on its agent vault states the principle a laptop setup has to meet: "the agent should not be trusted with direct access to any secrets," which its own proxy implements and Claude Code's sandbox does not claim to (Infisical, 2026). The failure it prevents is on the record: "Cursor's agent deleted PocketOS's production database via a single rogue API call," an action the account permitted even though the task did not ask for it (Columbia DAPLab, 2026).

What do the vendors themselves say?

Two vendors document a control that bears on this question, and both describe where it stops.

Anthropic documents the sandbox as a boundary around the Bash tool with a proxy in front of the network that tool reaches, plus credential settings that deny or mask a named credential for sandboxed commands. The setting is honored from user settings, managed settings and the --settings flag and, per the page, ignored in a repository's own .claude/settings.json, so the rule a reviewer sees in a code review is the one that does not apply (Anthropic, Sandboxing, 2026). Its page also states the part a laptop owner has to plan around: the file tools follow permission rules instead of the sandbox, and local MCP servers and hooks run with full access.

Coder's guidance is about the identity the agent runs under rather than the values it reads. It states that "LLMs and agents can be dangerous if not run with proper boundaries" and advises separate identities with limited scope, which places the control on who the agent is rather than on what it can open (Coder, 2026).

Dimension Anthropic, per its documentation What a buyer should verify
Where the boundary sits Around Bash commands, with a proxy for the network they reach Which steps in the workflow run as commands and which do not
What runs outside it Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks Whether any of those can reach a credential on the machine
What masking covers Sandboxed commands: a sentinel to the command, the real value on requests to listed hosts Whether the same value also sits in a file the agent can open
Where the rule lives User settings, managed settings and --settings; ignored in the repository's own settings file That the rule is in a file a contributor cannot commit
Who approves a use No approver is named for the use of a credential That a named person approves, and that the approval is attributable
What record exists The session transcript; no exported record is named What the model read, beside who approved what

The approver and the exported record are the two things the pages reviewed do not describe, and a buyer who needs them is buying a control that sits outside the harness (Anthropic, Sandboxing, 2026).

Who approves an action that runs outside the sandbox?

The approval on a laptop is the developer's own, given at the prompt for a tool call. The prompt governs that call, and it decides one call at a time: a command the developer approves can still write anywhere that account can, so the reach of the approval is the reach of the login (Can a Coding Agent Escape Its Sandbox?).

Attribution is the harder half. AWS's guidance for agentic AI asks that "audit logs attribute every action unambiguously to either an agent or a human actor," a property of how the agent is identified rather than of the sandbox (AWS, 2026). On one laptop, with one login, an action the agent takes and an action the developer takes look the same in most logs, and the person who approved the call is the person whose account made it.

The person on the other side of the approval carries a second condition. The New York DFS letter asks covered entities to consider "authentication factors that can withstand AI-manipulated deepfakes," a condition on the person at the keyboard who approves an action (New York State Department of Financial Services, 2024). Coder's advice points the same way, since separate identities with limited scope make the agent's work attributable without the developer's full authority behind it (Coder, 2026).

A record that answers the question has three fields: what the model read, what the agent did, and whose name is on the approval. The transcript covers the first, and the second and third have no exported form in the pages reviewed, which leaves a reviewer reconstructing a run from a conversation.

What should a security team ask for in writing?

The questions below separate a boundary around commands from a boundary around values, and a team that gets written answers can tell which one it has bought.

  • Which tools run inside the boundary, and which of Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks can reach a credential on the machine.
  • Where the credential rule is stored, since a rule in the repository's .claude/settings.json is ignored and a rule in user or managed settings is not (Anthropic, Sandboxing, 2026).
  • Whether a Read(...) permission rule names ~/.aws, .env and ~/.ssh, because a sandbox deny entry governs commands and the file tool follows a different setting (Does Claude Code Read My .env File?).
  • Who approves a use of the credential, whether that person is identifiable in the log (AWS, 2026), and what second factor stands behind the approval (New York State Department of Financial Services, 2024).
  • What record shows what the model received from a rendered screen or from a file, who approved the action, and where the record is exported.
  • Whether permissions are scoped to the task or to the account, since OWASP names excessive permissions among the root causes of "the vulnerability that enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM" (OWASP, 2025).

A vendor that answers the first three and not the last three has described a sandbox and not a control over what the agent reads, and the answers belong in the same file as the laptop build.

What does a governed environment change?

A governed environment acts where a page is rendered to the model, before any model reads it. Values chosen by policy are replaced with consistent tokens for the whole run, so the agent works with AWS_KEY_001 where the access key would sit, and real values resolve only at the approved destination, at the moment of an approved action. A named person approves each payment, submission and record change, and every screen as tokens, every action and every approval is written to a record that exports to the organization's own monitoring.

Its scope is the rendered surface. What it reaches is the page as the agent receives it, from a cloud console to a settings page, and it does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. For the laptop in this page's record, the console the agent opens in a browser comes inside the control, and the Bash command that reads ~/.aws does not.

What changes for a terminal workflow is custody rather than reading: a credential the agent cannot read, an approval a named person gives for its use, and a record of both. A content filter is the other design, and it carries upkeep: a defense tested against indirect prompt injection needs "a suite of adaptive attack techniques to run continuously against past, current, and future versions of Gemini" (Shi et al., 2025). The two controls differ in the surface each governs, which the comparison for this vendor sets out (RedactSure vs Claude Code: 2026 Comparison & Alternative).

What the record shows

A token in place of the real value, released only where a named person approved, is the property that decides whether an agent can work a laptop safely, and the sandbox Anthropic documents supplies half of it. A sandbox bounds the commands an agent runs and the network they reach, and it can mask a credential those commands would otherwise hold; the same documentation places the file tools, the web tools, MCP servers and hooks outside that boundary, so the value a command cannot read is still a value the agent can. On this record the sandbox bounds the command and leaves the reading, and the reading is where a laptop's credentials live. A buyer can test the claim in an afternoon: list every place a working credential sits on the machine, run one agent task that should not need each one, and compare what the model received against the list. Where a file or a page would have handed over the real value, the team should ask for a control that gives the model a token instead, with an approval and a record beside it.

Methodology and limitations

This page rests on Anthropic's Claude Code sandboxing documentation, Coder's guidance for running coding agents, AWS Well-Architected guidance for agentic AI, a New York DFS industry letter, an OWASP entry, two research preprints, a vendor post from Infisical, a Columbia DAPLab position paper and existing RedactSure research pages. Vendor pages were read between October 16, 2026 and October 21, 2026, and each Sources line carries the date for its page. Public documentation read in full gives a sound view of where each product applies its control.

None of the products on this page was tested for it. "Not described" means the pages reviewed, vendor features change and the page carries its date, and RedactSure is deploying now with enterprise and government customers. The example describes a record type, a laptop with AWS keys in ~/.aws and an agent working a backlog, and not an organization. Determinations belong to counsel, assessors and the organization's own security and compliance officers, and nothing here replaces a pilot of one workflow on the organization's own machine.

Frequently asked questions

Is Claude Code safe to run on your work laptop?

No, not on a laptop that holds production credentials, unless the values the agent can read are tokens. Sandboxing bounds Bash commands and can mask a credential for them, while the file tools, the web tools, MCP servers and hooks run outside that boundary. A machine that keeps keys in ~/.aws and a live .env file gives those routes something worth taking, so the answer depends on what the machine holds rather than on the install being current.

What runs outside the Claude Code sandbox?

Read, Edit, Write, WebFetch, WebSearch, MCP servers and hooks, per Anthropic's sandboxing page, which states that the sandbox covers shell commands only. The file tools follow permission rules instead, so a Read(...) deny rule is the mechanism for a path, and local MCP servers and hooks run with the user's access. Each of them returns content into the model's context in the same way a command's output does, so the boundary covers the command rather than the reading.

Does masking a credential keep it away from the model?

Only from the sandboxed command. With mask, that command sees a sentinel and a proxy on the machine substitutes the real value for requests to the hosts in injectHosts. A value that also sits in a file the Read tool opens is not covered, and neither is a value an MCP server returns. Masking narrows what one command holds and does not change what the agent can read.

Who approves a command the agent runs?

The developer at the keyboard, through the permission prompt, and the approval reaches as far as that login does. That is one person approving one call, with no second identity behind it and no separate approval for a use of the credential, which is why a shared laptop makes the approval hard to attribute. A written policy that requires a named approver has to sit outside the harness, in whatever holds the credential and records who released it.

What record shows what the model read?

The session transcript shows the conversation, and the pages reviewed name no exported record that pairs a value with an approval. AWS's guidance asks for logs that attribute every action to an agent or to a human actor, which is the property a reviewer needs. A transcript answers who said what, and it does not answer which file or page the context was built from, so an export that pairs the two is the artifact a review asks for first.

Can a control on the rendered page cover a terminal agent?

No. A governed environment covers what an agent reads and does on a rendered page, and it does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. For a coding agent the controls that apply are the sandbox, a credential the agent cannot read and an approval recorded outside the harness. The console it opens in a browser is the part a rendered-page control reaches.

About the author

Chris Sowa is a founder of RedactSure and a former CEO of an AI company; he started it years before ChatGPT existed. He previously led AI at Accenture, served as Global VP of Strategy & Innovation at Schneider Electric, was CCO of Sovos, and spent more than a decade at Oracle, with earlier roles at SAP and IBM.

How RedactSure Keeps Laptop Credentials Out of an Agent's Context

A sandbox that bounds commands still leaves the file tools, the web tools, MCP servers and hooks reading what the developer's account can reach.

The environment that enforces this is built by RedactSure, an AI agent controls, governance and data protection company.

Before, the agent reads the key on the console page, so a mask on the next command protects nothing. Inside the governed environment the console renders AWS_KEY_001, and the real key resolves only for the destination a named person approved, under a policy for the task rather than a standing rule for the application. For each task, RedactSure's Policy Planner proposes what the agent may see and what it may do.

RedactSure is deploying now with enterprise and government customers. Anthropic bounds commands, and its own page places the file tools outside.

Everyone else controls where data can go. RedactSure controls what the AI can see.

See it on your own workflow

One console session puts an access key into the context for the rest of the run. Bring a task where an agent opens a console and see, with test values, what it reads, who approves the release and what the record holds. Book a demo

Book a demo

Book a demo

Having trouble? Open the booking page or email us.