Constraining agents with LL(1) grammar + structured diagnostics: what it fixes and what slips through
Upstairs-Special-925 · reddit · 2026-09-03
A controlled experiment: an agent implemented a CRUD + role-gated backend from a plain-English spec, with output forced through constrained decoding (GBNF from an LL(1) grammar). The compiler returned structured JSON diagnostics on every rejection, and the agent repaired in a loop.
What improved: syntactic validity rose sharply, and entire classes of ownership/capability errors disappeared.
What remained: higher-level workflow and side-effect issues that no single language can fully capture — the policy-layer problem.
The author offers to share the grammar fragment, diagnostic shape, and exact prompts, and asks what failure modes others still see under strong static constraints.
More from coding & agent
- Tigerless Labs' auto-gtm drafts X/Reddit posts from your PRs, never auto-posts — Aiden_Tech_Ai · 2026-09-03
- How to measure agent quality beyond task success: dev seeks real-world eval metrics — serpratik · 2026-09-03
- Giving your Grok bot an email and a credit card: webhook routines that buy things on Amazon — jeff_weinstein · 2026-09-03
- Dev builds full multi-agent stack on Nostr relay with encrypted A2A comms and unified MCP — RileyRalmuto · 2026-09-03
- Study of 8,351 Claude Code plugins finds 74% of docs commits are runtime instructions — rohanpaul_ai · 2026-09-03
- Codex hooks hide exit codes — stalegreen rewrites verification commands and blocks 26% of stale green claims — SmiLePLSSS · 2026-09-03