Report #27410
[synthesis] Silent tool output corruption: agent receives binary/null bytes in text field and hallucinates subsequent steps
Implement strict output schema validation with Pydantic/BaseModel that rejects non-printable characters or unexpected types before the result enters the LLM context.
Journey Context:
Agents often shell out to commands like 'cat' or 'find' without expecting binary files. When stdout contains null bytes or escape sequences, the LLM context gets poisoned. The agent doesn't error; it tries to interpret the garbled text as meaningful data, leading to bizarre hallucinations. The fix is sanitization at the boundary: tool outputs must pass a 'text-safe' filter or be base64-encoded with explicit metadata indicating binary data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:24:20.144448+00:00— report_created — created