Security
~9 min readUpdated: December 2026

LotAGuard: Enforcing MCP-to-Kernel Capability Boundaries via eBPF

LotAGuard enforcing MCP-to-kernel eBPF capability boundaries on autonomous coding agents

LotAGuard (arXiv:2612.03557) is a sub-millisecond cross-layer security monitor for Linux eBPF and Windows Sysmon/ETW that bridges Model Context Protocol (MCP) tool calls and OS process trees. Formalizing Living-off-the-Agent (LotA) compromises, it detects 16/16 Class-I cross-boundary attacks on AgentDojo and InjecAgent with zero false positives while keeping resident state under 15 KB across 14-day soaks.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

LotAGuard: Enforcing MCP-to-Kernel Capability Boundaries via eBPF: LotAGuard (arXiv:2612.03557) is a sub-millisecond cross-layer security monitor for Linux eBPF and Windows Sysmon/ETW that bridges Model Context Protocol (MCP) tool calls and OS process trees. Formalizing Living-off-the-Agent (LotA) compromises, it detects 16/16 Class-I cross-boundary attacks on AgentDojo and InjecAgent with zero false positives while keeping resident state under 15 KB across 14-day soaks. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Examplelotaguard-mcp-boundary.ts
lotaguard-mcp-boundary.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Enforce strict MCP tool capability boundaries alongside Smoke Monkey permission gates
const agent = createAgent({
agentId: 'lotaguard-hardened-coder',
provider: 'openai-compatible',
baseUrl: 'http://127.0.0.1:8000/v1',
model: 'Qwen/Qwen3.8-27B',
workspacePath: process.cwd(),
mcpServers: {
filesystem: {
command: 'lotaguard-wrap',
args: [
'--ebpf-cone', 'read_only_workspace',
'--prompt-grounding', 'semantic',
'--', 'npx', '-y', '@modelcontextprotocol/server-filesystem', process.cwd()
],
},
},
permissions: {
read_file: 'allow',
write_file: 'ask',
run_command: 'ask',
},
});
async function main() {
const result = await agent.run(
'Fix the off-by-one clamping bug in src/app.py and run pytest without reading outside the repository.'
);
console.log('Verified execution summary:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

Model Context Protocol Clearly Explained | MCP Beyond the Hype

What is MCP? Integrate AI Agents with Databases & APIs

What Is Living-off-the-Agent (LotA) and LotAGuard?

Living-off-the-Agent (LotA) describes post-exploitation-style compromises where an autonomous coding agent abuses legitimate Model Context Protocol (MCP) tools—spawning shells, running pytest, editing config files, or opening sockets—to execute unauthorized OS actions. LotAGuard (Canale & Soulis, arXiv:2612.03557) is a sub-millisecond cross-layer monitor combining Linux eBPF hooks and Windows Sysmon/ETW events to enforce capability boundaries per MCP rpc_id.

Crucially, LotAGuard draws an explicit boundary between Class-I cross-boundary attacks (ungrounded reads of .ssh/.env, persistence writes, asynchronous child/IPC escapes after an RPC returns, and dormant .cursorrules triggers) and Class-II in-envelope semantic attacks (backdoors written inside an authorized source file).

Defense ApproachKernel VisibilityCross-Platform (Linux+Win)MCP rpc_id AttributionAsync Post-RPC EscapesAvoids Taint ExplosionRarity-Weighted Quirk Scoring
Signature EDR (Falco 0.45 / Sysmon)YesSingle-OS onlyNoPartial (no RPC)YesNo
OS Provenance (HOLMES / UNICORN)YesYesNoYesNo (graph drift)Partial
LLM Policy / Arg Guards (CaMeL / Progent)NoYesArgs onlyNoYesNo
LotAGuard (eBPF + ETW)YesYesYes (incarnation-safe)Yes (cone binding)Yes (hunk-blame)Yes (1% step-up)

Incarnation-Safe Causal Attribution, Rarity Weights, and Hunk-Blame

Conventional EDRs fail on coding agents because benign git_status or compiler runs trigger frequent harmless kernel quirks (e.g., loop:temporal_errno occurs 90 times per 100 benign runs). LotAGuard solves this with three mechanisms:

  1. Incarnation-Safe Process Cones: Every OS process is keyed by (pid, incarnation_gen) and bound to its originating MCP rpc_id. Even if an attacker spawns a detached background process that waits until after the RPC response (t > t_r) or recycles PIDs over a 14-day uptime, the monitor preserves exact attribution in under 15 KB of resident memory.
  2. Rarity-Weighted Violation Contracts: Common benign quirks receive near-zero weight (w = 0.023 for loop:temporal_errno, 0.136 for mcp:git_status:forbidden_write), while high-signal violations carry heavy weight (w = 0.820 for mcp:http_fetch:undeclared_net_port, w = 0.880 for mcp:read_file:ungrounded_sensitive_read).
  3. Hunk-Blame Differential Lineage: Instead of tainting an entire repository when an agent touches .cursorrules or CLAUDE.md, LotAGuard isolates only the newly added diff hunks, blocking dormant instruction poisoning without breaking legitimate refactor sessions.

Know the Class-II Boundary Limits

In Series G stress tests, LotAGuard intentionally scored 0/4 on Class-II in-envelope edits (such as inserting a logic backdoor into an authorized src/auth.py file or staging a grounded .env into docs/notes.md). Always pair runtime kernel envelopes with SAST, gitleaks pre-commit hooks, and human PR review.

Reproducible LotAGuard Deployment and Boundary Testing

Clone the open-source LotAGuard implementation to attach eBPF capability cones to your MCP servers and run the Series G/H boundary verification suite:

bash
# 1. Clone LotAGuard repository (Linux eBPF + Windows ETW cross-layer monitor)
git clone https://github.com/jeremy1392/LotAGuard.git
cd LotAGuard

# 2. Verify kernel BTF support for Linux eBPF lsm/file_open and tcp_connect hooks
ls -la /sys/kernel/btf/vmlinux

# 3. Run the deterministic boundary & SWE-bench benign calibration suite
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest tests/test_boundary_series_g.py tests/test_causal_cone.py
Google Search Questions & Answers

Frequently Asked Questions

Q:What is the difference between Class-I and Class-II agent attacks in LotAGuard?

Class-I attacks cross OS or protocol capability boundaries—such as reading ~/.ssh keys, writing persistence scripts, or spawning post-RPC network shells—and are caught 16/16 by LotAGuard. Class-II attacks stay inside authorized file envelopes (e.g., planting a logic bug in an approved source file) and require SAST or code review.

Q:How much memory and latency overhead does LotAGuard add?

LotAGuard operates with sub-millisecond per-syscall monitoring overhead and maintains under 15 KB of resident tracking state over a 14-day continuous soak test.

Q:Does LotAGuard block normal coding agent tools like pytest or git?

No. Across 100 SWE-bench Verified tasks, LotAGuard produced zero blocking false positives and only 1% step-up confirmation prompts by down-weighting common benign OS quirks via rarity scoring.

Q:Why does LotAGuard track raw UDP DnsQuery / udp_sendmsg in Mode 3?

Mode 1 hooks TCP connect calls, which misses raw UDP DNS exfiltration tunnels (case E3 in Series G). Enabling Mode 3 udp_sendmsg on Linux or Sysmon EID 22 on Windows closes DNS side-channel egress.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness