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
- Dev feedback: decoupling rex sessions from native windows is harder to adapt to than expected — alexisgallagher · 2026-12-05
- Salesforce research: buyer agents concede too easily, images boost persuasion ~17% — msrivastav13 · 2026-12-05
- Grok Build launches agent-driven post-quantum cryptography migration after NSA advisory, with $1,000 credits — ns123abc · 2026-12-05
- Seroter's reading list: post-quantum prep, agent harnesses, and life after 99% AI code — rseroter · 2026-12-05
- WSDM Cup 2027 Offers $10k to Build Autonomous Community Notes Agents — sanmikoyejo · 2026-12-05
- Trying Copilot Studio MCP for agent cloning and Power Automate sync: janky but workable — koltregaskes · 2026-12-05