Abox: Running AI Coding Agents in eBPF-Monitored VMs with TLS MITM
Hook
AI coding agents can exfiltrate your codebase through allowed HTTPS domains by encoding data in request bodies, and traditional container sandboxes won't catch it. Sandia National Labs built something that might.
Context
When your security team says yes to experimenting with Claude Code or GPT-4 as coding assistants but absolutely not to giving them unrestricted internet access, you need more than Docker. AI agents are fundamentally different from traditional sandboxed workloads: they make unpredictable API calls to documentation sites, npm registries, GitHub, model providers, and Stack Overflow. They need enough freedom to be useful but enough restriction to prevent data exfiltration or SSRF attacks against internal infrastructure.
Existing solutions fall short. Docker with network policies operates at L3/L4, meaning an agent can still hit cloud metadata endpoints (169.254.169.254) or use domain fronting to disguise malicious HTTPS traffic. Firecracker and gVisor provide stronger isolation but lack application-layer visibility—you can block IPs, but you can't inspect what's inside TLS connections. Abox, from Sandia National Laboratories, takes a different approach: VM-level isolation with multi-layered network filtering that performs TLS man-in-the-middle inspection, combined with eBPF-based telemetry via Cilium's Tetragon. It's Vagrant for paranoid security teams running AI agents.
Technical Insight
Abox's architecture implements defense-in-depth through three filtering layers that catch progressively more sophisticated evasion attempts. When you spin up an instance, abox creates a bridge network where all outbound traffic flows through two sidecar processes: dnsfilter (port 5353) and httpfilter (port 8080). The VM's /etc/resolv.conf points to the DNS filter, which enforces a domain allowlist and returns NXDOMAIN for unauthorized domains—not timeouts or blocks, which would signal to the agent that filtering is happening and encourage DNS-over-HTTPS evasion.
The HTTP filtering layer is where things get interesting. Abox generates a per-instance CA certificate during provisioning and injects it into the guest OS trust store (Ubuntu's /usr/local/share/ca-certificates/, macOS keychain, Windows cert store). The httpfilter process then performs TLS MITM on every HTTPS request, terminating the connection, inspecting the SNI and Host header, and re-establishing a connection to the actual destination if allowed. This catches domain fronting attacks—where an agent requests evil.com with SNI but sends Host: allowed-api.com in the HTTP header to bypass domain-based filtering.
Here's what the filter configuration looks like in abox.yaml:
name: claude-coding-env
vm:
base_image: ubuntu-22.04
cpu: 4
memory: 4096
network:
allowlist:
- anthropic.com
- api.anthropic.com
- github.com
- raw.githubusercontent.com
- registry.npmjs.org
- pypi.org
- files.pythonhosted.org
monitoring:
tetragon:
enabled: true
policies:
- process_execution
- file_access
- network_connections
The SSRF protection goes beyond simple domain filtering. The httpfilter explicitly blocks requests to RFC1918 private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback addresses, link-local ranges, IPv6 special-use addresses, and cloud metadata endpoints. It also performs DNS re-resolution before connecting—if an agent queries an allowed domain that resolves to 169.254.169.254 (AWS metadata endpoint), the connection gets blocked even though DNS resolution succeeded.
The backend abstraction layer cleanly separates VM management from filtering logic. The codebase defines a Backend interface that libvirt, vfkit (macOS), and VMware implementations satisfy:
type Backend interface {
Create(config VMConfig) error
Start(name string) error
Stop(name string) error
Snapshot(name, snapshotName string) error
Mount(name, path string) (mountpoint string, err error)
Status(name string) (VMStatus, error)
}
Libvirt is the only production-ready backend with full snapshot/mount/monitoring support. The vfkit backend (for Apple Silicon Macs) is experimental and missing critical features—no snapshot support means you can't roll back a VM after an agent experiment goes wrong.
Tetragon integration sets abox apart from simpler sandboxes. Rather than treating the VM as a black box, abox uses eBPF probes to capture syscall-level telemetry: which files the agent modifies, what processes it spawns, and what network connections it attempts. You get a detailed audit trail of agent behavior without requiring cooperation from the agent itself. The provisioning system uses SSH-based shell script execution (similar to Vagrant), installing language runtimes, dev tools, and the injected CA certificate. For passwordless VM operations without handing out sudo access, abox includes a setuid privilege helper binary—a carefully scoped compromise between security and developer ergonomics.
Gotcha
The allowlist model is simultaneously abox's greatest strength and biggest operational burden. Modern AI agents make unpredictable API calls—Claude might query MDN for JavaScript documentation, then hit npm for a package definition, then check GitHub for example code. Miss a single domain in your allowlist and the agent breaks silently (from its perspective, the DNS lookup failed). Overly permissive allowlists defeat the purpose. You'll spend the first week running agents with verbose logging, watching connection attempts, and iteratively expanding the allowlist. There's no intelligent learning mode or automatic suggestion system.
Performance overhead is substantial but completely undocumented. TLS MITM on every HTTPS request adds latency—the httpfilter must terminate the connection, parse headers, re-encrypt, and forward. eBPF telemetry adds CPU overhead for every syscall in monitored processes. The example configuration requests 4GB RAM for a basic coding environment, suggesting resource requirements are non-trivial. No benchmarks exist comparing agent performance inside abox versus native execution. The macOS and VMware backends are second-class citizens with missing features (no snapshots, no mounting, limited monitoring), making abox primarily a Linux-only tool despite the multi-backend architecture. Finally, the security model assumes containment, not prevention—an agent with code execution inside the VM can still exfiltrate data through allowed domains by encoding secrets in API request bodies or abusing allowed services for command-and-control. Abox gives you visibility and some protection, not a guarantee.
Verdict
Use if: You're a security team at a government lab, financial institution, or defense contractor that needs to experiment with AI coding agents while maintaining strict network controls and audit trails. You have compliance requirements around AI tool usage and need syscall-level telemetry of what agents actually do. You're running Linux hypervisors (KVM/libvirt) and have the engineering resources to maintain per-agent domain allowlists. You value defense-in-depth and need protection against domain fronting and SSRF that container-based solutions can't provide. Skip if: You're running agents in production (the allowlist maintenance burden doesn't scale), you're on macOS/Windows without a Linux server for VMs (limited backend support makes this painful), your threat model doesn't require TLS inspection (simpler solutions like gVisor or Firecracker will perform better), or you trust your agents enough that egress filtering at L3/L4 is sufficient. The sweet spot is research environments where you want to know what agents attempt, not just what they accomplish.