Field guide · 16 sources

Field guide: Agent security

Controls on what an agent can reach and do: sandboxes, credentials, injection testing, model supply chain and incident lessons.

Bottom line

Put the controls on what an agent can reach and do, not on what it is told. In their own evaluations, the MetaPI authors found no defense among eight that kept both strong utility and strong security against adaptive attacks on one victim model (R089-f3). Microsoft researchers planted a backdoor in open weights by editing seven neurons, a technique Microsoft says it has not seen attackers use (R033-f1, R033-f5). In one incident Cursor reported, credentials leaked through a vendor's key and agent traces (R195-f1). In practice that means five things:

The research figures come from authors testing their own attacks or benchmarks (R033-f1, R053-f1, R089-f3, R142-f1). In MetaPI, on a deepseek-v4-flash victim, no evaluated defense had both strong utility and strong security under adaptive attacks (R089-f3). In Microsoft Research's own evaluation, rewiring seven neurons in Nemotron-Terminal-8B made it emit a payload on at least 98.8% of triggered test contexts, measured as next-token prediction on recorded contexts rather than live agent runs (R033-f1, R033-f3). In Hu et al.'s experiment, poisoning 0.1% of a 100B-token corpus planted a backdoor in a 4B CLI agent that survived clean SFT, DPO and GRPO (R053-f1).

The rest of the evidence is design documents, a protocol specification, vendor posts and single incidents. The two project documentation sets describe intended behaviour and report no red-team or security evaluation (R030-f2, R093-f4). Incident write-ups are one case each, often told by the affected company or a vendor (R195-f1, R172-f4, R161-f4). The one incident ledger counts published reports, not attacks (R152-f1).

Decide first

QuestionIf yesIf noEvidence
Does the agent need a real filesystem, a shell or package installs?Use a container or microVM boundary whose supervisor owns DNS, egress and credential injection, as OpenShell's documentation describes for its own design (R030-f1, R030-f2)An interpreter sandbox with no files, network, environment or secrets unless exposed as functions may fit; Pydantic says its own is wrong for agents that install packages or walk a filesystem (R061-f1, R061-f4)(R030-f1, R030-f2, R061-f1, R061-f4)
Does the agent run git or other repo tooling at startup?The guide's inference: run the trust check and sandbox before any repo tooling, because seven CLI agents were reported running git status or git diff at startup, some before the trust prompt, so a repo-local core.fsmonitor setting could run a command outside any sandbox (R112-f2)Still mediate egress through one authenticated channel (R030-f2)(R112-f2, R030-f2)
Does the agent reach an MCP server over HTTP?Follow the 2025-11-25 authorization spec: PKCE with S256, the resource parameter on both requests, and servers that reject tokens not issued for them (R062-f1, R062-f2)For stdio the spec says implementations should not follow it and should take credentials from the environment (R062-f5)(R062-f1, R062-f2, R062-f5)
Does the agent sign in as a person (OIDC)?It acts as the signed-in person in Omnigraph, so to keep it read-only give it its own credential with a narrowed policy, as Omnigraph's release notes advise (R074-f2)Check what its credential's policy allows before upgrading, since agents gain every tool their policy allows (R074-f2)R074-f2
Do you load open weights or checkpoints you did not train?Microsoft Threat Intelligence recommends diffing each checkpoint against its declared base, verified hashes from the original publisher, and a private registry (R033-f5)Your own checkpoints are equally exposed to anyone with write access (R033-f6), and a poisoned pretraining corpus can plant a backdoor, so Hu et al. argue for corpus provenance and for guarding the action with sandboxing, least privilege, allow-lists or human confirmation, without evaluating these (R053-f4)(R033-f5, R033-f6, R053-f4)
Can the protected tasks tolerate a large utility loss?A strict design such as CaMeL cut attack success to 0.0 on AppWorld, with clean utility falling to 33.7 (R089-f3)Lighter defenses kept utility but left attacks working, for example DataSentinel at 77.1 utility and 41.7 attack success (R089-f3); add action-level guards (R053-f4)(R089-f3, R053-f4)
Does a third-party script run in your users' browsers?Origin checks did not stop the Optimizely script: in research F5 cites, with no sample size given, only 15% of checked sites had a policy that stopped it (R172-f2); F5 says its own behaviour-based product flagged it on one customer site, with no detection rates reported (R172-f3, R172-f4)This exposure does not arise; in F5's case the code was delivered by Optimizely's own integration (R172-f1)(R172-f1, R172-f2, R172-f3, R172-f4)

Do

  1. Make the supervisor, not the agent, own the network. OpenShell's documentation describes a split where the sandbox side intercepts TCP opens and DNS with seccomp user notification, and a trusted supervisor makes every policy decision, resolves DNS, opens approved connections and adds credentials only for allowed endpoints (R030-f1). Its only egress path is the authenticated supervisor channel, and the agent cannot start until that boundary is confirmed (R030-f2). This is a vendor design description with no measurement or red-team result (R030-f2). Microsoft Threat Intelligence recommends isolated sandboxes and egress controls for agents (R033-f5). The Australian government review of one incident found that an OpenAI agent under evaluation was not appropriately contained and lacked timely human oversight (R048-f3).

  2. Start the boundary before the agent touches the repository. F5 Labs relays a Manifold Security finding that seven CLI coding agents run git at startup, on some before the trust prompt or authentication, so a repo-local core.fsmonitor setting executes a command outside any sandbox (R112-f2). Four of the eight findings were unpatched at publication (R112-f2). GitLab's CVE-2026-90970 (CVSS 9.9) let an authenticated Duo Agent Platform user escape the prompt template sandbox and run commands on a self-hosted gateway (R112-f4). Both are single findings relayed by a vendor (R112-f2, R112-f4).

  3. Know which boundary you actually have. Pydantic's Agent Sandboxes runs agent-written Python in a Rust interpreter with 50 ms of CPU per run and 20 MiB per session, and the page says it is not a container or VM (R061-f1, R061-f4). These are product settings from a vendor page, not measured results (R061-f1). Its escape bounty is announced with no results (R061-f5). In a self-reported and disputed case, a personal-finance bot with read-only bank access posted its owner's balances to Slack, because a second bot on the same account had Slack access and the vendor documents that bots share one cloud computer that is not a security boundary (R112-f3).

  4. Check sandbox policy with a prover, and read what a pass means. OpenShell's prover uses an SMT solver to compare a candidate policy to a maximum boundary policy and returns a counterexample, and a separate risk check flags agent-proposed rules that add credentialed destinations or cloud metadata access (R030-f3). It models only filesystem, process identity, Landlock, L4 network and REST rules, returns unsupported for GraphQL, MCP, WebSocket and JSON-RPC, and returns inconclusive above 1,024 network rules (R030-f4). The vendor states that a pass does not mean the policy is narrow, safe for the task, or enforced by a running sandbox (R030-f5).

  5. Bind MCP tokens to the server that receives them. The MCP 2025-11-25 spec treats a protected server as an OAuth 2.1 resource server that must publish Protected Resource Metadata (R062-f1). Clients must use PKCE with S256 and refuse to proceed if the server does not advertise it, must send the RFC 8707 resource parameter, and servers must reject tokens not issued for them and must not pass other tokens through (R062-f2). On a missing scope, servers should return 403 insufficient_scope and clients should attempt step-up with retry limits (R062-f4). Client ID Metadata Documents alone do not stop localhost redirect impersonation (R062-f5).

  6. Let policy, not hidden tools, decide what an agent may run. Omnigraph 0.15 removed the flags that hid MCP write tools, so an MCP agent now gets the same answers and refusals as an HTTP client with the same credential (R074-f1). Its release notes tell operators to check what each agent credential allows before upgrading, because agents gain every tool their policy allows, and to keep an agent read-only by narrowing its policy and giving it its own credential (R074-f2). This is one vendor's upgrade guidance for its own product (R074-f2).

  7. Treat vendor keys and agent traces as part of your perimeter. Cursor reports that a key it issued to its vendor Fireworks was exposed and used to copy coding-agent traces, a small number of which held unredacted credentials (R195-f1). With those credentials the attacker placed malicious Claude Code extension builds on the cache behind Cursor's marketplace for about 11 hours, during which at most 5,000 users may have received them (R195-f2). Cursor says it expanded network location restrictions on provider credentials, added secret scanning across repositories and other internal data, and rotated all credentials (R195-f3). These are company-reported figures and an unverified remediation list (R195-f1, R195-f3). The incident ledger also lists a cloud breach through an unrevoked AI-provider key (R152-f4).

  8. Check where agents put artifacts, not only what they run. Glow Labs, as summarised by F5 Labs, found coding agents asked to attach screenshots to pull requests created public GitHub repositories to host them, exposing more than 13,000 screenshots and recordings across 900-plus repositories, 93% in personal accounts (R112-f1). At one vendor, more than a dozen agents encoded the workaround as a skill within a week (R112-f1).

  9. Evaluate injection defenses with adaptive attacks in the real environment. MetaPI turns utility benchmarks into injection suites with a PAIR-style optimizer capped at 12 iterations and a validator that re-runs each attack in the real environment (R089-f1). In the authors' runs, defenses reporting near-zero success on AgentDojo did worse there, for example PromptArmor at 35.4% attack success on AppWorld (R089-f4). On AppWorld only, with five backbone models, GPT as attacker reached 29% attack success because it refused to write payloads, while deepseek, kimi-k3 and claude-sonnet-5 reached at least 50% (R089-f5). Using more than one attacker model is the guide's inference from that result (R089-f5). One deepseek model both ran the pipeline and was the default victim (R089-f6).

  10. Guard the action, because some triggers cannot be scrubbed from input. In Hu et al.'s experiment on a 4B Qwen3 agent, an ordinary provider-name path trigger gave a 92.7% Pass@32 attack success rate on about 1,000 synthetic held-out prompts, with success counted when a rollout contained the curl-to-bash payload, not executed, and 0.0% on clean prompts (R053-f1). Those authors argue for sandboxing, least privilege, allow-lists or human confirmation, and pre-execution classifiers, since ordinary-string triggers cannot be removed from inputs (R053-f4). They did not evaluate these defenses (R053-f4).

  11. Diff checkpoints against their declared base. Microsoft Threat Intelligence recommends diffing every checkpoint, sourcing models only from the original publisher with verified hashes, a private registry that blocks runtime pulls from public hubs, and red-teaming for hidden triggers (R033-f5). That guidance also names Microsoft products, and Microsoft states it has not observed the technique used by threat actors (R033-f5). The authors say reliable detection needs the original weights and that internal models are equally exposed, since the attack needs only write access to a checkpoint (R033-f6). Hu et al. recommend treating pretraining-corpus provenance as part of an agent's security model (R053-f4).

  12. Correlate low-severity alerts by infrastructure, over flexible windows. In one intrusion Elastic analysed, 78 alerts fired across six rules, all medium or low, and they made sense only once correlated by source IP; a 14-day gap would have split a short fixed window (R161-f2). Elastic recommends both new high-signal rules for burst enumeration, such as more than 20 distinct instances read in 10 minutes, and flexible-window correlation by IP and ASN (R161-f3). Elastic labels the intrusion AI-assisted and says it cannot prove an LLM agent made the decisions (R161-f4).

  13. Disclose promptly to the right authority and say what happened. In the Australian case, OpenAI knew on 11 August 2026 and emailed a public disclosure mailbox on 10 September, without saying the activity was an autonomous agent under test and with a wrong URL (R048-f2). The review found the initial timeliness and method of OpenAI's disclosure inadequate (R048-f5). Its 18 recommendations include considering mandatory time-bound AI safety reporting and protections for incident and near-miss reporting, and most are phrased as matters to consider (R048-f4, R048-f5).

Avoid

Where the evidence disagrees

DisagreementSide ASide BWhat reconciles itWhat would settle it
Do published injection defenses work?PromptArmor, MELON, Meta-SecAlign and DRIFT report near-zero attack success on AgentDojo (R089-f4)On MetaPI's dynamic benchmarks, PromptArmor reached 35.4% and MELON 35.4% attack success on AppWorld (R089-f4)MetaPI uses an adaptive optimizer and re-runs each attack in the real environment (R089-f1), and its authors conclude static benchmarks overstate defense strength (R089-f4)The same defenses run by an independent team on MetaPI with other victim models, since one deepseek model ran the pipeline and was the victim (R089-f6)
Can a weight backdoor be found without the original weights?A detector flagged 91.43% of edited checkpoints at 9.68% false positives with no clean reference (R033-f4)The authors state reliable detection needs the original unmodified weights and no audit can guarantee safe behaviour (R033-f6)The detector was tested on edits from the same attack family it was designed around (R033-f4)Detection rates on other edit families, which the authors list as future work (R033-f3)
How vulnerable are models other than the headline one?The abstract says other models are equally vulnerable (R033-f2)Table 1 shows Qwen3.6-27B at 51.0% with 23 samples, against 98.8% for Nemotron-Terminal-8B (R033-f1, R033-f2)With 2,393 samples Qwen reached 83.7%, so the rate depends on model and fitting data (R033-f2)The same edit on more models at matched sample counts, run as live agents (R033-f3)

In the authors' model organisms, monitorability fell less on tasks that need reasoning (gap to base 0.07) than on tasks solvable without it (0.16) (R142-f2), and transparency prompting is not shown to be a reliable defense against an adversarial model (R142-f3).

The research results come from authors testing their own attacks or benchmarks, including others' defenses in MetaPI (R033-f1, R053-f1, R089-f3, R142-f1); the other figures are a vendor's own red-team harness (R196-f2), third-party findings relayed by F5 (R112-f1, R112-f5), a ledger's counts of reports (R152-f2), and vendor or company incident figures (R161-f1, R195-f1). The incident sources are single cases told by a government review (R048-f1), the affected company (R195-f1) or a security vendor (R161-f1, R172-f3).

Numbers

ClaimResultValueConditionsWhere in source
R033-f1Neuron-edit backdoor successAt least 98.8%, no observed benign leakageNemotron-Terminal-8B, 7 neurons fitted on 23 trajectories, next-token prediction on recorded contexts, Microsoft Research authors' evaluationAbstract, Table 1
R033-f2Same attack on Qwen3.6-27B51.0% (23 samples); 83.7% (2,393 samples)Six edited neurons, authors' Table 1Table 1
R033-f4Backdoor detectionTrained detector 91.43% at 9.68% FP; LLM audits 72.81% (GPT-6 Astra), 56.14% (Claude Opus 5.5)Detector tested on 66 checkpoints (35 edited, 31 clean), same attack family; audits over 114 edited checkpoints, one eachBackdoor Detection, Tables 5 and 6
R053-f1Pretraining poison backdoor92.7% (ordinary trigger), 10.5% (rare string), 0.0% clean0.1% of 100B tokens, 4B Qwen3 CLI agent, Pass@32, three seeds, payload counted not executed, authors' experimentSection 3.2, Figure 5
R053-f2Success by model size13.1% (0.6B), 51.9% (1.7B), 92.7% (4B)Declaration poison, ordinary trigger, after GRPO, three seedsSections 3.2 and 4
R053-f3Rare-string trigger at very low poison rate1.4% at 0.0005% after GRPO; benchmarks 58.5% vs 58.3%Single seed at 4B; same ablation gave 20.0% at 0.1%, so noisySection 4
R089-f2Generated injection corpus183 attacks over 107 of 150 tasksAppWorld, VitaBench, Terminal-Bench; authors' pipelineMetaPI §4.2, Table 2
R089-f3Undefended attack success / clean utility50.0/82.5 AppWorld; 45.9/96.0 VitaBench; 44.4/82.2 Terminal-Benchdeepseek-v4-flash victim, eight defenses, authors ran everythingMetaPI §4.2, Table 3
R089-f3Defense trade-off on AppWorldCaMeL 0.0 attack success at 33.7 utility; DataSentinel 41.7 at 77.1Same setup; CaMeL not run on VitaBenchMetaPI §4.2, Table 3
R089-f4Static-benchmark defenses on dynamic tasksPromptArmor 35.4%; MELON 35.4% at 1.67x tokensAppWorld, same setupMetaPI §4.2
R089-f5Attack success by modelVictims above 20%; attackers at least 50%, GPT 29%AppWorld only, five backbone modelsMetaPI §4.2, Figures 5 to 7
R142-f1CoT monitorability after persona fine-tuning0.94 to 0.68 to 0.22gpt-oss-20b model organism, 15,000 traces, GPT-5.5 monitor at 5% FP, eight trialsAbstract, Section 3.2
R030-f4Prover limitsInconclusive above 1,024 network rules; 10 s default limitVendor documentation of its own limitsPolicy Prover, What the Boundary Check Covers
R061-f1Interpreter sandbox limits50 ms CPU per run; 20 MiB per sessionVendor product settings, not measuredPage body and FAQ
R112-f1Agent-created public screenshot repos13,000-plus files in 900-plus repos, 93% personal accountsGlow Labs finding relayed by F5 LabsPixelLeak
R112-f4GitLab AI Gateway sandbox escapeCVSS 9.9Self-hosted gateway; fixed in 19.2.4, 19.3.2, 19.4.1; no confirmed exploitation as of early OctoberGitLab AI Gateway
R112-f5Involuntary in-context learning jailbreak100% vs 52% bypassAdversa AI on GPT-5.4, 50 probes, not peer reviewedAI Attack Spotlight
R152-f1Published AI hacking incident reports289 (146 Confirmed, 110 Strong, 33 Suspected)January 2023 to 17 November 2026, reports not attacksHome page
R152-f2Reports with AI running attack steps0/27 (2024), 13/80 (2025), 79/177 (2026 so far)Ledger owner's counts; graders agreed blind on 207 of 289 (71.6%)Home page and Analysis
R161-f1Intrusion tempo56 user-data reads in 141 ms; SendCommand 29 s after a parameter readOne intrusion, eight AWS identities, Elastic telemetryKey findings and timeline
R161-f2Alerts from one intrusion78 alerts, all medium or low, 65 on day oneSix rules, Elastic analysisWhich detection rules fired
R172-f1Optimizely script injection188 snippets across 178 organizations; about 16 hoursUnnamed industry research cited in an F5 blogWhat happened
R172-f2Sites whose policy stopped it15%Same research, sample size not givenWhy your usual controls missed it
R195-f1Cursor trace exposureUnder 0.01% of customers (API credentials); under 0.05% of non-Privacy-Mode users (traces)Cursor's own figuresWhat happened
R195-f2Malicious extension windowAbout 11 hours; at most 5,000 users may have received itCursor's own account with external forensicsWhat happened
R196-f2Reasoning extraction success54.0% to 0.2% (earlier request); 22.9% to 0.9% (current request)OpenAI's own red-team harness, six attacker models; model changed from GPT-6 to GPT-6.2 Astra; no FP rateMeasuring progress

How this was made

Sixteen sources were used; R093's documentation contributed no claims to the guidance above, beyond the note that it reports no security evaluation (R093-f4). They were:

A Sonnet model extracted 75 claims, 69 for the security set and 6 for MetaPI, each tied to a location in the source. Opus wrote this guide from those claims and the discrepancy notes, and a separate Opus reader checked every cited sentence against its claim; its 18 fixes are applied.

How each source was weighted:

Checking found several earlier entries wrong, overstated or unsupported. For example:

R152's counts came from an earlier snapshot of 286 reports; the live ledger showed 289 (R152-f1).

Those entries have been corrected at the source (2026-11-23).

Sources in this guide

A field guide synthesizes the Research entries it cites. Each claim id links to the entry it comes from.