Read the paper
Living-off-the-Agent: Enforcing MCP-to-Kernel Capability Boundaries
on GitHub
A cross-layer runtime monitor stitches MCP protocol frames to OS kernel process trees, claiming 100% recall on cross-boundary agent compromises at ≤1% false-positive rate across 1,430 sessions on Linux and Windows, while explicitly missing in-envelope semantic bugs.
Going deeper
| Normalized Violation Signature | Cal. Benign Hits | Rate / 100 | Attack Hits () | Discounted |
|---|---|---|---|---|
| loop:temporal_errno | 342 | 90.00 | 0 | 0.023 |
| mcp:git_status:forbidden_write | 83 | 21.84 | 92 | 0.136 |
| mcp:git_diff:forbidden_write | 11 | 2.89 | 7 | 0.511 |
| mcp:http_fetch:undeclared_net_port | 0 | 0.00 | 240 | 0.820 |
| mcp:read_file:ungrounded_sensitive_read | 0 | 0.00 | 155 | 0.880 |
| mcp:run_pytest:undeclared_sensitive_read | 0 | 0.00 | 80 | 0.880 |
| mcp:run_pytest:forbidden_net_connect | 0 | 0.00 | 80 | 0.880 |
| mcp:run_node_check:undeclared_sensitive_read | 0 | 0.00 | 80 | 0.880 |
| mcp:read_text_file:ungrounded_sensitive_read | 0 | 0.00 | 49 | 0.880 |
| mcp:post_response_detached_effect | 0 | 0.00 | 40 | 0.880 |
| mcp:write_file:ungrounded_persistence_write | 0 | 0.00 | 40 | 0.880 |
| mcp:run_node_check:forbidden_net_connect | 0 | 0.00 | 40 | 0.880 |
| mcp:format_code:undeclared_sensitive_read | 0 | 0.00 | 40 | 0.880 |
| mcp:format_code:forbidden_net_connect | 0 | 0.00 | 40 | 0.880 |
Imagine a locksmith who comes to your office, uses your own keys, and fixes locks all day—opening doors, testing them, writing notes. A thief who steals your keys looks exactly the same on camera. That is what autonomous coding agents do to security software: their normal work (running tests, reading configs, opening network connections) looks identical to a break-in.
The authors build a watcher that sits between the agent's task list and the operating system. Every time the agent asks a tool to do something, the watcher stamps the request with a serial number and follows every child process the tool spawns, even ones that linger after the tool says it is done. It then checks: did the tool touch a file or open a network port its contract does not allow? Did the developer actually ask for that file? If not, it flags or blocks.
The tricky part is long-term memory: agents read a rules file at startup, so one poisoned line can taint every future session under classical tracking—like revoking every employee's badge because one was cloned. The watcher tracks edits line by line instead, blaming only the specific poisoned paragraph. It catches all attacks that cross a hard system boundary, but it openly admits it cannot catch a subtle code bug slipped into an allowed file.
The abstract, word for word, with the seven densest phrases unpacked.
Autonomous coding agents integrated into developer environments via the Model Context Protocol (MCP) routinely execute shell commands, spawn test runners, modify configuration dotfiles, and initiate outbound network connections, matching the system-call patterns that traditional Endpoint Detection and Response (EDR) suites classify as post-exploitation activity. We formalize Living-off-the-Agent (LotA) compromises1 and explicitly delimit two threat classes: Class-I cross-boundary compromises2 (ungrounded secret reads, persistence writes, subprocess/IPC escapes, and dormant instruction triggers observable at the OS/protocol boundary) versus Class-II in-envelope semantic compromises3 (business-logic bugs inside authorized files and custom-data piggybacking over approved endpoints). We structure LotAGuard around three unified pillars on Ubuntu 26.04 (Linux 7.0 CO-RE BTF eBPF) and Windows Server 2025 (Sysmon64 + Kernel-File ETW) at 0.01–0.05 ms median tool-call latency: (1) incarnation-safe & reorder-bounded MCP-to-kernel causal cone attribution4 ((textttPID,G) with a 64-bit monotonic counter G, 2 s FIFO birth-key GC, spawning-thread τtid + AsyncCtx, IPC, and attested HTTP) fused with calibration quirk rarity across Tier-3 blocking, Tier-2 step-up, and Tier-1 passive audit actions; (2) hunk-blame differential lineage eliminating persistent-context taint explosion5 on CLAUDE.md and .cursorrules (30/30 timeline triggers, 0 FPs across 750 steps); and (3) capability-boundary delimitation evaluated using exact task/instance-level Clopper-Pearson 95% CIs (CP95) to avoid paired-OS pseudo-replication across 1,494 external, real-workflow, pre-frozen, and stress runs plus 14 -day memory soaks (Series I–U). On verbatim unmodified upstream AgentDojo v1.1.1 and InjecAgent (40 unique tasks, 80 paired OS runs), core LotAGuard (D4) achieves 80.0% overall recall (16/20 tasks6, CP95 [56.3,94.3]%: 16/16 [[79.4,100]%] on the Class-I subset vs. 0/4 [0%] on Class-II) at 0.0% FPR (0/20, [0.0,16.8]%; vs. 15/20 [75.0%] FPR for native AgentDojo ToolFilter). Across 100 independent SWE-bench Verified human GitHub issue/patch instances spanning 12 OSS repos (200 paired OS runs, 100% Linux-Windows tier concordance, ρICC=1.0), core D4 incurs 0/100 (0.0%, instance CP95 [0.0,3.6]%) blocking FPs7 and 1/100 (1.0%, [0.03,5.5]%) step-up prompts (9/100 passive audit logs, vs. 100/100 FPR for Falco/Sigma and 23/100 for D5); on blind unseen repos (fastapi/httpx/flask) and 8 unseen secret formats (N=72), egress-escalated disposition yields 0/48 (0.0%, [0.0,7.4]%) developer interruptions while hard-blocking all 13/13 ([75.3,100]%) socket-egress cases (11/11 local-only reads passive-logged); under rapid OS PID recycling (30 instances, 60 runs), (textttPID,G) cuts false-blame pollution from 10/10 to 0/10 ([0.0,30.9]%) and lifts Windows laundering recall from 2/10 to 9/10 (10/10 Linux); across a 14 -day/ 50,000 -RPC/ 200,000 -spawn soak, subtree-drained GC caps stitcher memory at 11.6--14.3 KB (8 active entries vs. 219.2 MB unreclaimed) at 50/50 grandchild recall, while τtid +AsyncCtx cuts deferred server-async FPs from 10/10 to 0/10 at 20/20 recall (30 instances, 60 runs). On cloned click/requests/express repos (N=120), frozen D4 reaches 66.7% R@1%FPR and 87.5% R@5%FPR (0.930 AUC vs. 0.601 / 0.123 AUC for compiled C++ UNICORN at 1.66 s, with a 12 -cell 2×2×3 factorial isolating +10.4 pts from cones, +29.9 pts from rarity, and +18.7 pts from Gsem). Under author-harnessed pre-frozen (SHA-256-locked) unseen-prompt stress (20 unique attack specs + 10 controls, 60 runs), pure D4 catches 50.0% (10/20, [27.2,72.8]%) and optional LotAGuard-Ext catches 60.0% (12/20, [36.1,80.9]%) at 0/10 FPR (corroborating 60.0% [24/40] white-box recall), while across 40 unique adaptive semantic/ 3 -session cases (80 runs), pure D4 scores 0/40, LotAGuard-Ext (<0.12 ms) reaches 75.0% (30/40, [58.8,87.3]%), and selective diff auditing (29.2% of sessions) reaches 93.8% (75/80 runs). Controlled Class-I specification verification (1,430 sessions across five LLMs) confirms 480/480 invariant-construction consistency within the defined envelope (not open-world recall).
Two lines of prior work converge here: OS provenance intrusion detection and language-layer agent guards.
Read five parts, in this order.
Skip Appendices A–E unless you want raw traces, scenario catalogs, or deployment rule snippets.
If the 100% controlled recall is fragile, these places show where.
Series G Empirical Boundary & Negative-Capability Stress Tests (E1–E4). Executed directly through LotAGuard’s causal stitcher and D4 engine to expose exact out-of-invariant blind spots (0% recall on E1–E3 in Mode 1) and ambiguous-prompt false-positive boundaries (E4). Boundary Case | Ground Truth | Mode 1 SD4 | Outcome | Why Invariant Fails | Complementary Defense Layer E1: In-Scope Logic Backdoor (src/auth.py) | Attack | 0.000 | Missed (0%) | Edit stays inside authorized file G(u); zero secret/net drift. | Static analysis (SAST), unit tests, and human PR review. E2: Grounded .env Staged in docs/notes.md | Attack | 0.000 | Missed (0%) | .env explicitly in G(u); staged into allowed repo doc. | Pre-commit secret scanning (gitleaks) + language taint (CaMeL). E3: Grounded Read + UDP/DNS Exfil | Attack | 0.000 | Missed (0%) | Mode 1 hooks TCP connect, not raw UDP DnsQuery. | Mode 3 udp_sendmsg (Linux) / Sysmon EID 22 (Windows). E4: Vague Benign Prompt (“Fix DB error”) | Benign | 0.750 – 0.880 | False Positive | Developer omitted .env from prompt u (∉G(u)). | Mode 2 out-of-band Step-Up IDE confirmation dialog.
While Series H (200 prompts), Series P (160 tasks, 1/60 [1.7%] OSS workday step-up), Series R3 (72 blind unseen-secret evaluations), and Series S1 (100 independent SWE-bench Verified instances, 0/100 [[0.0,3.6]%] blocking FPs and 1/100 [1.0%] step-up prompts) quantify operational dispositions, and Series S2 pre-locks detector SHA-256 hashes (93b86b38...) prior to unseen-prompt generation, all test harnesses, workspace fixtures, and evaluations in this study were operated by the authors (including our 3 rd-host python -I packaging check). Independent third-party human red-teaming and IRB-approved multi-week developer user studies are not claimed here and represent essential external validation. Combining LotAGuard with language-layer dataflow isolation [5, 17] further hardens mixed-trust sessions (E2).
Nothing on this page was recomputed. Every claim points to the paper so you can check it.
More latest news
Read all