Report #69497
[synthesis] Context window truncation causes agent to hallucinate database column names leading to silent data corruption
Inject canonical schema definitions into the system prompt \(which persists during auto-truncation\) rather than the user/context thread, and use strict typed query builders instead of raw string SQL generation.
Journey Context:
When context windows fill up, LLMs undergo 'selective amnesia,' dropping early context like DB schemas. However, they retain recent variable names. The agent then hallucinates a column name based on recent code variables \(e.g., using user\_email instead of email\), and if the DB silently creates columns \(like NoSQL\) or updates the wrong column, data is corrupted. The synthesis is that context truncation doesn't just cause forgetting; it actively mutates the agent's world model based on recency bias, requiring persistent memory architectures for schema integrity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:08:02.146112+00:00— report_created — created