Autonomous coding agents connected via the Model Context Protocol (MCP) routinely spawn shells, run test suites, edit configuration files, and open network sockets, making normal software engineering look like post-exploitation activity to Endpoint Detection and Response (EDR) tools. We formalize Living-off-the-Agent (LotA) compromises and establish a clear boundary between Class-I cross-boundary attacks (ungrounded secret reads, persistence writes, asynchronous child or IPC escapes, and dormant rule triggers observable at the OS and protocol layers) and Class-II in-envelope semantic attacks (logic bugs in authorized files and data piggybacking over approved endpoints). We present LotAGuard, a sub-millisecond cross-layer runtime monitor for Linux eBPF and Windows Sysmon/ETW built around three mechanisms: (1) incarnation-safe, memory-bounded causal attribution linking MCP tool calls to OS process trees across post-response escapes, rapid PID recycling, deferred server tasks, and multi-week uptime, paired with rarity-weighted contracts and three-tier dispositions; (2) hunk-blame differential lineage tracking persistent rule files (CLAUDE.md, .cursorrules) without taint explosion; and (3) task-level evaluation avoiding paired-OS pseudo-replication. Across verbatim AgentDojo and InjecAgent benchmarks, LotAGuard detects all Class-I attacks (16/16) with zero false positives while leaving Class-II semantic edits (0/4) outside its OS envelope by design. Across 100 SWE-bench Verified engineering tasks, LotAGuard incurs zero blocking false positives and 1% step-up prompts, keeps resident state under 15 KB over a 14-day soak, and substantially outperforms signature EDR, whole-graph provenance, and argument-only guards on real open-source repositories, while delineating where cross-session flow gates and code-diff review are required for adaptive semantic evasions.
翻译:暂无翻译