Don't Put Critical Rules in Prompts: Hard-coded Guardrails for Prod Agents
Mariia_Sosnina · reddit · 2026-07-24
The author shares painful lessons from running an AI content pipeline at a B2B SaaS company: prompt-level rules cannot stop agents from making mistakes in production. Under unexpected input conditions, an agent ignored instructions, skipped fact-checking, and published fabricated details.
To fix this, the author concluded that critical rules must be "hard-coded" outside the model:
- Decoupled Publishing: Publishing is handled by a script, not the agent. The script acts as an if-statement that won't run unless a fact-check entry exists in the run log.
- Independent Context Grading: Fact-checking is performed by a separate agent in a fresh context to prevent self-grading bias.
- Revoked Config Access: The agent lost write access to its own configuration to prevent it from making unsynced changes across files that could silently rot the system.
More from coding & agent
- Claude Code vs Codex: the harness may matter more than the model — al_kRicha · 2026-07-24
- Which model should power each agent task in production? — Logical-Silver-272 · 2026-07-24
- Offloop says its 4-person multi-agent harness beat Claude Code and Codex on GDPval — rohanpaul_ai · 2026-07-24
- Graph engineering, in one line: deterministic multi-agent loops become DAGs — vincent_koc · 2026-07-24
- BackSearch’s development was led by @ranko3000 with feedback from several collaborators — rosstaylor90 · 2026-07-24
- Default Codex CLI with GPT-5.5 scores 92.3% on XBOW, but the paper says the harness matters — evilsocket · 2026-07-24