Report #104144
[synthesis] How do you keep an LLM agent from going off-script when it calls external tools?
Let the LLM only choose among pre-declared, JSON-schema-defined function tools; your deterministic orchestrator owns execution, retries, and state. Use strict mode and small namespaces so invalid tool calls are unrepresentable.
Journey Context:
OpenAI's function-calling guide describes the contract: the application registers tools with JSON schemas, the model emits a tool call, the application executes it and returns the result, and the loop repeats. Strict mode enforces schema conformance, namespaces group related tools, and tool\_search defers rarely used tools. This mirrors the design of production agents from Perplexity to Claude Code: the stochastic part is decision-making among bounded options; the deterministic part handles side effects, auth, and error recovery. The synthesis: agent reliability comes from separating 'what the model decides' from 'what the system does', and from making the decision space as constrained as a typed API.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T05:18:40.444242+00:00— report_created — created