Threat ModelSecurity & Zero-Trust · 6 min read
Zero-Trust Architecture for Autonomous Coding Agents in 2026
Assume every LLM tool call can execute arbitrary attacker-controlled scripts from untrusted repos or npm packages — Kagex contains every layer automatically.
- Untrusted code
- Isolated single-tenant Ubuntu 24.04 kernel
- API keys
- Host enclave placeholders only
- Daemon auth
- SO_PEERCRED / LOCAL_PEERCRED + CSRF origin checks
Audit all host & security settings
sandboxd config # Inspect active egress, memory, and vault configuration
sandboxctl doctor # Verify daemon health and isolation boundariesKey Engineering Points · Ghost Secrets Vault & Zero-Leak Proxy
All 10 key points →- 1Real API tokens and credentials stay encrypted/stored solely on the host with 0600 permissions under daemon data roots.
- 2Sandboxes receive only synthetic harmless placeholder tokens formatted as sbxph_<name>_<hex>.
- 3Outbound HTTPS requests targeting approved secret hosts terminate TLS cleanly at a per-daemon ECDSA P-256 local CA proxy.
- 4Host egress proxy swaps real credentials in transit strictly when both host allowlist and secret destination rules match.
- 5Echoed secrets inside upstream HTTP response bodies or debug headers are redacted automatically back into placeholders via scrubReader.
- 6Cleartext HTTP requests attempting to carry secret placeholders are dropped immediately before touching the wire.
Defending Against Malicious Repositories & Prompt Injection
Opening an unfamiliar repository in Cursor, Antigravity, or Claude Code exposes agents to malicious Makefiles, npm postinstall hooks, and hidden README instructions. In Kagex, postinstall hooks have zero access to host files, SSH keys, or LAN services.
Daemon API Hardening Against Browser CSRF
internal/api/middleware checks Unix peer UID credentials (SO_PEERCRED / LOCAL_PEERCRED), enforces TCP Bearer tokens, and rejects unexpected Origin or Host headers to block browser-based localhost attacks.
Inspect this architecture live in 3D
Step through MCP ingress, Ghost Secrets, CoW blades, and run sandboxctl commands interactively in your browser.
Frequently Asked Questions
Prompt instructions can be bypassed by prompt injection inside issues, code comments, or logs. Kagex enforces boundaries in hypervisor, kernel, network, and host Go code.
#zero-trust AI coding agent#prompt injection sandbox defense#malicious npm postinstall isolation#AI agent security threat model#safe autonomous coding environment