The Model Said It Rendered
I have rendered the two separate cards.
That was the agent’s reply. We were validating a new feature that lets the model draw interface components (cards, lists, buttons) directly into the chat, and had asked for two cards.
There was nothing on the screen. No cards, no error, no placeholder. Only the sentence.
How both were true at once
The model draws a component by calling a tool and passing it a JSON description of the surface. The tool parses the JSON, validates it, and sends it to the client to render.
The payload for the two cards had one unbalanced brace. The parse failed. The tool returned an error, the client received nothing to render, and the model, which had issued the call, wrote its reply.
The model was not being deceptive in any useful sense of the word. It had called the render tool with two cards. A tool call that comes back is, to a model, an event in a conversation, and the most likely next sentence after I called the tool that draws two cards is I have drawn two cards. Nothing in the error was written to stop that sentence, and nothing in the flow made sure the model had read the error before it spoke.
That is the mechanism, and it is easy to miss when you write tools: a tool’s error is read by a model, not a human. An engineer reading a parse error knows that nothing happened downstream of it. A model reading the same text sees a detail in a turn that, by its own account, went fine.
The validator that validated nothing
The same evening’s validation found a second problem, one layer down.
The development kit we built on wraps the tool, and its tool called the component validator and then discarded the result. Worse, the validator returned no errors even for a component type that does not exist. So the JSON that reached the client under a field literally named validated had not been validated by anything.
We wrapped the tool with a strict re-validation. On its first real turn it refused a valid surface. The model had split one surface across two parallel tool calls: one call created the surface, the other filled it. A validator that checks each call on its own saw an update for a surface that “didn’t exist yet,” and rejected it.
The first validator let everything through. The second let nothing through. Both were checking the wrong unit: a surface is session state, built up across calls, and a stateless per-call check of a stateful protocol is wrong in both directions. The fix lets validation treat a surface that is referenced but not yet begun as begun, for the purpose of validation only, so the check runs against the surface the user will actually see.
What changed
Every failure of the render tool is now a refusal that cannot be read as success. The error the model receives starts with three words in capitals:
NOTHING WAS RENDERED — <what broke>. Fix the JSON (it must be ONE valid JSON array;
check that every { and [ is closed) and call the tool again ONCE, or answer in plain
text. Never tell the user the UI was shown.
It says what happened, in the first words, in terms the model cannot fold into a success story. It says what broke. It gives exactly two honest options (retry once, or answer in text) and it names the one forbidden move, which is the move the model made.
The model is made to read it. On success, the tool’s output goes to the client without the model summarising it. On a refusal, summarisation is switched back on, so the model must take the error as an input to its next turn rather than a side note.
There are tests that pin both behaviours. One feeds the tool a payload with an unbalanced brace, the same shape as
the live failure, and fails unless the reply is a refusal that begins NOTHING WAS RENDERED and contains the
instruction never to tell the user. Another feeds it a component type spelled Txet, and fails if anything comes back
marked validated or if a single part is projected to the client.
The class, not the incident
Every agent builder writes error messages for tools. Most of us write them the way we always have: for an engineer tailing a log, terse and technical, with the important part somewhere in the middle. In an agent, the first reader of that message is a model mid-sentence, holding a plan. The message competes with the plan.
So the question for any tool error is not is this accurate but can this be mistaken for success by something that expected success. If it can, the user will eventually be told that something happened which did not.
Write the outcome first. Write what broke second. Write the allowed next moves, and the forbidden one. And make sure the model actually reads it, rather than trusting that a message in the transcript is a message that was understood.
The line that stays
A tool’s error is the last thing the model reads before it speaks to the user. It is part of the prompt, and it should be written that way.
An error message is a prompt. Write it like one.