Skip to main content
Help Verification
Verification

Creating output constraints

2 min read·1 views·100% found this helpful

Output constraints are rules the Verification Engine checks every model, API, or MCP response against before it reaches your users. When a response violates a constraint, G8KEPR flags or blocks it — so unsafe, malformed, or out-of-policy output can be caught before it ships.

How constraints work

Each constraint targets a field in the response payload and defines what a valid value looks like. You can attach constraints to any verified endpoint, and the engine evaluates them in order, recording a pass or fail for each one.

Constraint types

G8KEPR supports five kinds of constraint:

  • Numerical — bound a numeric field to a range, minimum, maximum, or exact value. Useful for scores, prices, counts, and probabilities.
  • Logical — require a field to satisfy a boolean rule, an allowed set of values, or a relationship between fields (for example, total must equal subtotal + tax).
  • Temporal — validate dates and timestamps: a value must be in the past or future, within a window, or ordered correctly relative to another field.
  • Structural — assert the shape of the output: required keys, data types, array length, or conformance to a schema.
  • Custom — supply your own expression when the built-in types don't fit, combining fields and operators into a single rule.

Define a constraint

  1. 1.Open Verification → Constraints and select the endpoint you want to protect.
  2. 2.Click Add constraint and choose a type.
  3. 3.Set the target field using dot notation for nested values (for example, result.confidence).
  4. 4.Enter the rule parameters, then choose an action on failure: flag (log and alert) or block (reject the response).
  5. 5.Save. New responses are evaluated immediately.

A numerical confidence constraint looks like this:

json
{
  "type": "numerical",
  "field": "result.confidence",
  "min": 0.75,
  "max": 1.0,
  "on_failure": "block"
}

Start every constraint in flag mode. Review a few days of results to confirm it isn't catching legitimate output, then switch to block.

Review results

Constraint outcomes appear in the verification log for each request, showing which rule failed and the offending value. Filter by constraint to measure how often each one triggers.

Constraints stack. Attach as many as you need to one endpoint — all must pass for a response to be marked verified.

To learn how verification fits into the broader pipeline, see How verification works.

Was this helpful?Still stuck? Submit a request →

Related articles