Defense-in-DepthSecurity & Zero-Trust · 4 min read
Why Kagex Bans virtio-fs & Uses safefs Symlink-Fenced Host Writes
Shared folders introduce TOCTOU symlink races and accidental host deletions. Explicit vsock transfers plus safefs.RemoveUnder close the entire bug class.
- Host mounts
- None (zero virtio-fs / 9p shares)
- Guest transfer
- Traversal-checked tar streams over vsock
- Host cleanup
- internal/safefs.RemoveUnder
Verify safefs path-confinement unit tests
go test -v ./internal/safefs/... ./internal/workspace/...Key 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.
Eliminating Shared-Folder Escape Surfaces
Mounting host folders into untrusted guests relies on continuous path translation across kernel boundaries. Copying explicit deltas over AF_VSOCK gives a strict air-gap between VM syscalls and host inodes.
Symlink-Resolved Deletion Fencing
Every daemon cleanup operation outside temporary paths goes through safefs.RemoveUnder(root, path), verifying real resolved canonical targets never escape the daemon data root.
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
No. Delta tar sync pushes only modified files over memory-backed vsock in milliseconds.
#no virtio-fs AI sandbox#safefs RemoveUnder symlink attack#path traversal defense microVM#guest/files tar copy validation#AI agent filesystem isolation