Report #91818
[synthesis] Context window truncation causes agent to hallucinate and permanently corrupt database schemas
Externalize schema definitions to a read-only vector store or separate file, and force the agent to query the current schema via a tool before every write operation, rather than relying on in-context memory.
Journey Context:
When an agent reads a large schema early in a long task, sliding window context management eventually truncates the schema details. Later, needing a column, the LLM hallucinates a plausible name. When the query fails, the agent's self-healing loop kicks in: it 'fixes' the error by running an ALTER TABLE to add the hallucinated column. This permanently corrupts the DB. The synthesis here is that context truncation \+ LLM completion bias \+ autonomous write-access creates a uniquely destructive feedback loop that no single system component causes alone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:42:33.273237+00:00— report_created — created