Optimizing an AI system for an isolated metric inevitably causes the system to manipulate the test. Building a production-grade evaluation system requires replacing composite scoring with constrained optimization, validating performance across a four-layer triangulation engine, separating assurance from product discovery, and gating deployments through a four-stage continuous integration pipeline.

How to Build a Governed AI Evaluation System: Constrained Optimization and Four-Layer Triangulation

A Systems Engineering Blueprint for Principal PMs, Evaluation Engineers, and AI Architects


The architectural objective is not to design an ungameable metric. It is to build a verification system in which no single proxy—benchmark, judge, telemetry, or expert audit—has enough unilateral authority to clear a deployment on its own.


Prerequisite Reading: For an introduction to why AI metrics get gamed and the three classic failure modes (verbosity, refusal inflation, and sycophancy), start with Part 1: Goodhart’s Law in Generative AI: When Better Evals Produce Worse Products.


The Problem with Composite Scoring

When engineering teams recognize that optimizing for an isolated metric produces pathological behavior, their initial instinct is often mathematical: blend every competing priority into an exponential composite scoring formula.

Score = (Accuracy ^ 1.2) * (1 / Latency) * (1 - Toxicity_Penalty)

This mathematical instinct fails in production. Multiplying disparate dimensions introduces arbitrary weighting through mathematical structure:

Composite scores create an illusion of rigor while obscuring dangerous trade-offs. A high overall score routinely masks unacceptable localized degradations—such as severe sycophancy on high-risk queries or refusal spikes on ambiguous customer prompts.

To build an evaluation harness that resists Goodhart drift, teams must replace composite formulas with constrained optimization and multi-layer triangulation.


Constrained Optimization: Target + Failure Envelopes

Constrained optimization replaces weighted arithmetic with explicit step-functions. The architecture establishes a clear separation between the primary optimization objective and non-negotiable operational boundaries.

flowchart TD
    Target["<b>Primary Yield Target (Optimization Goal)</b><br/><b>Maximize Verified Task Completion</b> on valid in-domain requests"]

    Target ==>|"Bound by Non-Negotiable Failure Envelopes"| Envelopes

    subgraph Envelopes ["Failure Envelopes (Hard Constraints)"]
        direction TB
        E1["<b>Safety & Legal Boundary:</b> Zero ungrounded claims or regulatory violations"]
        E2["<b>Calibrated Refusal Floor:</b> CRQ baseline — no evading valid enterprise tasks"]
        E3["<b>Latency SLA Budget:</b> P95 response time ≤ 3.5 seconds"]
        E4["<b>Token Density Floor:</b> Ratio ≥ 0.65 (eliminates filler preambles)"]
        E5["<b>Unit Margin Ceiling:</b> Inference cost ≤ $0.02 per resolved session"]
        E1 ~~~ E2 ~~~ E3 ~~~ E4 ~~~ E5
    end

    style Target fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#ffffff
    style Envelopes fill:#111827,stroke:#ef4444,stroke-width:2px,color:#f8fafc
    style E1 fill:#1f2937,stroke:#f87171,stroke-width:1px,color:#fca5a5
    style E2 fill:#1f2937,stroke:#f87171,stroke-width:1px,color:#fca5a5
    style E3 fill:#1f2937,stroke:#f87171,stroke-width:1px,color:#fca5a5
    style E4 fill:#1f2937,stroke:#f87171,stroke-width:1px,color:#fca5a5
    style E5 fill:#1f2937,stroke:#f87171,stroke-width:1px,color:#fca5a5

1. The Primary Yield Objective

The engineering squad focuses on a single goal: maximizing verified task completion on valid, in-domain customer requests. Every prompt modification, fine-tuning run, and retrieval parameter tweak aims to increase this yield.

2. Non-Negotiable Failure Envelopes

The primary target is bound by hard boundary conditions that cannot be violated under any circumstances:

The Golden Rule of Failure Envelopes: You cannot trade off a non-negotiable boundary to buy higher accuracy. If a candidate prompt or model checkpoint boosts task completion by 8% but increases P95 latency by 1.8 seconds or triggers defensive refusals on valid edge cases, it fails the release gate immediately.

Decision Rights Matrix

Who determines whether an accuracy increase justifies an increase in operational latency or inference cost? Distributing decision rights across accountable functional owners prevents hidden engineering compromises:

Governance Dimension Accountable Functional Owner Governing Operational Standard
Safety, Legal, and Refusal Limits Risk, Legal, and Compliance Zero tolerance on unauthorized disclosures and regulatory violations. Step-function gate.
Latency and Unit Cost Budgets Engineering and Finance P95 latency budgets and gross margin per transaction.
UX and Token Density Envelopes Product and Design Time-to-Action (TTA) and cognitive friction thresholds.
Domain Truth and Evidence Standards Domain Stewards (Clinicians, Counsel, Underwriters) Ground-truth accuracy norms and clinical/legal review rubrics.
Final Deployment Acceptance Named Product & Technical Leads Single accountable sign-off across all constraint gates.

The Four-Layer Triangulation Engine

No single measurement layer provides complete visibility into generative AI quality. A robust governance system relies on Four-Layer Triangulation, treating every layer as an imperfect proxy with distinct structural blind spots.

flowchart TD
    subgraph L1 ["Layer 1: Offline Capability ('Can the model do the job?')"]
        direction LR
        L1_A["<b>Measurement:</b> Golden datasets, schema tests, extraction precision"]
        L1_B["<b>Operational Rule:</b> Dynamic refreshes from live production incident logs"]
    end

    subgraph L2 ["Layer 2: Adversarial Bounds ('How does the system break?')"]
        direction LR
        L2_A["<b>Measurement:</b> Injected flawed premises, sycophancy probes, edge stress"]
        L2_B["<b>Operational Rule:</b> Derived from sanitized customer support escalations"]
    end

    subgraph L3 ["Layer 3: Production Telemetry ('What do real users experience?')"]
        direction LR
        L3_A["<b>Measurement:</b> Re-prompt rates, Time-to-Action (TTA), copy-paste discard rate"]
        L3_B["<b>Operational Rule:</b> Multi-signal negative divergence tracking across cohorts"]
    end

    subgraph L4 ["Layer 4: Human Outcome Auditing ('Did it deliver business value?')"]
        direction LR
        L4_A["<b>Measurement:</b> Double-blind reviews by accredited domain practitioners"]
        L4_B["<b>Operational Rule:</b> Statistical inter-rater reliability to audit automated judges"]
    end

    L1 ==> L2 ==> L3 ==> L4

    style L1 fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#f1f5f9
    style L2 fill:#0f172a,stroke:#f59e0b,stroke-width:2px,color:#f1f5f9
    style L3 fill:#0f172a,stroke:#a855f7,stroke-width:2px,color:#f1f5f9
    style L4 fill:#0f172a,stroke:#10b981,stroke-width:2px,color:#f1f5f9
    style L1_A fill:#1e293b,stroke:#0284c7,stroke-width:1px,color:#e2e8f0
    style L1_B fill:#1e293b,stroke:#0284c7,stroke-width:1px,color:#e2e8f0
    style L2_A fill:#1e293b,stroke:#d97706,stroke-width:1px,color:#e2e8f0
    style L2_B fill:#1e293b,stroke:#d97706,stroke-width:1px,color:#e2e8f0
    style L3_A fill:#1e293b,stroke:#9333ea,stroke-width:1px,color:#e2e8f0
    style L3_B fill:#1e293b,stroke:#9333ea,stroke-width:1px,color:#e2e8f0
    style L4_A fill:#1e293b,stroke:#059669,stroke-width:1px,color:#e2e8f0
    style L4_B fill:#1e293b,stroke:#059669,stroke-width:1px,color:#e2e8f0

Layer 1: Offline Capability Evaluations ("Can it do it?")

Layer 2: Adversarial Failure Envelopes ("How does it break?")

Layer 3: Production Behavioral Telemetry ("What actually happens?")

Layer 4: Human Expert Outcome Auditing ("Did it improve the customer's job?")

The Evidence Independence Audit

Triangulation is an illusion if all four layers share the same structural assumptions.

If the offline golden set, the automated LLM judge, the adversarial edge tests, and the human annotator rubrics all draw from the same prompt templates, vendor model family, or corporate policy interpretations, four evidence streams produce one shared blind spot.

Before treating multi-layer evidence as verification, run an Evidence Independence Audit:

  1. Model Diversity: Does the automated judge utilize a different model family and architecture than the generator model? Frontier models trained on similar preference corpora often share identical verbosity and sycophancy biases; true independence requires distinct training distributions.
  2. Methodological Diversity: Does the system combine deterministic programmatic assertions (regex, JSON grammar constraints) with probabilistic LLM evaluators and behavioral signals?
  3. Incentive Diversity: Are human raters compensated based on evaluation accuracy and depth rather than review volume?
  4. Data Isolation: Are golden evaluation sets strictly segregated from fine-tuning corpora and prompt-tuning workflows?

Calibrated Refusal Quality: Balancing Precision and Recall

A frequent failure mode in production AI is optimizing exclusively for accuracy or exclusively for safety.

To eliminate this perverse incentive, govern by Calibrated Refusal Quality (CRQ):

$$\text{CRQ} = \text{Refusal Precision} \times (1 - \text{False Refusal Rate})$$

Where:

Refusal Precision False Refusal Rate Resulting Operating State
High High Defensive Paralysis ("Helpless Compliance"): Safe on paper, but rejects legitimate enterprise workflows.
Low Low Reckless Hallucination: Answers indiscriminately, fabricating responses when evidence is missing.
High Low Calibrated Enterprise Utility (CRQ Target): Completes valid in-domain requests; deterministically refuses ungrounded queries.

CRQ penalizes gaming in both directions. A model that refuses all hard queries fails on False Refusal Rate; a model that guesses indiscriminately fails on Refusal Precision.


Dual-Track Architecture: Assurance vs. Discovery

Applying rigid failure envelopes to early-stage product development kills innovation before value is discovered. Product organizations must maintain a Dual-Track Architecture:

flowchart TD
    Work["<b>Incoming AI Workflow</b>"] --> Decision{"Does the team know what<br/>'good' looks like for this workflow?"}

    Decision ==>|"YES: Established Tasks"| Assurance["<b>Capability Assurance Track</b><br/>─────────────<br/>• Enforce non-negotiable failure envelopes<br/>• Automated 4-gate CI/CD deployment blocking<br/>• Shadow production traffic evaluation<br/>• Strict latency and unit economics ceilings"]

    Decision ==>|"NO: New Paradigms"| Discovery["<b>Product Discovery Track</b><br/>─────────────<br/>• Reversible opt-in customer cohorts<br/>• Workflow shadowing & heuristic exploration<br/>• Structured qualitative Decision Journals<br/>• Rapid iteration without premature gating"]

    style Work fill:#1e293b,stroke:#64748b,stroke-width:1px,color:#f8fafc
    style Decision fill:#334155,stroke:#94a3b8,stroke-width:2px,color:#f8fafc
    style Assurance fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#93c5fd
    style Discovery fill:#0f172a,stroke:#10b981,stroke-width:2px,color:#a7f3d0

1. The Capability Assurance Track

2. The Product Discovery Track


The 4-Gate CI/CD Release Pipeline

To operationalize these controls into an automated software delivery process, structure deployment pipelines around four sequential verification gates. A candidate prompt, model checkpoint, or routing policy must clear each gate sequentially before promoting to production.

flowchart TD
    G1["<b>GATE 1: Mechanistic & Syntactic Validation</b><br/>• Constrained decoding grammars (JSON/regex)<br/>• Latency SLA budget (P95 ≤ 3.5s)<br/>• Token density floor (ratio ≥ 0.65)"]
    G2["<b>GATE 2: Adversarial Failure Envelopes</b><br/>• Injected flawed premises (anti-sycophancy)<br/>• Calibrated Refusal Quality (CRQ baseline)<br/>• Citation entailment & conflict tests"]
    G3["<b>GATE 3: Constrained Task Yield Evaluation</b><br/>• Verified completion on golden test sets<br/>• Concurrent failure envelope enforcement<br/>• Zero cross-metric trade-offs allowed"]
    G4["<b>GATE 4: Shadow Traffic & Telemetry Monitoring</b><br/>• Live production shadow routing<br/>• Re-prompt spikes & copy-paste discard tracking<br/>• Tenant-isolated evaluation perimeters"]
    Prod[("<b>Production Canary Release</b>")]

    G1 ==>|"Pass Gate 1"| G2
    G2 ==>|"Pass Gate 2"| G3
    G3 ==>|"Pass Gate 3"| G4
    G4 ==>|"Deploy to Canary"| Prod

    style G1 fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#f8fafc
    style G2 fill:#1e293b,stroke:#f59e0b,stroke-width:2px,color:#f8fafc
    style G3 fill:#1e293b,stroke:#6366f1,stroke-width:2px,color:#f8fafc
    style G4 fill:#1e293b,stroke:#10b981,stroke-width:2px,color:#f8fafc
    style Prod fill:#047857,stroke:#34d399,stroke-width:2px,color:#ffffff

Gate 1: Mechanistic and Syntactic Validation

Before running quality evaluations, test programmatic invariants:

Gate 2: Adversarial Failure Envelopes

Subject the candidate to edge cases designed to trigger the failure modes its primary objective tends to induce:

Gate 3: Constrained Task Yield Evaluation

Evaluate the candidate against the versioned golden evaluation suite:

Gate 4: Shadow Traffic and Divergence Telemetry

Route a risk-calibrated fraction of live production traffic to the candidate in shadow mode:


Core Operating Directives for AI Engineering Leaders

  1. Enforce Hard Failure Envelopes over Composite Formulas: Reject any model candidate that achieves higher accuracy by broadening its failure envelopes. A 6% improvement in task completion is invalid if it introduces defensive refusals or unacceptable latency.
  2. Audit the Auditor Continuously: Measure inter-rater agreement between automated LLM judges and human domain experts. When statistical agreement drops below baseline, halt automated deployments until judge rubrics are recalibrated.
  3. Treat Telemetry as an Early Warning System, Not Ground Truth: Use clickstream telemetry to identify divergence, not proof of quality. When high copy-paste volume coincides with high re-prompt rates, assume users are manually repairing broken outputs.
  4. Retire Static Benchmarks Dynamically: Refresh evaluation datasets based on production incident logs, customer escalations, and regulatory updates rather than fixed calendar intervals.
  5. Decouple Product Discovery from Capability Assurance: Keep constraints lightweight during early exploration to discover user value; enforce rigorous failure envelopes when scaling validated workflows into production.
  6. Align Organizational Incentives to Business Outcomes: Measurement architecture addresses the symptom; incentive structure addresses the cause. If product managers, engineers, and data annotators are evaluated on response-level proxy scores rather than downstream workflow completion, no governance architecture will prevent gaming.

One-Line Synthesis

Durable AI governance does not seek an ungameable metric; it enforces a constrained optimization system where no single proxy can unilaterally clear a production release.


The ideas in this post are my own — they emerged from questions I asked while learning applied AI concepts and putting them to work in my job and my projects. The prose was developed with AI assistance.

Frequently Asked Questions

How does constrained optimization resolve metric conflict without creating arbitrary composite scores?

Multiplying disparate metrics into a single composite score creates arbitrary weighting through mathematical structure. Constrained optimization separates non-negotiable failure boundaries from the primary optimization target: the system maximizes verified task completion within hard, pre-negotiated constraints for safety, calibrated refusal floors, latency budgets, and unit economics.

What is the Evidence Independence Test in triangulation?

Triangulation fails if all evidence layers share the same structural assumptions. If the offline evaluation suite, automated LLM judge, adversarial edge tests, and human review rubrics all rely on the same model family, prompts, or policy interpretations, the system creates a self-referential echo chamber. Triangulation requires evidence sources that diverge in methodology, failure modes, and operational incentives.

Why is production behavioral telemetry an imperfect substitute for offline evaluations?

Telemetry is itself an ambiguous proxy shaped by endogenous user adaptations. A high copy-paste rate can signal an exceptional output or a broken response that required manual external editing; a low re-prompt rate can reflect immediate success or silent user abandonment. Furthermore, critical enterprise value is often counterfactual—such as preventing an adverse medical event or a regulatory violation—which emits no anomalous telemetry signal.

How does Calibrated Refusal Quality (CRQ) balance precision and recall in refusals?

A simple refusal ceiling incentivizes reckless hallucination when uncertain, while optimizing purely for zero hallucination triggers defensive refusal of valid queries. CRQ multiplies Refusal Precision by (1 - False Refusal Rate), penalizing both reckless answers on out-of-domain queries and defensive evasions on valid in-domain requests.

What is the Dual-Track Architecture for AI evaluation?

Dual-track architecture separates established production workflows from early product discovery. The Capability Assurance track enforces hard failure envelopes and automated CI/CD release gates on validated workflows. The Product Discovery track uses reversible cohorts, workflow shadowing, and decision journals to explore novel interaction paradigms without prematurely choking exploration with rigid constraints.

How does a 4-gate CI/CD loop prevent metric gaming prior to deployment?

A 4-gate CI/CD pipeline enforces sequential verification: Gate 1 verifies mechanistic and syntactic invariants (latency, token density, grammar); Gate 2 subjects the candidate to adversarial edge tests and refusal stress; Gate 3 tests constrained task yield against golden evaluation sets; and Gate 4 routes shadow production traffic to detect telemetry anomalies before full release.

Download the Architecture of Proof Checklist

Ready to implement? Get the definitive checklist for building verifiable AI systems.

Zoomed image
Free Download

Downloading Resource

Enter your email to get instant access. No spam — only occasional updates from Architecture of Proof.

Success

Link Sent

Great! We've sent the download link to your email. Please check your inbox.