Agent Security Hardening¶
CLAUDE.md rules and permission allowlists protect against accidents. They do not
protect against a compromised prompt, a leaked credential, or an agent escaping its
intended scope. Production unattended loops require security enforced at the OS and
network layer — below the model, not inside it.
(Based on clem — jahwag/clem, Jun 2026.)
OS-User-Per-Agent Isolation¶
The strongest isolation primitive for multi-agent fleets: each agent runs as a separate Linux OS user with its own home directory, git identity, and UID-scoped firewall rules. The kernel enforces the boundary — no in-process escape is possible.
| Model | Boundary | Enforced by | Bypassable from userspace? |
|---|---|---|---|
| Worktree isolation | Separate git checkout per agent | Filesystem | Yes |
| OS-user isolation | Separate Linux user (uid/gid) per agent | Kernel | No |
Each agent gets: a dedicated /home/agent-<id>/ directory, a unique git author
identity, and nftables rules scoped to its UID. One agent cannot read another's
state, credentials, or working directory even if it receives a malicious instruction
to do so.
A counter-example worth naming: a Docker container is not this boundary by default.
A popular Ralph-loop implementation runs Claude Code or Codex in an AFK
implementer→reviewer pipeline inside Docker — but its own SECURITY.md discloses that it
runs with permission-bypass flags and, by default, bind-mounts the host Docker socket,
which is root-equivalent access to the host (disableable, but on by default). A container
boundary that shares the host's Docker socket is not a containment boundary at all for the
process inside it — the self-disclosure is the notable part, since most harnesses making
this trade-off don't document it as prominently.
(daonhan/ralph, Sep 2026.)
Credential Isolation: Four Disposition Types¶
Never provision secrets directly into an agent's environment. Apply one of four dispositions per credential:
| Disposition | Mechanism | Agent ever sees the secret? |
|---|---|---|
| Broker | HTTP proxy intercepts egress and injects the real credential on the way out | No |
| Sidecar | A separate-user MCP server holds the credential; agent calls over loopback | No |
| Remove | Don't provision credentials the agent doesn't need | Not provisioned |
| Egress Firewall | UID-level nftables rules block egress to disallowed endpoints | Can't exfiltrate even if obtained |
Broker is the strongest disposition: the agent constructs requests with a placeholder token; the proxy transparently substitutes the real credential on egress. The agent cannot log, print, or exfiltrate a credential it never received.
Sidecar is the right choice for credentials used via MCP: the MCP server runs as a separate OS user, holds the credential, and exposes only the narrow operations the agent needs. The agent calls the MCP tool; the sidecar makes the authenticated request.
SECURITY_MATRIX.md¶
A machine-readable safety policy document shipped with every deployed agent. It defines: - Known-safe command patterns — explicitly whitelisted; agent executes without verification - Known-attack patterns — flagged as suspicious regardless of instruction source
The agent reads SECURITY_MATRIX.md at startup and self-assesses ambiguous instructions
before executing. Example: kill $PPID (a runner-exit protocol) must be explicitly
whitelisted or the agent flags it as a potential injection attack.
The SECURITY_MATRIX is the adversarial counterpart to the Loop Contract: the contract says what the loop should do; the matrix says what it must refuse, regardless of what any instruction — including CLAUDE.md — tells it to do.
Runtime Policy Gating (below the matrix)¶
SECURITY_MATRIX.md is a static document the agent self-checks against. A stronger layer is a runtime policy engine that gates each action mechanically, independent of the model's cooperation:
| Policy | Gates on | Purpose |
|---|---|---|
| blast_radius | The scope/impact a single action can have | Bound the damage any one step can do (a containment budget, not a permission list) |
| intent_gate | Whether the operation matches the agent's stated intent | Default-deny: an action the agent never declared it would take is refused |
| phase-scoped tool access | Which native tools are callable in the current phase | A search-phase agent cannot commit; a build-phase agent cannot deploy |
intent_gate is the closest public mechanism to the default-deny loading the
SECURITY_MATRIX implies: instead of enumerating attacks to refuse, it refuses anything
outside the declared plan. blast_radius complements it by capping how much an
allowed action may touch. (omnigent-ai/omnigent, Jul 2026.)
A concrete build-vs-operate blast_radius boundary in production. Perplexity's persistent
coding agents built CobbleDB, a ~40,000-line Rust KV store, but were deliberately excluded from
operating it in production — the boundary drawn at build vs. run, not at any specific tool or
file. (The New Stack, "Perplexity's AI agents helped build a database. They weren't allowed to
run it.", Sep 2026.)
Update (Jul 2026): intent_gate was renamed Intent Based Authorization and its
off-task-tool-call policy changed from hard-DENY to ASK for every off-task call — an
off-plan action now always prompts the human for approval rather than being silently
refused. The change is a full replacement, not a partial softening: the policy's
classifier makes a single binary on-task/off-task judgment, and every off-task verdict
resolves to ASK — there is no remaining DENY branch for off-task tool calls in the
current implementation. (omnigent-ai/omnigent, Jul 2026; PR #2024.)
Machine-to-machine auth for unattended loops. An opt-in OAuth2 client_credentials
grant lets a headless loop authenticate without a human login session, folded into the
same token-dispatch router rather than a second endpoint. Confinement is keyed on the
scope claim's presence, not grant_id's absence — a machine token stays
permission-confined while a renewed login-grant token keeps full authority. The same
class of bug that motivates the patterns above also hit this repo's own per-agent cache
path: an agent-ID-derived filesystem path was resolved before being validated, opening a
traversal/symlink-escape hole later closed by validating before resolution rather than
after. (omnigent-ai/omnigent #3977 and #6720, Sep 2026.)
Where Default-Deny Actually Gets Loaded¶
The open question was never whether to default-deny — it's where in the stack the policy gets enforced so it can't be bypassed by the model simply not calling it. Four concrete answers converged this cycle, each intercepting at a different layer:
| Layer | Mechanism | Cannot be bypassed by... |
|---|---|---|
| MCP proxy | A standalone daemon sits in front of every MCP server, verifying agent identity and denying tool calls by default before they reach the server | The agent skipping a CLAUDE.md rule — the proxy is a separate process the agent never talks to directly |
| Tool-dispatch layer | Destination-aware egress control enforced at the point every tool call is dispatched, shared across Claude Code and Codex from one policy | Switching harnesses — the policy lives below the harness, not inside it |
| OS/kernel | The policy engine is compiled into the OS layer itself; guardrails are enforced via kernel integration, not application code | The agent's own process — kernel enforcement holds even if the agent process is fully compromised |
| Session bootstrap + eval parity | A bounded runtime loads a default-deny MCP policy at session start and runs its eval suite over the same code path as production | Config drift between "the policy we tested" and "the policy that's live" |
The pattern across all four: the highest-assurance loading mechanisms move the default-deny check outside the process the model runs in — a proxy daemon, the tool-dispatch layer, or the kernel — rather than trusting a CLAUDE.md import or a SessionStart hook the model's own process could theoretically route around. (mcpharbour/mcpharbour; saagpatel/cross-provider-egress-guard; ActPlane, arXiv 2606.25189; codeafix/agent-assistant, Jul 2026.)
Named incident corroborating the "network perimeter" row's weakness specifically. A Hugging Face incident is cited as a case where an agent didn't defeat a network-level control at all — it simply acted locally instead, going around a filter placed at the network perimeter rather than inside the harness or MCP layer executing the action. The broader argument: enforcement belongs inside the harness and MCP layer, where the action is actually decided, not at the network edge where a perimeter control cannot see a locally-executed action at all — restating this table's own "cannot be bypassed by..." column from an incident rather than a design proposal. (The New Stack, "The agent didn't break your controls. It went around them.", Sep 2026.)
A first-party instance: Claude Code's own sandbox config. The same principle — the
default-deny check must live somewhere the process it protects cannot reach — shows up inside
Claude Code's own settings precedence. Project settings (.claude/settings.json,
.claude/settings.local.json) are committed to, or gitignored inside, the repo the agent is
operating on, so anything that can write to that repo can, in principle, write to that file.
Which binary the sandbox trusts to run ripgrep was moved out of that reach in v2.1.232:
"Changed
sandbox.ripgrepto be honored only from user, managed, and--settingssettings; project settings can no longer override the sandbox's ripgrep binary." — CHANGELOG.md, v2.1.232
A related but distinct nuance from v2.1.260 is worth flagging before relying on strict sandbox
mode (sandbox.allowUnsandboxedCommands: false) to block every unsandboxed command:
"Changed commands typed at the
!bash-mode prompt to run outside the sandbox even when strict sandbox mode (sandbox.allowUnsandboxedCommands: false) is on, like typing into your own terminal." — CHANGELOG.md, v2.1.260
That is not a reversal of the v2.1.232 hardening — it exempts commands a human types
interactively at the ! prompt, per the changelog's own framing ("like typing into your own
terminal"), not commands an agent or a repo's config can issue. Project settings still cannot
grant an agent-issued command a way around strict sandbox mode. See Permissions & Auto Mode §
Repo settings cannot escalate their own
privilege for the same
pattern applied to bypassPermissions (v2.1.257) and autoMode (v2.1.207).
The sandbox boundary itself used to fail open. Before v2.1.78, sandbox.enabled: true with a sandboxing dependency missing made Claude Code silently run the command unsandboxed — no warning, no error. v2.1.78 made that visible with a startup warning; v2.1.83 added sandbox.failIfUnavailable: true, which exits with an error instead of falling back unsandboxed. For an unattended run, set failIfUnavailable — a warning nobody is watching is the same as no warning. (Sandboxing, fetched 2026-09-07, confirms fail-open is still the default today.)
Enforcement Outside the Workload: NVIDIA OpenShell and Self-Hosted Sandboxes (Sept 2026)¶
On 2026-09-28 NVIDIA announced the Open Agent Safety Platform: the open-source OpenShell runtime plus Sentry, a reference system design whose out-of-band watchdog runs on BlueField-4 DPUs, in an isolated trust domain that NVIDIA says is invisible to agents. Its own claim is that Sentry quarantines an agent that moves outside its boundary "in milliseconds"; that figure is the vendor's, not independently measured. Anthropic is among the named industry partners. The OpenShell 0.1.0 technical post describes the mechanics, and they are a concrete instance of the "OS/kernel" row above:
| Mechanism | What it does (per NVIDIA's post) |
|---|---|
| Wrap, don't rewrite | Wraps existing agents (it says Codex, Claude Code, Pi and Hermes are supported) with sandboxed execution, credential management and per-agent permissions, enforced outside the workload |
| Kernel controls + supervisor | OS kernel controls limit which files a workload can read or change and block privilege escalation; a paired supervisor outside the workload checks every outbound request against policy. The controls persist when the agent starts a shell, runs generated code or launches child processes |
| Method-level inspection | The supervisor can inspect HTTP, GraphQL and MCP traffic, allowing a data query while blocking a write through the same API, so a read-only policy holds even when the real credential has write access. Every decision goes to an OCSF audit trail |
| Agent proposes, human approves | With the policy advisor on, a blocked agent may propose a narrowly scoped policy change; it stays pending for human review by default and the agent cannot approve its own request |
| Policy prover | Formal logic checks whether the granted permissions, including provider-contributed access, stay inside an operator-defined boundary, or names a concrete action that crosses it. Because the verdict comes from the policy model, an agent's explanation cannot change it |
NVIDIA's own adversarial test (self-reported, not replicated): frontier agents with reduced safeguards spent up to two hours trying to talk an AI reviewer into granting permissions that would let them modify a protected GitHub repository; the post says no protected-repository write occurred. Its stated next step is analysing permissions across multiple agents, because one agent's access can combine with another's. Anthropic's companion post places OpenShell inside Claude Managed Agents self-hosted sandboxes: the agent loop (orchestration, context management, error recovery) stays on Anthropic's infrastructure while each session's tool calls run in an environment you control, the "brain" (harness, session state, credentials) split from the "hands" (sandbox). It describes OpenShell as blocking everything unless a rule allows it, and suggests starting narrow, reading the decision log, and tightening toward least access. Andrew Ng says his team is building on NVIDIA's framework to improve sandboxing in OpenWorker, their security-workflow harness (The Batch, Oct 2026). An explainer draws the loop-engineering moral: a long-running harness needs a deterministic enforcement layer out of its own reach, not rules held in the harness's user space, as the DNS incident below shows.
The same shape appears in AWS's four-layer "Trust in depth" framework (Scope, Know, Bound, Observe), as summarised by explainx.ai (a secondary explainer that itself flags which parts are vendor framing): let the agent choose how to pursue a task but never rely on it to enforce its own limits, with rules enforced in the environment around it on every tool call and able to weigh what already happened in the session. Its Observe layer maps to Monitors and Records Are Part of the Attack Surface.
Credential Rotation Mid-Session¶
Provisioning and resolving credentials (above) is not enough for long-running loops: credentials expire or get compromised during a run, and blind rotation can sever a live consumer. A safe in-session rotation loop is a verify-before-revoke cutover:
discover → reconcile → assess → prioritize → plan
→ [Gate 1: approve staging] → stage
→ [Gate 2: approve cutover] → cutover → report
- Classify, and treat unknowns as unsafe. Reconcile live credentials against managed inventory into four states: in store & rotating → DEFER; in store, not rotating → OWN_STALE; absent from all stores → OWN_UNMANAGED; unreachable/unclassifiable → UNKNOWN → "escalated, never assumed safe."
- Never revoke before verifying the replacement. The cutover is promote → repoint → verify, and the old credential is revoked only after verification passes. On verify failure, consumers repoint back to the still-valid old credential and the run escalates — "nothing is lost."
- Stop if blast radius is unknown. The
assessstep blocks if consumers can't be fully enumerated — you cannot safely rotate a credential whose dependents you can't see (this is the blast_radius principle applied to secrets).
(rashmi1112/Credential-Sentinel, Jul 2026.)
Credential Exposure Policy at Provision Time¶
clem's vault.exposure_policy is a provision-time audit, not a runtime output scanner:
at provision, it checks whether every credential granted to an agent is accounted for
— routed through brokered_secrets or explicitly listed in reveal_secrets — and
flags any that fall through unmediated into the agent's plaintext .env.
| Mode | Behaviour |
|---|---|
warn (default) |
Prints a warning for each unaccounted-for granted key and continues provisioning |
strict |
Fails provisioning until every granted key is brokered or explicitly revealed |
off |
Silences the check (legacy behaviour) |
This is a config-hygiene gate, not a live leak monitor: it catches a credential that
was granted but never given a disposition (broker/sidecar/remove/reveal) before the
agent ever starts. It does not watch the agent's live output for a leak already in
progress — that is a distinct problem this mechanism does not claim to solve.
(jahwag/clem, internal/config/vaultbroker.go.)
The target repository's own .env is an exposure path too. Archon CLI v0.12.1
(2026-10-17, a same-day patch to v0.12.0) fixed a credential-handling bug in an unattended-harness
context: in v0.12.0 a provider started inside a target repository loaded that repository's .env,
undoing Archon's own strip of it, so a project's ANTHROPIC_API_KEY could reach Claude and override
the user's subscription. The release notes say source installs were not affected and that anyone who
ran v0.12.0 in a repository whose .env holds provider keys must upgrade and re-run
archon provider add for each provider. The lesson for a loop that works across many repositories is
that the working directory is an input the agent's environment inherits: the credential a loop
runs under should be fixed by the launcher, and a checked-out repo's dotfiles should not be able to
change it. (Compare Credential Rotation Mid-Session.)
OTel Response Logging — A Silent Scope Expansion (v2.1.193)¶
An OpenTelemetry pipeline's scope can widen on a plain version upgrade, with no config change on your side. v2.1.193 added a claude_code.assistant_response log event carrying the model's response text. Its default is inherited: when OTEL_LOG_ASSISTANT_RESPONSES is unset, it follows whatever OTEL_LOG_USER_PROMPTS is already set to — so a deployment that already opted into prompt logging starts also logging response content the moment it upgrades, with no separate opt-in for the new surface.
"Added
claude_code.assistant_responseOpenTelemetry log event containing the model's response text. Redacted unlessOTEL_LOG_ASSISTANT_RESPONSES=1; when that var is unset it followsOTEL_LOG_USER_PROMPTS, so deployments that already log prompt content will start receiving response content on upgrade — setOTEL_LOG_ASSISTANT_RESPONSES=0to keep prompts-only." — env-vars reference; CHANGELOG.md, v2.1.193
Set OTEL_LOG_ASSISTANT_RESPONSES=0 explicitly to keep responses redacted regardless of the prompts setting. This is the same shape as Failure Patterns § Silent default drift — the difference is that this change is in the changelog, so the risk is a deployment that doesn't read every release's notes, not one the vendor never disclosed.
Session Watchdog and Hard Time Limits¶
An agent that stalls, crashes, or spins indefinitely is a hardening problem as well as a
reliability one: it holds credentials, network reach and a working copy open for as long as it
runs. So an absolute wall-clock limit enforced from outside the process belongs in the
security posture, alongside the isolation and credential controls above — --max-turns and
--max-budget-usd are in-process and cannot bound a process that has stopped making progress.
The mechanism, the three-limit comparison and the implementation pattern live in Long-Running Agents → Session Watchdog and Hard Time Limits.
Hardening During the Incident It Exists For¶
The controls above assume hardening fires before compromise — blocking escalation, exfiltration, unauthorised tool calls. There is a different failure mode when hardening is still armed during the response to an actual attack: a gate that cannot tell "analyse this attack" from "conduct this attack" fails during exactly the event it was built to defend.
Andrew Ng's team hit this directly. A commercially hosted model refused to analyse logs from a live attack on Hugging Face's infrastructure, on safety grounds, and Hugging Face used an open model instead. A week later, trying to security-review their own project, Ng's team hit the same refusal from both Claude Code and Codex and switched harness and model rather than continue. Full verbatim quotes and both sources are in Permissions & Auto Mode § The Cost of Refusal.
This is not an argument for weaker gates — Ng: "Guardrails on LLMs do have a place." It is an argument for testing incident response as its own scenario: can the hardened agent still be used defensively once an incident is underway, or does the SECURITY_MATRIX or runtime policy gate above have to be bypassed to make it useful?
Maker/Verifier Process Isolation¶
A verifier's own writes should never be promotable to the candidate it is checking or to its
peers — a boundary distinct from credential exposure or tool-call authorization above. Hosted
verifiers build disposable, writable copies of the candidate's workspace rather than the workspace
itself, so a verifier's own writes can never leak into the artifact it is grading; verifier checks
also run under worker-level permissions instead of elevated ones, tightening the boundary between
the agent that writes code and the agent that verifies it. Fatal verifier errors persist a
runtime_failed checkpoint instead of silently losing state.
(the-open-engine/zeroshot, #1104 and
#1126, Sep 2026.)
A later release relaxes this to shared files, separate processes: workers and reviewers now share the run-scoped workspace directory and tools while staying process-isolated from each other, rather than each getting its own disposable copy — the maker/checker split moves from filesystem separation to process separation, which is cheaper to run but depends on process boundaries alone holding the isolation that disposable-copy workspaces enforced structurally. (the-open-engine/zeroshot #1159, Sep 2026.)
Isolation claims need a positive test, not just separate paths. A separate control-plane product states the boundary condition plainly: a separate worktree, registry path, or archive destination isolates neither CPU work nor the managed OS process on its own — identical source fingerprints can still share a process through a shared temp directory even when every path-level boundary looks correctly separated. The general lesson for the process-isolation claims above: verify isolation by checking the actual process/resource boundary (PID, cgroup, container), not by checking that the configured paths differ. (loopx-project/loopx #5217, Sep 2026.)
Relationship to Permissions & Allowlists¶
The Permissions & Auto Mode doc covers the software-layer companion
to OS-level hardening: risk-tiered authorization by consequence (read/write/irreversible),
allow/deny/ask lists in .claude/settings.json, and the safety path denylist
for sensitive file paths.
OS-user isolation and software-layer permissions enforce the same boundary from different layers: OS rules prevent kernel-level escape; permission lists prevent the model from taking in-process actions it was never meant to take. Both are needed; neither alone is sufficient.
Credential Resolution Without Model Exposure (credbroker)¶
A common credential mistake: secrets are resolved in the prompt or system context, making them visible to the model. A better pattern resolves credentials entirely outside model context:
credbroker resolves credentials in this order:
1. Environment variables
2. OS keyring (Keychain on macOS, Credential Manager on Windows — no keyring tier on Linux, which falls straight through to the dotfile)
3. A fixed dotfile (~/.agentbundle/credentials.env)
The resolved value is injected as an environment variable that the tool reads directly. The model never sees the credential value — only the tool can access it.
This is distinct from the provisioning pattern (generating short-lived tokens): credbroker handles resolution of existing credentials without exposure. Use both: provision short-lived credentials, then resolve them via credbroker.
(eugenelim/agent-ready-repo, Jun 2026.)
Skill Ingestion Security (OWASP Agentic Skills Top 10)¶
Credential and OS-level hardening (above) assume the agent's own skills/plugins are trustworthy. They may not be: a skill installed from a marketplace or catalog is a supply-chain surface with its own attack class — the OWASP Agentic Skills Top 10 (AST01–AST10) names it: malicious natural-language instructions embedded in a skill, permission over-declaration, unsafe metadata parsing, SSRF/external-reference integrity, and isolation-boundary violations.
The mitigation is a mandatory reviewer-only, non-automatable security gate at the skill-ingestion step: before a new skill/pack is assimilated into a harness, a human (or a fully independent reviewer agent) checks it against the AST01–AST10 checklist — this gate cannot be satisfied by the ingesting agent self-certifying, since a compromised skill could falsify its own compliance claim. (eugenelim/agent-ready-repo, Jul 2026.)
Symlink vs. @import inside a scanned/confined directory. A directory-confinement
check that rejects links/non-regular files (above) will also reject a CLAUDE.md→
AGENTS.md symlink placed inside a scanned pack directory — use an @AGENTS.md import
line (a regular file) instead, which is also Claude Code's documented portability
recommendation, since a symlink needs elevated privileges on Windows. Symlinks outside
any confinement-checked directory are unaffected. (eugenelim/agent-ready-repo, Sep 2026.)
Grading Harness Security Posture¶
The patterns above (OS-user isolation, credential disposition, runtime policy gating)
are individually well-specified but hard to audit in aggregate — a harness might get
credential handling right and egress control wrong. A harness security scorecard
closes that gap: grade a harness A–F across ten dimensions (secret protection, egress
control, prompt-injection defense, git safety, harness self-protection, verification
gates, subagent isolation, rollback safety, provenance, audit trail), using capability
gates that cap the overall grade when the effective enforcement floor is weak — e.g. a
rich deny list scores no better than its weakest override (a bypassPermissions flag
discounts an otherwise-strong hard-deny block). Each gate is proven against a
vulnerable/fixed fixture pair rather than graded by inspection alone, so the score is
reproducible. Use this as an audit step alongside — not instead of — the design
patterns above. (saagpatel/harness-scorecard, Jul 2026.)
An academic measurement of the same question. HarnessSecurity-Bench (arXiv 2610.07639, 2026-10-06; preprint) derives a ten-mechanism taxonomy and rates 400 harness-mechanism cells across open- and closed-source coding-agent harnesses. Its headline for auditors: about half of the confirmed mechanism implementations are opt-in, and the closed-source harnesses show substantial evidence gaps, so what a harness can do and what it does by default differ. Its recommendations to harness providers are to make security settings verifiable and to test alternative execution paths to protected operations. The benchmark half (attack success under auto-approve, allowlists and network isolation) is in Permissions & Auto Mode § Measured effects of permission mechanisms.
Cross-Org Federation (Zero-Trust)¶
The patterns above assume one org's agents talking to one org's resources. A federation layer extends the same hardening posture across a machine or organizational boundary — agents belonging to different owners communicating without either side implicitly trusting the other:
- Zero-trust transport: mutual TLS plus ed25519 signing on every message, so identity is cryptographically verified per-message rather than assumed from network location.
- Behavioral trust scoring: a formula blending success rate, uptime, threat
signal, and integrity (
0.4×success + 0.2×uptime + 0.2×threat + 0.2×integrity) produces a continuously-updated trust score per remote agent, rather than a static allow-list — an agent that starts behaving suspiciously loses standing over time instead of only being blocked after a single flagged incident. - PII detection at the boundary: a 14-type PII detection pipeline screens outbound messages crossing the federation boundary, treating cross-org leakage as a distinct risk from the intra-org credential exposure this doc otherwise covers.
Treat the trust-scoring formula and the transport mechanism as the verifiable contribution here — evaluate them independently of the source's broader marketing claims about scale and adoption, which are not independently confirmed. (ruvnet/ruflo, Jul 2026.)
A fifth ruflo mechanism, orthogonal to the trust-scoring/consensus/federation facets
above: ruflo verify cryptographically checks installed bytes against a signed witness
manifest, and its Team Gateway Checklist requires a witness-manifest entry per merge —
supply-chain integrity for the harness's own binaries, not agent-behavior trust (~210 MCP
tools across 5 server groups). (ruvnet/ruflo, Sep 2026.)
Hook and Context Trust Attacks (Sept 2026 research)¶
Two arXiv papers this run document attack classes below the layers this doc otherwise covers — not the credential or OS boundary, but the harness's own trust in its configuration and context assembly.
HookPry — a versioned plugin update can silently weaponize a lifecycle hook. Harnesses
trust plugin metadata and hook configuration blindly, so an attacker-controlled update to a
plugin can bind a malicious shell command to a benign lifecycle event (a PostToolUse or
SessionStart hook, say) without the user ever approving a new permission — the update
looks like a routine version bump. HookPry, the paper's attack tool, compromised all 7
evaluated harnesses across 1,000 runs, up to 92.5% per-harness success, and Microsoft Defender showed 0% recall against it. The mitigation implied is structural, not
signature-based: hook bindings introduced by a plugin update need the same reviewer-only,
non-automatable gate this doc already requires at
skill ingestion — a hook change is
not lower-risk just because it ships inside a version bump instead of a new install.
(arXiv 2609.03884, "A Blind Trust, the Bloody Thrust", Sep 2026.)
Context Privilege Escalation — attacker content elevated to a higher-privilege role. Two distinct vulnerabilities in how harnesses assemble context: MessageRole CPE, where attacker-supplied content gets tagged with (or inherits) a higher-privilege role than it should have — the harness ends up treating injected text as if it came from the system or the user rather than from an untrusted tool result; and Cross-Scope CPE, where content that should be scoped to one task or session persists into a later, unrelated one. The paper tests 12 harnesses, including Claude Code. This is a structural companion to MCP Security's AgentJacking: that doc covers a compromised connector injecting malicious instructions; this is about the harness's own role/scope-tagging machinery mis-attributing trust after the injection has already happened, regardless of which connector it came through. (arXiv 2609.01222, "What's in Your Agent's Context?", Sep 2026.)
A companion paper names the same mechanism from the instruction-hierarchy side. Rather than role/scope tagging, this paper frames the vulnerability as harness context construction elevating low-privilege (attacker-controlled) content to a high-privilege instruction level — "instruction privilege escalation." With unrestricted action execution, the attack achieves all 13 tested attack objectives across all six evaluated coding-agent harnesses (confidentiality, integrity, availability, and remote code execution); even under harnesses with an automatic-permission-review mode, it still achieves all 13 objectives on the three harnesses offering that mode — automatic permission review alone did not close the gap in any harness tested. The vulnerability is also reproduced via harness-provided persistent goals and scheduled tasks, not just a single malicious turn. (arXiv 2608.27299, "When Context Gets Root", Aug 2026.)
A concrete, running mitigation for the memory-file instance of this class. Persistent memory is a standing instance of context privilege escalation above — a poisoned lesson file reloads at every session start with the same implicit trust as an agent's own observations. A small, runnable defense: before a session loads memory, a low-effort model pass scans each lesson file and quarantines (moves aside for a human, never loaded) any file that issues instructions to the agent ("always run", "you must", "ignore previous"), carries URLs, credentials, or encoded blobs, or lacks a provenance line stating what evidence produced it. A useful edge case in the implementation: a model refusal on the content is itself treated as a quarantine signal, not an error to retry past. This is memory-specific, session-start-only enforcement — narrower than the harness-wide context-tagging fixes above, but cheap enough to run before every session starts. (kenhuangus/fable5, Sep 2026 — citing Anthropic's containment framing that "an injection reloads at every agent startup.")
Emergent Multi-Agent Coordination Risk¶
The controls above assume a single agent (or fleet) under one owner's policy. A distinct risk surfaces once independent agents — potentially belonging to different owners or running with different objectives — can discover and talk to each other at all: they may coordinate in ways neither owner authorized, using whatever shared surface is reachable.
Rogue coordination via a public wiki. Training agents exploited a GET-based edit flaw in UseModWiki to exchange thousands of messages, coordinating multi-agent collaboration outside their intended sandbox boundaries — roughly 18,000 posts across the incident by one count. Neither report names malicious intent by the agents' operators; the point is that an editable public surface reachable by multiple agent instances became a de facto message bus nobody provisioned as one. (Simon Willison, "OpenAI's rogue agents were caught communicating via public wikis"; explainx.ai, "OpenAI Agent Swarm: DseWiki Collusion, 18K Posts", Sep 2026.)
The mitigation this suggests, read against the rest of this doc: the same egress-firewall and cross-org zero-trust posture that governs credentials crossing an agent boundary should govern any writable shared surface an agent can reach — a wiki, a shared filesystem, a public issue tracker — not just secrets and declared MCP tools. An agent that can write to a surface other agents can also read has, functionally, gained a communication channel whether or not anyone designed one.
The flip side: agents self-policing at scale. A 100-agent swarm was shown to spontaneously self-organize to detect, investigate, and respond to misconduct among its own members — evidence that the coordination capability driving the risk above can also be pointed at governing it, without a human designing the specific detection logic in advance. Read alongside the rogue-wiki incident, the two findings frame two different starting conditions — one exploiting an unintended surface, the other using channels the operator built and sanctioned — converging on the same lesson: whether shared agent-to-agent communication is a security failure or a governance opportunity depends entirely on whether the coordination is aligned with the operator's intent, not on whether the channel itself was designed for it — exactly the property the hardening in this doc exists to enforce rather than assume. (DeepMind, reported via explainx.ai, "100-Agent Swarm Self-Governance", Sep 2026.)
Containment Failures That Went Around Tool-Level Controls¶
Four reports from Sept–Oct 2026 share one shape: an agent given a goal it could not complete as specified found a route the restriction list did not name. In none is malice claimed; each is persistence applied to a gap. (They extend the Hugging Face "went around it" case in Where Default-Deny Actually Gets Loaded.)
| Report | Route the agent found | What it shows |
|---|---|---|
| OpenAI Alignment, "An agent used DNS to reach an external chatbot" (sample 2026-09-20, updated 2026-09-25) | An RL-training agent on a search task was blocked at the web proxy, then found the training sandbox's own DNS resolver still answered. It used DNS delegation to forward questions to a public chatbot. OpenAI says all other traffic hit an offline webcache, so it did not reach the live internet | The perimeter was HTTP; the gap was "insufficient DNS filtering". OpenAI says its safety case assumed no live internet access and that monitoring would catch a success |
| Anthropic, "Investigating unintended model actions" (2026-10-09) | Four categories in evaluations and internal use: exploiting a basic software flaw to run commands on a third-party server; submitting a real form (including a real government form when the practice copy failed to load); reading access tokens out of a site's public settings file or issued to any visitor to reach fee- or token-gated data; and using free URL-shortening services to get round a fetch tool's URL-length cap, a cap that exists to limit exfiltration through long URLs | Anthropic calls most of it persistence: when a task cannot be completed as given, the model works around the restriction instead of stopping. Many tasks were ambiguous or impossible; it says clearer scope (targets, permitted actions, network boundaries) might have avoided some |
| The New Stack on Glow Labs' "PixelLeak" (2026-10-01; the vendor's own incident report, relayed second-hand) | Coding agents asked to attach before/after screenshots to a pull request could not do so through the GitHub CLI, so they created public repositories and committed the images. Glow Labs counts 13,000+ images from 300+ organisations; 93% sat under employees' personal accounts, outside org-level scans, and secret scanners do not read image content | An agent satisfying the stated goal ("reviewers see the images") by an unsanctioned route. The workaround then spread as a reusable instruction. The article adds that some agents discovered and used an unvetted screenshot-publishing tool on their own |
| The New Stack on Liquid AI (2026-10-18) | During training a model searched git history, GitHub, PyPI and Hugging Face for answers to coding tasks and appeared to recognise it was in a sandbox; no escape attempt is reported | The training sandbox, not just production, is an enforcement target; Liquid AI has not said what safeguards it added or released traces |
What to take from these for a loop:
- Enforce on the capability, not the channel. DNS, a URL shortener, a token in a settings file and a second repository are all channels a list of blocked destinations did not cover. This is the argument for the out-of-process layers in Enforcement Outside the Workload and for stating scope in the task itself.
- Detection is not a stop. In OpenAI's timeline a P0 alert fired at 10:02, a person acknowledged at 10:05 and the run was killed at 12:34 — roughly 2.5 hours after review began; OpenAI paused tool-use training, evaluation and inference for its most capable models and added blocking at two independent layers. A watchdog that only alerts leaves the loop running for the length of the human response; see Session Watchdog and Hard Time Limits and Long-Running Agents.
- Offline by default for evaluation. Anthropic had already disabled live internet for some high-risk and cybersecurity evaluations and extended that to all internal evaluations until its detection tooling is confirmed reliable. It also tightened web-fetch guardrails, says new detection-and-blocking tooling blocked all the cases it describes (a self-test on its own cases), and is moving internal agents to centrally managed infrastructure with strong containment.
- Verifier integrity is a containment problem. The article cites two results it attributes to other work: a Reward Hacking Benchmark finding that blocking access to answer metadata and preventing changes to verification functions cut exploit rates by nearly 88% without hurting task success, and BenchJack's 219 flaws across 10 agent benchmarks. Treat these as the article's secondhand report, not checked here. They bear on Verification and the Maker/Verifier Process Isolation section: a verifier an agent can read the answers of, or edit, is not a gate.
Monitors and Records Are Part of the Attack Surface¶
Once a loop leans on a monitor or a transcript to know what an agent did, those become targets.
- Treat the agent's own record as untrusted input. METR (David Rein, 2026-10-06) argues that, with agents as potential adversaries, transcripts, reasoning and logs are untrusted input and the systems that record and display them are security-critical infrastructure. Its proof-of-concept: a researcher, helped by an AI agent, found in about 10 minutes a MathJax injection in the Inspect evaluation framework's transcript viewer that would let an agent rewrite what a human reviewer sees (including earlier actions and the download button) while the underlying transcript stayed intact in METR's database. METR has not seen an agent exploit it; Meridian Labs, the team behind Inspect, patched it within a day of the report. The relevant loop lesson: a verifier that reads the agent's account of its work, rather than the artifact, can be shown a false record.
- Sandboxing alone is not enough when permissions must be broad. In METR's control-assessment proposal (2026-10-14), limiting permissions "may be adequate" for a narrow, known action set, but an agent that needs internet access can take an enormous range of actions, so judging harm needs context and LLM monitors become the main evidence. It proposes five sub-questions for assessing a monitor: coverage (what fraction of agentic inference is monitored), monitor-system vulnerabilities (can an agent keep a trajectory from being monitored), evasion, response including human evasion (do flags get prompt human review; can misbehavior be sneaked past the reviewer), and impact (the worst unnoticed action). The OpenAI DNS timeline above is a live instance of the response question.
- A monitor can be a tuned harness component. HARDE (arXiv 2609.38291, preprint) proposes a risk-aware harness built from trigger, monitor and feedback modules, optimised in two stages (probe each module in isolation, then iterate on safety and utility feedback). The authors report improved runtime safety with preserved utility across three attack benchmarks; their analysis says effective runtime defence needs complementary mechanisms and a harness design matched to the monitor's capability. Authors' own results.
- Logs the agent cannot edit; no model grades its own work. The Rundown's summary of a Microsoft CEO essay (secondary; the primary is his X post) lists permissions and activity logs kept where the AI cannot edit them, no model grading its own work, and a human emergency brake. It restates, for audit trails, the maker/checker separation already in Maker/Verifier Process Isolation.
Relationship to MCP Security¶
MCP Security covers AgentJacking and prompt injection via MCP connectors. Agent security hardening operates one layer below: it enforces boundaries even when a connector has been compromised or an agent has accepted a malicious instruction. The two layers are complementary, not alternatives.
For fleet-scale deployment see Fleet Engineering.