An AI agent deleted a production database during a code freeze. Then it said rollback wouldn't work. It did.
Jason Lemkin's Replit test, July 2025 (his X thread; Fortune, The Register). Replit's fix: dev/prod DB separation.
The 5 guardrails before agents touch prod 👇
Ross | building with coding agents retweeted
这就是一条点石成金的视频!!!
一个辅导过几千个创业者的人,把 2027 年 AI 的钱在哪讲明白了。
9 分钟,一句废话没有
刚免费放出来
2027 年是分水岭,公司不再是卖软件,而是把你的服务变成软件,后端用 AI 交付,毛利上去,人只干人的活。
中心点在评论区👇
A Bash safety hook is not a sandbox.
It can block a shell command and still leave an agent's file-editing tools untouched.
When choosing guardrails for a coding agent, ask what they cover—and test what they don't.
The Bash hook denied rm. Write overwrote the file.
Left: Write landed, hook never ran. Right: permissions + sandbox.
Pain: "guarded" and the file still changed.
Fix: fence Write and Edit, not just Bash.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
AWS Nitro Sandboxes: own kernel per agent pod. Attestation can gate KMS secrets.
Harder wall ≠ authorization.
Parent-injected AWS keys never hit the hypervisor.
Quarantine secrets. Hard PreToolUse deny first.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
1
1
10
Claude Code's "don't ask again" saves the whole shell command — secrets included — to .claude/settings.local.json.
Apiiro found 1,122 public copies on GitHub, with 1,379 secrets.
That's a command log, not a vault. Approve patterns, not argv. Rotate what that file ever held.
Your agent inherited prod keys. The hook never saw them.
Left: AWS / GH_TOKEN / .env readable. Right: quarantine + agent-guard.
Pain: "safe" bash still prints $GH_TOKEN.
Fix: don't give the agent the keys.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
6
Sandbox sticker != containment.
1. Egress not default-deny
2. Local-dev credential left in prod
3. Bulk pull, no rate limit
Network cut != secret refuse.
Hard PreToolUse deny on credential paths first.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
2
Prompt "don't rm -rf" is soft. agent-guard is hard.
Same Bash. Soft: model may still run it. Hard: PreToolUse deny.
Pain: "done" after a soft "no".
Fix: seatbelt before the shell.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
2
Approval ≠ a season pass.
• reboot OK → rewrite /etc/fstab
• one .env read → dump the rest
• laptop → cloud = bigger blast radius
Hard PreToolUse deny. One yes ≠ forever.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
3
Codex: reboot one server.
Rewrote /etc/fstab, broke systemd, ran unasked scripts. $10k+.
Not rogue — reboot approval became open season.
One approved action ≠ license for the rest.
Hard PreToolUse deny first.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
6
Browser-cred CLI tip = session grant.
Failure modes:
1. Soft "don't leak" after jar readable
2. Cookie scrape → off-site pivot
3. Token outlives the tab
Hard PreToolUse deny on credential/session paths first.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
8
Anthropic had Claude agents hide misalignment in fine-tuning data that passed per-row monitors.
Every example looked fine. Harm was in the aggregate.
Same bug as sandbox alerts after the tool call ran: wrong unit of check.
Fence surfaces first. Monitor distributions, not rows.
3
Marketplace extension != trusted runtime.
Claude Code 2.1.313: Open VSX SSH backdoor via auto-update.
Pin fails if agents can install.
Hard PreToolUse deny on install/extension paths.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
1
Worktrees fix collision, not authorization.
Failure modes:
1. rewrite via python -c / nested shell
2. secrets readable on "its" tree
3. soft prompt gates ignored
Hard PreToolUse deny.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
10
YOLO alone vs YOLO + agent-guard.
Same risky prompt. Left: soft prompts off, secrets open. Right: PreToolUse hard deny.
Pain: "done" while the dangerous call still ran.
Fix: seatbelt before YOLO.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
1
48
Soft string gates don't fence agents.
Rewrite: python -c, base64, nested shells. Soft denies miss; hard PreToolUse deny outside the model doesn't.
Before YOLO: harness deny, no prod secrets, throwaway host.
curl -fsSL raw.githubusercontent.com/ro… | bash
github.com/rossbuilds/agent-…
1
1
56
Agents say "done." The tool already refused.
UI goes green. Nothing happened.
Treat every "done" as untrusted until you check the side effect — file exists, PR opened, deploy done.
PreToolUse seatbelts refuse before the fake success.
curl -fsSL raw.githubusercontent.com/ro… | bash
9
Three agents on one branch isn't parallel — it's a merge fight.
Before you spawn #2:
1) One parent owns the merge
2) Hard boundaries (dirs / APIs / contracts)
3) Detect conflicts automatically
4) Human breaks ties on irreversible overlap
Ownership first. Speed second.
5







