From Attack Surface to Defense Architecture: Compositional Security for Agentic Coding Harnesses

Simon Hegelich, Bardh Prenkaj, Habiba Sarhan, Morteza Shahrezaye, Kolja Hegelich, Christian Montag, Ralf Schneider, Erik CambriaarXiv 2026

TL;DR

ActiveSecHarness is a neurosymbolic security architecture that protects AI coding agents by strictly separating "Intelligence" (the LLM) from "Authority" (the security kernel). By replacing slow, unreliable LLM-based "judges" with deterministic OS-level guards and a 2D information-flow lattice, it achieves a 100% attack block rate with zero false positives—all while running 11,200x faster than traditional model-based defenses.

What Problem Does This Paper Address?

AI coding agents (like SWE-agent or OpenHands) are incredibly useful because they can execute code, navigate filesystems, and use network tools. However, this "agentic" power creates a massive attack surface. If an adversary injects a malicious prompt into a GitHub issue or a README file, the agent can be tricked into becoming an automated Living-off-the-Land (LotL) platform. Essentially, the agent’s own tools (like bash, curl, or find) become the weapons used to exfiltrate secrets or establish persistence.

The authors argue that current defenses are fundamentally flawed. Static regex blacklists are too brittle to catch clever obfuscation, while using a second LLM as a "security judge" is both painfully slow and prone to "over-blocking"—refusing legitimate work because it looks vaguely suspicious. Most importantly, existing systems struggle with multi-step trajectories, where several individually "benign" actions (read a file, write to a temp file, send a network request) compose into a lethal attack.

Methods

The core philosophy of ActiveSecHarness is that security should be a structural property of the system architecture, not a behavioral property of the model. It introduces four interlocking pillars:

  1. Trust and Authority Rings: Inspired by hardware protection levels, the system uses four rings. Ring 0 is the immutable security kernel that mediates every tool call. Ring 1 is the human-sovereign layer, while Rings 2-3 host the agents.
  2. HMAC Capability Tokens: Authority is granted via Macaroon-inspired tokens. These tokens are cryptographically chained and can only be "attenuated" (restricted further) as they are delegated, never widened.
  3. 2D Product Taint Lattice: This is the "secret sauce" for tracking data. It separates Provenance (is this data from a trusted source or an untrusted GitHub issue?) from Sensitivity (does this data contain a secret?). This allows agents to perform "Derived" work (like running tests on untrusted code) while strictly blocking "Lethal Trifectas" (combining a sensitive read, shell execution, and network egress).
  4. Deterministic Ring-0 Interceptors: Instead of asking an LLM if an action "seems" safe, Ring 0 uses boring, reliable checks: canonical path resolution, resource quotas, and "IP pinning" to prevent DNS rebinding.
Table 1: Mapping classical attack primitives to primary harness requirements.

Datasets

The researchers evaluated their system using a new benchmark suite called lotlimmune_benchmark.json, consisting of N=252 fixtures:

  • 120 single-step attack cases: Covering GTFOBins escapes, SSRF, credential exposure, and more.
  • 120 benign SWE cases: Realistic "issue-read → edit → test" workflows.
  • 12 five-stage kill chains: Complex, multi-step attacks designed to test trajectory-aware defenses.

Key Insights and Ideas

  • Separation of Intelligence and Authority: The LLM is allowed to propose any action, but it is never allowed to define its own permissions. This makes the security of the system invariant to the "intelligence" or "alignment" of the model.
  • The Forensic Reconnaissance Paradox: Attackers often use an agent's own logs to map out a system. ActiveSecHarness solves this with split-horizon audit logs, where the agent sees only opaque ciphertext, but human responders can decrypt the full forensic trace.
  • Cognitive Immunity: The system includes a UserWikiManager that turns intercepted attacks into "teachable moments" for the human operator, building their ability to spot social engineering and "vibe coding" traps over time.
  • Trajectory Awareness: By folding multi-agent interactions into a monotone product state, the system can block an exfiltration attempt even if the "read" and the "send" were performed by two different agents sharing a workspace.

Key Results

The empirical results demonstrate a massive gap between neurosymbolic and purely probabilistic defenses:

  • Accuracy: ActiveSecHarness (Ring 0) achieved an Attack Block Rate (ABR) of 1.000 and a False Positive Rate (FPR) of 0.000. In contrast, a local LLM judge (qwen3:4b) blocked attacks but also refused 98.3% of benign work.
  • Latency: Ring 0 mediation takes just 12.7 μs (median). This is 11,200x faster than the LLM judge, which took 142.3 ms.
  • Trajectory Defense: In multi-step "kill chain" tests, an "Oracle" stateless policy (representing the current state-of-the-art like Conseca) missed 33.3% of attacks because it couldn't see the connection between steps. ActiveSecHarness blocked 100% of these chains.

Limitations and Future Work

While ActiveSecHarness secures the boundary of the agent, it does not solve the problem of task utility. If an agent is powered by a weak model, it might still fail to solve complex coding problems or propose "naive" code that the CodeVerifier has to reject.

The authors suggest that future work should focus on scaling the DualModelReviewer and SecurityTestSynthesizer—using high-capability models asynchronously to audit code and "heal" vulnerabilities before they ever reach the Ring 0 execution gate. Additionally, extending these formal guarantees to more complex, multi-modal agent environments remains an open research frontier.

Summary updated

Abstract

AI coding harnesses couple language models to shells, filesystems, and network sockets, turning the harness into an automated Living-off-the-Land (LotL) platform: once an adversary injects instructions into retrieved content, dual-use binaries such as bash, curl, and find become the payload. We argue that security in agentic systems is a structural property of the cognitive architecture and permission composition rather than an emergent property of individual models. Static regex blacklists miss structural evasions, whereas LLM-as-a-Judge guardrails incur high latency while over-blocking benign work. We present ActiveSecHarness, a neurosymbolic reference-monitor architecture built around Separation of Intelligence and Authority. It combines (1) Macaroon-inspired HMAC capability tokens across four Trust and Authority Rings, (2) a 2D product taint lattice $\mathcal{L} = \mathcal{L}_{\mathrm{trust}} \times \mathcal{L}_{\mathrm{sens}}$ and a workspace provenance ledger that prevents secret laundering across disk, (3) deterministic Ring-0 OS/tool guards, and (4) bytecode certificates, split-horizon audit logs, self-healing security test synthesis, and an adaptive UserWikiManager. Across $N=252$ fixtures ($120$ attack, $120$ benign, $12$ kill chains), a live local LLM judge (qwen3:4b) refuses $98.3\%$ of benign work at $142.3\,\mathrm{ms}$ latency, whereas Ring 0 achieves $\mathrm{ABR}=1.000$ and $\mathrm{FPR}=0.000$ in $12.7\,μ\mathrm{s}$ ($11{,}200\times$ faster). In a multi-step trajectory ablation, an oracle Conseca-style stateless policy misses $4/12$ kill chains ($\mathrm{ABR}=0.667$) and coarse Boolean taint blocks $83.3\%$ of benign workflows, while our 2D product lattice achieves $\mathrm{ABR}=1.000$ and $\mathrm{FPR}=0.000$ at $\approx 20\,μ\mathrm{s}$ per step.
BibTeX
@misc{hegelich2026from,
  author = {Simon Hegelich and Bardh Prenkaj and Habiba Sarhan and Morteza Shahrezaye and Kolja Hegelich and Christian Montag and Ralf Schneider and Erik Cambria},
  title = {{From Attack Surface to Defense Architecture: Compositional Security for Agentic Coding Harnesses}},
  year = {2026},
  eprint = {2611.13960},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.13960},
}
Figure