By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: TruFoundryPublished August 20, 2026

TL;DR: Parseable JSON is not the same as a trusted machine contract, TruFoundry argues: structured outputs still require schema enforcement, business validation, and authorization before any downstream action. That boundary matters because tool calls, provider-specific schema limits, and retry loops can turn a formatting problem into an access-control problem.


At a glance

What this is: This analysis explains why structured outputs in production AI need more than valid JSON, and why schema shape, business rules, and authorization must each be enforced separately.

Why it matters: IAM, PAM, NHI and agentic AI teams need this distinction because a model can emit a structurally valid request that still violates policy, accesses the wrong resource, or triggers an unauthorized action.

By the numbers:

👉 Read TruFoundry's analysis of structured outputs, schemas and validation


Context

Structured outputs solve a reliability problem, but they do not solve a trust problem. In production AI, the boundary between model text and executable software is where schema validation, policy enforcement, and identity control begin to matter, especially when LLM-generated objects can trigger privileged actions or call governed tools.

The practical gap is not whether a model can return valid JSON. It is whether the object is semantically correct, permitted in context, and safe to execute. That distinction matters in AI agent and NHI governance because a structured request can still carry the wrong identity, the wrong resource, or the wrong authority.

TrueFoundry’s article is typical of the current state of enterprise AI engineering: teams are moving from prompt formatting to contract design, but many still under-specify the controls that sit after generation.


Key questions

Q: How should security teams govern structured outputs from AI agents?

A: They should treat structured outputs as an intermediate control, not a trust decision. Validate the schema, then validate business rules, then require explicit authorization before any external action. That sequence prevents a model from turning a syntactically correct object into an unintended privileged workflow, which is especially important when agents can call tools on behalf of users or services.

Q: Why do valid JSON responses still create security risk?

A: Because JSON only proves format, not correctness or permission. A valid object can still target the wrong resource, exceed policy, or encode a harmful tool call. Security teams should assume that every structured response is untrusted until business validation and access control confirm it is safe to execute.

Q: What do teams get wrong about tool calling in AI systems?

A: They often treat a typed tool call as if it were already approved. In practice, a tool call is only a request with structured arguments. The security boundary sits after the call is formed, where identity, policy, and audit determine whether the action may proceed.

Q: How do organisations reduce risk when models generate action objects?

A: Use small, purpose-built schemas, enforce deterministic validation, and keep retries bounded. That reduces the chance that a model invents excess fields or loops through repeated failures. For high-risk actions, require human or policy approval before the object can become a real-world side effect.


Technical breakdown

JSON mode vs schema-conforming output

JSON mode only guarantees parseable structure. A schema-conforming output goes further by constraining required fields, enums, nesting, and object shape, but that still does not prove the data is correct or allowed to act. In production systems, the model’s response is only the first layer of assurance. Provider-specific schema support also varies, so a response that validates on one backend may fail or weaken on another. The real issue is not formatting success, but whether downstream software can trust the object enough to continue the workflow.

Practical implication: validate the provider path you ship, not just the schema you wrote.

Why business validation sits after generation

A schema can say an amount is a number, but it cannot know whether the amount exceeds policy, whether a customer belongs to the right tenant, or whether a timestamp is fresh enough for the workflow. That is why business validators, database lookups, and policy checks belong after generation. These controls separate syntactic correctness from operational correctness. Without them, a model can produce a perfectly valid object that still causes the wrong refund, deployment, access grant, or routing decision.

Practical implication: add deterministic policy checks before any structured output reaches execution.

Tool calling, MCP and authorization boundaries

Tool calls are structured outputs with consequence. The object does not just describe information, it selects an action and passes arguments into an external system. That makes tool naming, argument limits, and governed handoff part of the security design, not just the application design. In MCP-style integrations, typed schemas improve interoperability, but they do not authorize the operation. Authorization, approval, and audit must remain separate from the schema itself, especially when AI agents can choose when to invoke tools.

Practical implication: treat every tool call as a privileged request that still needs access control.


Threat narrative

Attacker objective: The objective is to convert a trusted model response into an unauthorized or policy-violating action through the application boundary.

  1. Entry begins when a model or agent produces a valid-looking structured object that contains a harmful action or overbroad argument set.
  2. Escalation occurs when the application trusts schema conformance as proof of correctness and forwards the object into a tool, API, or workflow without independent policy checks.
  3. Impact follows when the downstream action executes with the wrong authority, causing unauthorized access, incorrect transactions, or privileged side effects.

NHI Mgmt Group analysis

Structured outputs are a governance problem, not just a parser problem. The article is right to separate JSON validity from business validity, because production risk starts when teams assume syntactic success equals safe execution. That assumption is especially dangerous in agentic AI and NHI contexts, where a machine-readable object can request privileged action. The correct governance posture is to treat structured output as one control layer inside a larger identity and policy boundary.

Typed contracts create a narrower authority surface, which is now a security design choice. When model interfaces are reduced to small enums, explicit required fields, and bounded objects, the blast radius of model error shrinks. That matters for AI agents acting as non-human identities, because interface design determines how much authority the system can even propose. The practitioner conclusion is simple: fewer fields, fewer surprises, less unintended privilege.

Schema portability does not equal control portability. The article highlights that provider-native structured outputs, translated schemas, and application validators do not behave identically. That is a useful warning for teams standardising across model providers, because governance assumptions can break at the handoff layer. In identity terms, the same request may be well formed but still untrusted, which means portability must be tested at the policy boundary, not just the API boundary.

Return-path design is part of resilience, especially when validation fails. Retry loops, repair prompts, and fallback parsing can easily become an unbounded control path if teams do not cap them. This is the same governance mistake seen in many NHI and agent workflows: failure handling is treated as engineering convenience rather than a trust decision. The practical conclusion is to make defects machine-readable, retry sparingly, and escalate when policy cannot be proven.

Concept: the contract-to-authority gap. This post exposes the gap between a response that satisfies a declared schema and a request that is actually allowed to execute. That gap is where many emerging AI controls fail, because the system confuses representation with authority. For IAM and PAM teams, the lesson is to enforce authorization after structure, not inside it.

What this signals

Structured outputs are becoming the default interface for enterprise AI, but the real governance challenge is the control stack after generation. Teams should expect more incidents where a model returns something formally valid that is still operationally unsafe, which is why schema validation, policy checks, and authorization must be designed as separate layers. The relevant external references here are the NIST AI Risk Management Framework and the OWASP Top 10 for Agentic Applications 2026.

Contract-to-authority gap: the next governance failure will not be a malformed response, but a well-formed one that crosses the wrong trust boundary. That means IAM and PAM teams need to model structured output as a privileged handoff, especially where agents can invoke MCP tools or trigger business workflows.

The operational signal to watch is not output quality alone, but whether your programme can prove why a model-generated object was allowed to act. If you cannot answer that question consistently, you do not yet have an AI control plane, only a parsing layer.


For practitioners

  • Separate validation from authorization Require schema validation, business-rule validation, and explicit access decisions as distinct steps before any model output can trigger a tool call or external workflow.
  • Shrink model-facing schemas Expose intent-level objects with small enums, required fields, and shallow nesting instead of passing full backend payloads to the model.
  • Treat tool calls as privileged requests Apply least privilege, scoped approvals, and audit logging to every tool boundary, especially where AI agents act through MCP or other typed interfaces.
  • Bound repair and retry loops Return machine-readable defects, but cap retries and escalate after repeated validation failures so repair logic does not become an ungoverned control path.
  • Test provider-specific schema behaviour Validate the exact model and gateway combination you plan to ship, because native structured outputs, schema translation, and fallback handling do not guarantee identical enforcement.

Key takeaways

  • Structured outputs improve reliability, but they do not prove that a model-generated object is safe, correct, or authorised.
  • The practical control gap is the handoff between schema conformance and business approval, where many AI workflows still rely on trust instead of policy.
  • Teams should design smaller schemas, deterministic validation, and bounded repair loops before allowing agentic systems to trigger real-world actions.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10O1The article centers on agent output trust, tool calls, and structured-output control.
NIST AI RMFMANAGEThis is about operationalising AI controls and failure handling in production.
NIST CSF 2.0PR.AC-4Authorisation and least privilege govern whether structured outputs may act.
NIST SP 800-53 Rev 5AC-6Least privilege is central when model-generated requests can reach external systems.
MITRE ATT&CKTA0006 , Credential Access; TA0004 , Privilege EscalationThe threat pattern involves turning trusted outputs into over-privileged actions.

Use MANAGE controls to define validation, escalation, and bounded retry paths for model outputs.


Key terms

  • Structured Output: A structured output is model-generated content constrained to a defined format such as JSON or a schema. It improves machine readability, but it does not prove correctness, policy compliance, or permission to act. The output still needs validation and authorization before execution.
  • Business Validation: Business validation is the deterministic checking of model output against real-world rules such as ownership, freshness, policy limits, and tenant boundaries. It sits after schema validation because a syntactically valid object can still be operationally wrong or unsafe.
  • Tool calling: Tool calling is the pattern where a model selects and invokes an external function during runtime. In agent systems this turns text generation into action execution, so the access decision must be constrained, logged, and governed like any other privileged interaction.
  • Contract-to-Authority Gap: The contract-to-authority gap is the distance between an object that matches a declared schema and a request that is actually allowed to execute. It is a common failure zone in AI systems because representation control and access control are often treated as the same thing.

What's in the full article

TruFoundry's full article covers the operational detail this post intentionally leaves for the source:

  • Provider-specific structured-output behavior across native JSON mode, schema-constrained paths, and translated tool calls
  • Practical examples of Pydantic validation, Instructor retries, and machine-readable defect handling
  • Implementation trade-offs for MCP Gateway output schemas and tool contracts in production workflows
  • Guidance on when to use shadow validation to test schema compatibility before rollout

👉 TruFoundry's full article covers provider-specific schema behavior, validation patterns and tool-contract design.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, secrets management, and workload identity. It helps practitioners translate model output controls into enforceable identity and privilege boundaries.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 21, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org