How Styx keeps coding agents away from production
Agents run as you, with your logged-in CLIs. This is how Styx puts a person between them and production, where that stops, and a bug I fixed the day before launch. Every coding agent I use runs as me. Claude Code, Codex, Gemini CLI and Cursor's agent start with my PATH, my files and my logged-in CLIs. If I've run vercel login, gcloud auth login or supabase login on this machine, the agent has too. Nothing in that setup knows the difference between vercel deploy and vercel deploy --prod, or between a supabase db push to a scratch project and one to the database people are using. I run several at once, across several projects, and I don't read every command. One wrong --prod and it's done before I look. Styx is the app I built to run those agents. This is how the part between an agent and your deploy targets works, and where it stops. The code is Apache-2.0; I've linked the files. A command like supabase db push takes this path: A shim named supabase, first on the agent's PATH, catches it. The shim asks a local broker. Its connection is bound to one agent session. A pure policy function decides: approve, ask or deny. On ask, the agent waits and you get a request, in its chat and as a notification. You grant it for a set time. Production writes, deploys and deletes need Touch ID, Windows Hello or your system password first. The real command runs with that grant's credentials in its environment, and nothing else. Every step is written to an append-only, hash-chained audit log. When Styx starts an agent, a directory of small scripts goes first on its PATH: vercel, gh, aws, gcloud, supabase and ssh. This is the vercel one, from shim-service.ts: #!/bin/sh # Styx shim: authorises the command through the grant broker, then execs the real vercel with injected credentials. exec env ELECTRON_RUN_AS_NODE=1 "$STYX_EXE" "$STYX_CLI" wrap vercel "$@" styx wrap connects to the broker, calls exec_authorize with the tool, its arguments and the working directory, and waits up to ten min