Schema-Constrained LLMs Still Exhibit Semantic Errors in Transaction Agents

Yin Li· July 22, 2026 View original

Summary

A new benchmark, OrderBench, reveals that even with JSON Schema and structured output modes, LLM agents acting as transaction compilers can produce semantically incorrect or unsafe outputs despite being syntactically valid. The study found significant semantic error rates in restaurant ordering agents, emphasizing the need for domain verification beyond schema validation.

Large Language Model (LLM) agents are increasingly used to translate natural language user requests into structured data for API execution, often relying on JSON Schema or provider-specific structured output features to ensure syntactic correctness. However, a new benchmark called OrderBench demonstrates that syntactic and schema validity do not guarantee semantic reliability or safety in these transactional agents. OrderBench, designed for restaurant ordering scenarios, evaluates various aspects including syntactic validity, schema validity, status decisions, exact item semantics, constraint preservation, and the acceptance of unsafe requests. Testing four open models using Nebius Token Factory calls in both prompt-only and JSON-schema modes revealed that while schema validity could reach 100%, semantic success rates remained around 80% for the strongest model. Weaker models even showed double-digit rates of schema-valid but unsafe acceptances. This highlights a critical engineering warning: structured output is a necessary interface layer but not a replacement for robust domain-specific verification and fail-closed execution mechanisms.

Why it matters

Professionals building LLM-powered agents for transactional systems must understand that structured output alone is insufficient for ensuring semantic correctness and safety, necessitating additional domain-specific validation layers.

How to implement this in your domain

  1. 1Implement robust domain-specific validation logic after LLM-generated structured output.
  2. 2Design fail-closed mechanisms for transactional LLM agents to prevent unsafe operations.
  3. 3Utilize benchmarks like OrderBench to rigorously test the semantic reliability of LLM agents.
  4. 4Educate development teams on the distinction between syntactic validity and semantic correctness in LLM outputs.

Who benefits

E-commerceFintechRetailLogisticsAI Development

Key takeaways

  • LLM agents using structured output can still produce semantically incorrect or unsafe transactions.
  • JSON Schema and structured output modes ensure syntactic validity but not semantic reliability.
  • OrderBench highlights significant semantic error rates in LLM-based ordering agents.
  • Domain-specific verification and fail-closed execution are crucial beyond structured output.

Original post by Yin Li

"arXiv:2607.18261v1 Announce Type: new Abstract: LLM agents are increasingly used as transaction compilers: a user states an intent in natural language, and the model emits a structured object that an API can execute. JSON Schema and provider-level structured-output modes are usef…"

View on X

Originally posted by Yin Li on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses