As enterprises deploy autonomous voice and reasoning agents with Alexa+ Enterprise and Amazon Bedrock, traditional network firewalls and static API keys become obsolete. When an LLM agent holds permissions to invoke database tools and payment APIs, a single prompt injection or runaway agent loop can exfiltrate sensitive customer data, execute destructive queries, or disburse corporate treasury funds without oversight.We set out to build the dedicated Zero-Trust security checkpoint for agentic AI: an air-gapped Model Context Protocol (MCP) gateway that intercepts agent tool calls at wire speed (<1 ms), enforcing cryptographic identity attestation, data masking, and human-in-the-loop approvals before any internal database or API is reached.What it doesLumen v2.3 sits as an air-gapped security proxy between autonomous agent orchestrators (Alexa+ Enterprise, Bedrock Agents) and internal corporate data silos:Sub-Millisecond Wire-Level Inspection (145.1 µs p50, 310.2 µs p99): Processes streaming JSON-RPC 2.0 frames on a non-blocking byte-stream framer with a 64 KiB buffer overflow circuit breaker.Zero-Exposure BFF Architecture: Keeps internal AWS ECS container endpoints, IAM Role ARNs, and KMS HMAC keys 100% hidden on the server. The user's browser bundle receives zero backend URLs or secrets.4-Lane Priority Traffic Manager (QoS): Isolates incoming calls into four token-bucket priority lanes (CRITICAL, HIGH, NORMAL, LOW), throttling runaway autonomous agent loops (-32008) while executive voice turns execute immediately.Sub-5µs Lexical Injection Firewall: Scans all tool arguments for SQL tautologies, stacked queries, path traversals, and shell injections (-32007).Field-Level RBAC & PII Redaction: Automatically masks sensitive fields like SSNs and wire routing numbers (***REDACTED***) unless the caller holds explicit RESTRICTED clearance.Human-in-the-Loop (HITL) MFA Financial Gate: Automatically approves low-risk payouts ($\le \$1,000$), while pausing high-value payouts ($> \$1,000$) via MCP resultType: "input_required" to demand an out-of-band hardware MFA token.Tamper-Evident BLAKE2b Audit Ledger: Chains every decision into a 256-bit BLAKE2b cryptographic log streamed to Supabase PostgreSQL and Amazon CloudWatch NDJSON.How we built itLumen was engineered across three decoupled layers:Hardened Python Bedrock (lumen_http_bridge.py v2.3): Built with Python 3.11 Standard Library only (zero third-party dependencies) to ensure zero supply-chain vulnerabilities. Deployed as a containerized microservice on AWS ECS Express Mode with port 8080 and /healthz health checks.Server-Side BFF Proxy (app/api/lumen/[...path]/route.ts): Built in Next.js App Router on Vercel. Receives requests from the browser, injects X-Lumen-Api-Key and the caller's Supabase JWT server-to-server, and proxies calls directly to the AWS ECS endpoint.Interactive 3D WebGL Frontend: Built with Next.js 14, Three.js, and Tailwind CSS. Features an interactive 5-ring orbital Zero-Trust core, live wire-frame inspector, and self-service Client SDK download center.Identity & Audit Store: Built on Supabase Cloud (PostgreSQL with Row-Level Security), securing user profiles and immutable audit records keyed by tenant_id.Challenges we ran intoZero-Exposure Browser Secret Isolation: Early client-side architectures risked exposing AWS endpoints or API keys in browser network traffic. We resolved this by routing all frontend calls through a server-side Next.js Backend-for-Frontend (BFF) proxy that injects backend headers inside server memory.Sub-Millisecond Latency Ceilings: Running JSON Schema validation, regex injection scans, HMAC verification, and token-bucket math in under 1,000 microseconds required ruthless optimization. We used slot-based dataclasses, precompiled regex tables, and zero-allocation string checks to achieve a median latency of 145.1 µs.Stateless Multi-Round-Trip HITL Elicitation: Handling paused payouts without introducing volatile server session state. We designed a cryptographic requestState token using HMAC-SHA256 that cryptographically binds the principal, tenant, vendor, invoice, and disbursement amount across approval round-trips.Cross-Cloud Redirect Whitelisting: Synchronizing dynamic Vercel deployment domains with Supabase Google OAuth callback boundaries under tight submission timelines.Accomplishments that we're proud ofPassing all 14 automated verification gates on boot while maintaining a 310.2 µs p99 wire latency SLA.Achieving zero external runtime dependencies on the Python backend, significantly hardening the runtime against package poisoning.Proving zero secret leakage across client bundles, DevTools network tabs, and public repositories.Delivering a full working integration: live 3D WebGL frontend on Vercel $\rightarrow$ server-side proxy $\rightarrow$ AWS ECS container $\rightarrow$ Supabase OAuth and audit logging.What we learnedHow the Model Context Protocol (MCP 2026-07-28) handles structured elicitation (input_required) to safely pause and resume agent execution.Why traditional API gateways fail to protect agentic AI: LLMs create dynamic payloads that require field-level RBAC evaluation and PII masking on every turn.How to use constant-time cryptographic primitives (hmac.compare_digest) to prevent timing side-channel attacks on low-latency microservices.What's next for LumenAWS Secrets Manager & KMS Integration: Adding automatic key-rotation hooks to cycle internal HMAC secrets directly from AWS KMS.Amazon Bedrock Guardrails Sync: Implementing automated bi-directional synchronization between Lumen's lexical firewall and Amazon Bedrock Action Group schemas.Kernel-Level eBPF Accelerator: Writing an eBPF/Rust packet-filtering driver to perform frame parsing and rate limiting directly in the Linux kernel for multi-gigabit throughput.Distributed Multi-Region State: Connecting the QoS Priority Traffic Manager to Amazon ElastiCache Redis for global cross-region rate synchronization.
Built With
- amazon-web-services
- antigravity
- codex
- gemini
- selfengineeringskills
- supabase
- vercel