# Eval Tier 1 — Deterministic Guardrails

Runs on every output before it leaves the agent. If tier 1 fails, the output does not propagate.

## What it checks
- JSON schema validation (structure, types, required fields)
- Format constraints (length, character sets, encoding)
- Interface contracts (function signatures, API contracts)
- Deterministic assertions (known impossibilities)

## Implementation pattern (pseudocode)
```
def tier_1_check(output):
    checks = [
        schema_validate(output, expected_schema),
        length_check(output, min_len, max_len),
        contract_check(output, interface_spec),
        forbidden_pattern_check(output, blocklist),
    ]
    return all(checks), [c.name for c in checks if not c.passed]
```

## Failure handling
- Log the failure with structured metadata
- Do not retry silently more than N times (N usually 3)
- If retries exhausted, escalate to human queue with full context
- Circuit-break if tier-1 failure rate exceeds threshold (usually 5% over 100 outputs)

## Rules
- Tier 1 is deterministic. If it can be flaky, it is not tier 1.
- Tier 1 is fast. Sub-100ms per output.
- Tier 1 failures are always logged, never swallowed.
