Building a branch-and-merge database guardrail so LLM agents can't wreck production
Antique-Willow-5841 · reddit · 2026-10-17
After an LLM agent with write access deleted all their CRM lead lists, the author built a sidecar database: agents work on copied-table branches, merges go back to Postgres in one transaction, gated by per-row three-way merge, read tracking, SQL checks, no-delete rules and held side effects. Post dives into hard-won lessons: text-based row comparison to avoid false conflicts, reserving serial ids from production sequences, SET LOCAL under PgBouncer, and crash-safe merge id pre-writing. Beta status, 10k rows per merge max.
Related event: Developer Builds Git-Style Branched Postgres After AI Agent Wipes CRM Data(3 posts)→
More from coding & agent
- Palo Alto Networks ships Cortex XCOR: AI SRE agent diagnoses alerts in under 3 minutes — shashib · 2026-10-17
- HF dev begs OpenAI/Anthropic to fix agents picking the wrong Chrome window — NielsRogge · 2026-10-17
- An agent negotiated a 3PL contract in 3 days, end to end — aarthir · 2026-10-17
- Gemini 3 vs Opus 4.5 vs GPT-5.1 vs Grok 4: same-prompt 3D diorama showdown — cedric_chee · 2026-10-17
- Reverse-engineering OpenAI Atlas browser's system prompt with Claude Code — DionysianAgent · 2026-10-17
- Hugging Face Hub adds RL Environment category with 153 agent-ready environments — mervenoyann · 2026-10-17