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
Developers sit clicking manual "Approve" 50 times an hour, or surrender to blanket "Always Allow"—giving every untrusted subagent root-level project permissions.
Pages of plain-text prohibitions ("never do X, do not run Y") are injected into LLM prompts on every turn, burning thousands in unnecessary API token bills.
Politely asking an LLM not to drop tables fails 10-20% under prompt injections, complex reasoning drift, or jailbreaks. Markdown text cannot physically block a syscall.
ctxsec Zero-Trust Hypervisor
Per-skill least-privilege declarative boundaries (`ctxsec.yaml`) let developers safely give autonomous agents full execution autonomy without hovering over an approve button.
`ctx skill optimize` distills negative prompt instructions into compile-free Google CEL rules, stripping bloated tokens from every prompt turn and eliminating attention drift.
OS kernel sandboxing (Seatbelt / Bubblewrap) and < 5µs CEL policy gates guarantee that dangerous tool calls are physically blocked, regardless of prompt injections.
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}