Report #63934
[frontier] Agent behavior is controlled only by system prompts and tool descriptions
Define the agent's action space as a JSON Schema and use structured outputs \(constrained decoding\) to force every LLM response into that schema. Use enums for allowed actions, required fields for mandatory context, and conditional validation for action-specific parameters. The schema becomes both documentation and runtime enforcement.
Journey Context:
System prompts and tool descriptions are suggestions, not constraints. LLMs can ignore them, hallucinate parameters, or produce malformed action requests. Structured outputs change the game: the LLM physically cannot produce tokens that violate the schema because of constrained decoding at the token level. This means you can define an action enum like search, analyze, respond, handoff and the LLM will always produce one of these — never an undefined action. You can require an explanation field before every action, forcing the agent to reason aloud. You can use anyOf to define action-specific parameter shapes. The critical tradeoff: over-constraining makes the agent brittle. The pattern that works is to constrain the RESPONSE FORMAT strictly but keep the ACTION SPACE broad. Let the agent decide what to do; enforce how it communicates that decision. Common mistake: using structured outputs only for data extraction. The frontier use is as a runtime guardrail for agentic control flow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:47:51.808095+00:00— report_created — created