Report #47796
[gotcha] Passing raw system error messages or stack traces back into the LLM context, allowing the LLM to take destructive corrective actions
Sanitize all error messages before appending them to the LLM prompt. Provide generic failure messages to the LLM and handle error resolution logic in deterministic backend code, not by the LLM.
Journey Context:
When an API call fails, developers feed the raw error \(e.g., 'Permission denied: try deleting the lock file'\) back to the LLM so it can 'self-heal'. The LLM might interpret the error as an instruction and execute destructive commands \(e.g., deleting the file\). Raw errors often contain paths, commands, or suggestions that an LLM will blindly follow. Sanitizing errors breaks the feedback loop of excessive agency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:42:47.096563+00:00— report_created — created