Lesson 9 of 14 · 7 min
Bug 2: the planner that lies
@outputs.X is what the planner says Apex returned. Vague schemas plus sticky context produce convincing fabrications.
The first bug was an ops problem: the agent user couldn't see the class. This second bug lives one layer deeper, inside the planner itself, and it is the deepest insight from this build. @outputs.X is what the planner says the action returned, not what Apex literally returned. The LLM can summarize, paraphrase, or fabricate a tool result, and that fabricated value becomes your variable's new value.
A real example we hit
User typed: "My email is info@salesforce.com" (not a known customer).
Apex returned customer_id="", verified="false". But the trace
showed:
verified_flag = "true" # fabricated
customer_id = "cust_100" # alice's ID, the LLM had seen earlier
after_reasoning then saw verified_flag == "true" and flipped
customer_verified = True. A non-customer was now verified.
Why this happens: three converging factors
- Sticky context. The LLM has alice's
cust_100in its conversation window from earlier turns and re-emits it. - Vague output schema. The action's
outputs:block had nodescription:for the fields, so the LLM's prior is "a customer ID probably looks likecust_100." - No raw-output enforcement. Agent Script does not force
@outputs.Xto be the literal Apex return.