Skip to main content

LLM Validation Gateway

The LLM Validation Gateway is a high-performance, synchronous API endpoint designed to bridge the gap between unpredictable AI outputs and the rigid requirements of production software.

It acts as an Opinionated Contract Layer, ensuring that LLM-generated JSON is clean, correctly typed, and compliant with your organization's security policies before it ever touches your application logic.

Why use the Gateway?

Large Language Models (LLMs) are notorious for returning "messy" JSON. Common issues include:

  • Surrounding Prose: Explaining the JSON before or after the code block.
  • Markdown Fences: Returning JSON wrapped in json ... tags.
  • Syntax Errors: Missing quotes, trailing commas, or malformed structures.
  • Type Drift: Returning a string "123" when your app expects an integer 123.
  • Security Leaks: Accidentally including PII (like a user's email) in a field that should be anonymous.

The LLM Validation Gateway solves all of these issues in a single synchronous call.

How it Works

1. Extraction & Repair

The gateway automatically sniff's out the JSON object within a larger payload of text. It strips markdown fences and fixes common syntax errors (like trailing commas) to make the payload parseable.

2. Aggressive Coercion

The gateway uses your locked schemas from the Data Catalog to perform type coercion.

  • Strings like "1.0" or "1" are coerced to integers.
  • Strings like "true", "yes", or "on" are coerced to booleans.
  • Floating point numbers are rounded if the schema expects an integer.

3. Nested Validation

Support for complex, nested JSON structures allows you to validate deep hierarchies (e.g., user.address.zip_code). The gateway recursively traverses the payload to ensure every level matches the contract.

4. Zero-Trust Security (Governance)

The gateway is deeply integrated with Saddle Data's Governance Engine.

  • Policy Enforcement: Any field tagged in your catalog (e.g., PII, EMAIL) will have its corresponding organizational policy (e.g., MASK, HASH) applied in-memory.
  • Hallucination Detection: The gateway runs an internal pii-hound scan on the final output. If an LLM hallucinates an SSN or AWS Key into an untagged field, it is flagged in the metadata.

Architecture

The gateway is designed for programmatic access via API Keys. It is an outbound-only service, meaning your AI agents or backend services call our API to "cleanse" the data before processing it.

graph LR
A[LLM Output] --> B(Validation Gateway)
B --> C{Catalog Schema}
B --> D{Governance Rules}
B --> E[Pristine JSON]

Metering & Usage

Every successful validation is metered against your organization's monthly plan. You can monitor your gateway usage in the Organization Settings dashboard.

Pricing

The LLM Validation Gateway is available on all plans. Monthly validation limits vary by plan tier.