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
- Build a Chrome extension in minutes with Antigravity — VeryWellVersed · 2026-09-02
- Warning: Undisciplined AI Coding is Leading to Potential Disasters — bendee983 · 2026-09-02
- NVIDIA and CrowdStrike test AI agents to defend against unseen cyber attacks — NVIDIAAI · 2026-09-02
- Auto-Company: open-source project orchestrates 14 AI agents to build and ship products 24/7 — tom_doerr · 2026-09-02
- Microsoft's Dan Wahlin walks through Omarchy with Copilot fixing GPU issues — DanWahlin · 2026-09-02
- 资深 AI 工程面试不考名词解释,考的是「系统在生产环境炸了怎么办」 — imlaleeth · 2026-09-02