The AI Gazette

Agent securityClaude

Anthropic's new guide shows enterprises how to fence in coding agents

Anthropic's enterprise guide, published on 23 November, sets six questions to ask of any coding agent, names four risks that change when agents do the work, and walks through Claude Code's defenses layer by layer, with measured results. In an outside study Anthropic paid for, none of 720 injection attempts got past Claude Code in auto mode.

Drawing of a hand holding up an open book with blank pages, on a pale green background.
Image: Anthropic (opens in a new tab)

Coding agents no longer only suggest code. At many large companies they open pull requests, review them, run tests and merge. Anthropic's guide, written for organizations on Claude Team and Enterprise plans, opens with one customer result: after standardizing on Claude Code, Salesforce reported 79% more pull requests merged per developer and 5% fewer total incidents, and a footnote says Salesforce Ventures invests in Anthropic. The guide's premise is that agent work is now large enough to need a security framework, and that the aim is not zero risk. Jason Clinton, Anthropic's deputy chief information security officer, puts the job as making agentic risk "legible and bounded" so a business can accept what it can manage.

The first chapter gives six questions to put to any coding agent before it is trusted. Does the model refuse when it should? Are its actions checked outside the model before they run? Does the environment limit how much damage one mistake can do? Can policy be locked centrally so no single developer can undo it? Is the code it writes reviewed for security? Can an incident be reconstructed afterwards? For each question the guide lists a weak answer to watch for, such as a system prompt telling the model to decline, an instruction not to leave the working directory, or logs available only on request.

The second chapter covers four risks that security teams already know but that change shape with agents. Anything an agent can read it can leak, so long-lived keys should give way to short-lived tokens issued per job. Agents add packages in minutes, and MCP servers, plugins, skills and a repository's instruction files count as dependencies too, since their text reaches the agent the moment they load. Data can leave through services already on an allowlist, such as a push to an attacker's own GitHub repository, or through DNS lookups. Prompt injection, hidden instructions in issues, web pages, tool results or code comments, works like social engineering, with every log showing a legitimate request.

Claude Code answers with two layers, and the first relies on judgment. Alignment training teaches the model to refuse; in Anthropic's testing without production safeguards, current Claude models refused 81% to 85% of malicious requests while completing 98% to 100% of dual-use and benign ones. Prompt injection probes scan tool results and place a warning beside anything that looks like a planted instruction, reminding the model that the user's request is still the task. In tests reported in the November system card, with an attacker given 200 tries at each of 40 scenarios, the probes cut successful attacks on Claude Opus 5.5 from 54.6% to 11.1%. The guide adds that training makes a bad outcome less likely but does not limit how bad it can be.

The third judgment check is the auto mode classifier, a separate model that looks at each proposed action the rules do not already settle and asks whether it fits what the developer asked for. A command that suits fixing a failing test looks different from one that copies secrets out of a configuration file. Tool results are stripped from what the classifier sees, so injected text cannot argue with it. In a July study by Trajectory Labs, paid for by Anthropic, none of 720 injection attempts succeeded against Claude Code in auto mode, while Codex running GPT-5.6 Sol let 5.83% through in its automated review mode. In an August study, 1,053 paid testers caught 13.6% of dangerous commands that auto mode blocked 89% of the time. Auto mode is now the default for interactive sessions on every plan.

The second layer is fixed and does not depend on judgment. Permission rules come as allow, ask and deny, and Claude Code checks deny rules first, so no allow rule can carve an exception; a deny rule in managed settings cannot be overridden by any user or project. Every shell command is parsed into its parts, so a rule allowing git status does not also approve git status chained to a request to an attacker's server. Hooks, scripts that run at fixed points such as before each tool call, can block a commit that contains a secret or reject a settings change made in the middle of a session.

Sandboxing limits each shell command to the project folder and an allowlist of sites, and cloud sessions run each task in its own virtual machine with GitHub credentials kept outside it. Stripe, the guide notes, gives its agents a fresh disposable machine for every task with no access to production. The guide also flags defaults that quietly fail open. A hook that fails or times out lets the call through unless it is set to block. A sandbox that cannot start leaves commands running uncontained unless told to refuse. When managed settings arrive by more than one route, only the highest-ranked source applies, with no warning.

The guide closes with a pilot plan. Start with one low-stakes repository and deploy a central baseline with strict sandboxing, deny rules on credential paths, credential masking, an egress allowlist and auto mode, then turn on telemetry export and run for two weeks without changing the policy. Afterwards, review every classifier denial, sandbox block and refused connection, and add the allowlist entries real work needed rather than relaxing deny rules. Actions that cannot be undone and would cost more than a review, such as production database migrations, access policy changes and edits to infrastructure definitions, still need a person's approval.

Our jobs are to make agentic risk legible and bounded
From Anthropic's guideJason Clinton, deputy chief information security officer at Anthropic, on the aim of agent security.

From other editions

Say hi.