Deterministic Guardrails for
Autonomous AI Agents
Modern AI agents execute unrestrained bash commands, leak context secrets, and trigger catastrophic pricing cliffs. ctxsec provides hardware-isolated kernel sandboxing, microsecond CEL policy hypervisors, and real-time DLP redaction with zero VM overhead.
1# ctxsec.yaml - Zero-Trust Declarative Agent Role Scoping2version: "1.0"3pipeline: "enterprise-agent-bounds"45roles:6 researcher:7 network:8 default: allow9 allow: ["*.google.com:443", "github.com:443"]10 filesystem:11 read: ["."]12 write: ["local/scratch"]13 forbidden_tools: ["write_to_file", "replace_file_content"]1415 coder:16 network:17 default: deny # Physical hardware socket drop18 filesystem:19 read: ["."]20 write: ["pkg", "cmd", "local/scratch", "web"]Why Existing AI Agent Runtimes Fail
Today's AI agent frameworks (Antigravity, Cursor, Claude Desktop, and vanilla MCP) rely on implicit trust. Once tool execution is enabled, the agent has full, unsandboxed host capabilities.
Current Naive AI Runtimes
Any tool or subagent can issue raw curl, bind listening ports, or read ~/.ssh/ without operating system containment.
Child subagents (e.g. read-only researcher) inherit the full permissions of the primary agent, allowing them to overwrite critical files or tamper with git histories.
Raw API keys and PII get blasted directly into public model prompts, triggering severe context degradation and 2x-4x token pricing cliffs.
ctxsec Zero-Trust Hypervisor
Apple Seatbelt & Linux Bubblewrap drop network sockets and isolate disk paths at the OS kernel level without Docker or VM startup penalties.
Google Common Expression Language evaluates compile-free AST facts, role boundaries, and session budgets in microsecond time before execution.
Shannon entropy and regex filters scrub secrets before prompts leave your machine while hierarchical token slicers reduce costs by 60-90%.
Multi-Layer Defense Topology
Observe how tool requests travel through the three defense layers. Select an attack scenario below to see real-time hardware containment in action.
OS Hardware Isolation
Agent-based config and guardrails on hyper-fast hardware kernel level. Enforced via macOS Apple Seatbelt and Linux Bubblewrap to physically drop rogue sockets and isolate the filesystem with 0ms VM overhead.
Google CEL Hypervisor
Google Common Expression Language hypervisor evaluating per-agent role attenuation and tool gating in < 5µs. Declaratively ensures read-only subagents cannot execute mutating bash commands.
DLP & Token Compactor
Guards context and tokens against prompt explosion while scrubbing sensitive data, API secrets, and PII before prompts leave your laptop. Eliminates token waste and pricing cliffs.
Engineered for Zero Overhead & Total Control
Every capability is delivered as an importable Go package, a CLI command, and a strongly-typed MCP tool.
Zero-CGo Static Go
Compiled strictly with CGO_ENABLED=0. Runs as a single static binary with no external runtime dependencies and sub-millisecond execution.
Google CEL Hypervisor
Google Common Expression Language policy engine evaluates AST facts, caller roles, and session budgets compile-free in under 5µs.
Ed25519 Cryptographic Trust
Every downloaded skill, manifest, and agent envelope is cryptographically signed and verified. Prevents tampered community tooling.
Token Pricing Cliff Defense
Prunes whitespace, compresses repetitive tool outputs, and slices context before reaching the 128k/200k provider pricing cliffs.
Tamper-Evident Audit Ledger
Embedded SQLite audit ledger records every syscall verdict, policy evaluation, and tool trajectory for complete post-incident forensics.
Universal MCP Gateway
Transparent stdio proxy gating all Model Context Protocol requests. Works seamlessly with Antigravity, Cursor, Claude Desktop, and VS Code.
Live Google CEL Policy Engine
Test how declarative Common Expression Language rules intercept dangerous actions in microsecond runtime.
Module Registry & Capabilities
Discover, verify, and install verified security modules with signed provenance and zero-trust envelopes.
0ms in-kernel OS containment for macOS (Apple Seatbelt) and Linux (Bubblewrap). Drops sockets without Docker overhead.
Universal token and cost compactor: 128k pricing cliff prevention, whitespace compaction, and multi-tier router.
Zero-allocation Shannon entropy secret scanner and Luhn credit card, SSN, and email redaction.
Zero-Trust Ed25519 signed delegation envelopes, 3-step X25519 ECDH mutual handshake, and key rotation.
Universal MCP Gateway Setup
Transparently intercepts, gates, and isolates tools across any AI developer environment.
1// .agents/hooks.json (Antigravity CLI & IDE PreToolUse Interception)2{3 "ctxsec-guard": {4 "enabled": true,5 "PreToolUse": [6 {7 "matcher": "run_command|write_to_file|replace_file_content",8 "hooks": [9 {10 "type": "command",11 "command": "ctx hook --format=antigravity",12 "timeout": 513 }14 ]15 }16 ]17 }18}