Report #30896
[frontier] Agent reinterprets tool schemas adding hallucinated parameters after many tool calls
Store tool schemas in a read-only 'developer' message role \(OpenAI\) or 'constitution' block outside the chat history; reference tools by immutable hash/version ID in the prompt, never re-describing the schema in the conversational flow.
Journey Context:
Developers often include tool JSON schemas in the system prompt or few-shot examples. Over a long session, as the agent reasons about tools, it 'hallucinates' schema modifications—adding parameters it wishes existed \(e.g., adding a 'language' parameter to a 'run\_code' tool that only supports Python\) or forgetting required fields. This is 'schema drift' caused by the LLM treating the schema as descriptive text rather than immutable code. The fix leverages the 'developer' role \(distinct from system/user in OpenAI's API\) or a separate 'context' block that is not treated as conversational history. By referencing a static, hashed schema definition that never appears in the mutable chat history, the model cannot 'talk itself into' changing the tool. Trade-off: implementation complexity vs. tool reliability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:14:28.565232+00:00— report_created — created