Prevent Prompt Injection by Removing Dangerous Tokens from Query Grammar
go_kul_07 · reddit · 2026-09-02
The author proposes moving security boundaries from system prompts down to the grammar level to prevent prompt injection. In their agent memory engine, dangerous commands like DELETE or ERASE are not valid tokens and are rejected by the lexer. The only destructive operation allowed is FORGET <hash>, which deletes exactly one record by its content hash. This physical isolation via non-existent syntax is more reliable than a "never delete" request. The author advocates for real controls outside the model using permissions, isolated environments, and approval gates.
More from coding & agent
- LLM one-shots a Minecraft 3x3 piston door by building its own Linux test infra — Vjeux · 2026-10-18
- Dev builds Mumbai-inspired 3D manga background generator from OpenStreetMap data — CurieuxExplorer · 2026-10-18
- Solo founder builds a money-printing data service on Claude's Pi Durable harness — MicahBerkley · 2026-10-18
- Dev builds Arch-based OS with custom desktop and browser using Claude Code — Snoo-10493 · 2026-10-18
- Five SaaS agent workflows fail the same way — and it's never model intelligence — usehive · 2026-10-18
- Claude skill generates hand-drawn interactive diagrams that teach kids how things work — CatAstro_Piyush · 2026-10-18