Inspiration

Evidence-grounded AI systems are usually evaluated one answer at a time: provide evidence, ask a question, and inspect whether the response appears correct.

That misses relational failures.

A system may answer correctly once but change when the same evidence is paraphrased, become distracted by irrelevant information, or preserve a conclusion after its supporting evidence disappears.

ReplayGuard applies metamorphic testing to this problem. Instead of requiring a perfect gold answer for every run, it defines how the target should behave when its evidence changes in controlled ways.

The model analyzes, while deterministic code decides.

GPT-5.6 performs bounded semantic interpretation, while deterministic rules own the final verdict, report, and CI exit status.

What it does

ReplayGuard fails your CI build when an evidence-grounded AI system’s answer stops following its evidence.

It begins with a baseline evidence fixture and generates four controlled replays:

  • Equivalent evidence: The meaning is preserved, so the answer should remain materially stable.
  • Distractor added: Irrelevant information is introduced, so the answer should resist distraction.
  • Supporting evidence removed: Decisive support disappears, so the answer should weaken, change, or abstain.
  • No evidence: The evidence packet is empty, so the target should declare insufficiency and avoid unsupported claims.

ReplayGuard then:

  1. Runs the target against the baseline and transformed evidence packets.
  2. Collects structured verdicts, claims, citations, confidence, and evidence-sufficiency fields.
  3. Uses GPT-5.6 for bounded semantic comparisons where exact string matching would be inadequate.
  4. Applies deterministic transition rules to classify each replay.
  5. Produces machine-readable JSON and interactive HTML reports.
  6. Returns exit code 0 for a passing contract, 1 for brittle behavior, or 2 for an invalid test or execution failure.

The public demo uses synthetic procurement-policy fixtures and intentionally clean and brittle targets. The fixtures are controlled, but the CLI, adapters, verdict engine, reports, tests, and CI behavior are real.

ReplayGuard does not formally verify a probabilistic model or certify universal factual correctness. It tests whether a target follows explicit behavioral contracts as its evidence changes.

How we built it

ReplayGuard is a Python 3.11+ command-line developer tool with a modular testing pipeline.

The implementation includes:

  • strict Pydantic fixture and response schemas;
  • deterministic evidence-transformation builders;
  • sample and custom JSON HTTP target adapters;
  • GPT-5.6 Structured Outputs for semantic assessment;
  • a deterministic transition-verdict engine;
  • JSON and self-contained HTML reports;
  • reproducible clean and brittle demonstration targets;
  • pytest coverage, Ruff validation, and GitHub Actions integration.

Each fixture defines the question, canonical claim, evidence documents, expected baseline behavior, allowed verdicts, and replay contracts. ReplayGuard constructs each evidence state, executes the target, and compares the resulting behavior with the baseline.

GPT-5.6 is constrained to questions such as whether two claims preserve the same meaning or whether a citation supports a claim. It does not decide whether the build passes. Deterministic code enforces the allowed verdict transitions, citation rules, support-removal behavior, abstention requirements, and process exit status.

Codex was the primary implementation environment for building and auditing the CLI, schemas, adapters, reports, tests, documentation, and CI workflow.

The evaluator was also regression-tested against a sanitized corpus of twenty responses retained from four earlier live GPT-5.6 runs. Those responses exposed two false-positive evaluator assumptions, which were corrected and preserved as deterministic regression cases.

Pilot validation

After the demo was frozen, ReplayGuard was evaluated in a preregistered pilot using 30 independent fixtures across six domains.

Two target prompts were tested with three replicates across a baseline and four evidence transformations, producing:

  • 180 complete five-state runs
  • 900 live GPT-5.6 calls
  • zero execution errors
  • zero missing prompt pairs
  • zero replicate inconsistencies

Across all 180 no-evidence responses, both prompt arms abstained.

The hardened prompt also followed the strict empty-claims contract in all 90 of its no-evidence responses. The naive prompt abstained but returned a nonempty material_claims field in all 90, usually describing the absence of evidence. ReplayGuard therefore classified those responses as strict output-contract violations, not as continued support for the original claim.

The naive arm also produced 5 failures across 90 support-removal responses.

Separately, the released evaluator produced 10 false positives on equivalent-evidence transitions because its citation gate depended on stochastic baseline citation selection. Those disagreements were preserved, audited, and corrected in a separately reported study-level analysis.

The pilot remains exploratory rather than confirmatory. It evaluated the released ReplayGuard commit, and the full 900-call experiment was not rerun after the evaluator corrections. Native released-evaluator outcomes and corrected study-level outcomes are therefore reported separately rather than rewriting the original results.

Challenges we ran into

Semantic equivalence is not textual equivalence

An early evaluator treated expected claims too literally. A target could express the correct meaning through a natural paraphrase and still appear unstable.

ReplayGuard now separates textual form from material meaning. GPT-5.6 performs the bounded semantic comparison, while deterministic rules decide whether the transition passes.

Appropriate change can look like instability

When decisive support disappears, a reliable target should often change its verdict or return insufficient_evidence.

An early confidence rule compared responses across different verdict classes and incorrectly treated correct abstention as degradation. The evaluator had to distinguish inappropriate instability under preserved meaning from appropriate responsiveness after evidence loss.

The evaluator can fail too

The live-response corpus and 900-call pilot both exposed defects in ReplayGuard’s own test oracle.

Rather than removing or silently reclassifying those outcomes, the experiments were frozen, the disagreements were documented, and the cases were converted into regression tests.

An evaluator must be tested as rigorously as the system it evaluates.

Keeping the final control path deterministic

It would have been easier to ask a model whether each run passed. That would make the CI gate probabilistic and difficult to audit.

ReplayGuard instead uses GPT-5.6 for structured semantic interpretation and deterministic code for enforcement.

Accomplishments that we're proud of

ReplayGuard became a complete developer tool rather than only a testing concept.

The project includes:

  • an end-to-end CLI;
  • four controlled evidence replays;
  • fail-closed fixture validation;
  • deterministic CI exit semantics;
  • structured GPT-5.6 analysis;
  • custom target-adapter boundaries;
  • JSON and interactive HTML reporting;
  • clean and deliberately brittle demonstration targets;
  • automated tests and passing CI;
  • retained live-response regression fixtures;
  • a completed 900-call exploratory pilot.

The strongest accomplishment was not simply catching a brittle target. It was allowing live behavior to reveal weaknesses in ReplayGuard’s own evaluator, preserving those failures, and improving the oracle without hiding the original outcomes.

What we learned

Static correctness testing is not enough for evidence-grounded AI. Reliability also depends on how a system responds when evidence is reworded, supplemented, weakened, or removed.

We learned that:

  • transitions between outputs can be more informative than isolated outputs;
  • semantic equivalence cannot be reduced to exact text matching;
  • abstention and output-contract compliance are related but distinct behaviors;
  • preserved meaning and removed support require different acceptance rules;
  • probabilistic interpretation can be useful without making the final CI decision probabilistic;
  • evaluator defects can resemble target defects unless both are independently audited;
  • synthetic fixtures are effective for proving mechanics when their scope is stated clearly.

Most importantly, trustworthy AI testing requires explicit behavioral contracts. “The answer should be good” is not testable. ReplayGuard converts that expectation into inspectable transition rules.

What's next for ReplayGuard

The next stage is larger confirmatory validation across independent fixture clusters and domain-specific evidence contracts.

Future engineering work includes:

  • domain-specific fixture libraries;
  • adapters for production RAG pipelines;
  • claim-to-evidence span mapping;
  • configurable transition policies;
  • pull-request annotations;
  • historical baseline and drift monitoring;
  • richer citation-consistency checks;
  • fixture-authoring and review tools;
  • preregistered confirmatory studies.

ReplayGuard is domain-agnostic at the fixture and adapter boundary, but responsible use in a new domain still requires domain-specific evidence, expected claims, transformations, and acceptance policies.

The long-term goal is to make evidence-grounded AI testing behave more like conventional software quality assurance: reproducible, inspectable, automatable, and strict enough to block a deployment when system behavior no longer follows its evidence.

Built With

  • api
  • ci/cd
  • codex
  • developer
  • evaluation
  • github
  • gpt-5.6
  • httpx
  • metamorphic
  • openai
  • outputs
  • pydantic
  • pytest
  • python
  • ruff
  • sdk
  • structured
  • tools
Share this project:

Updates

posted an update

Post-Submission Technical Validation Update

Submission status: Original Build Week artifact intentionally unchanged
Submitted public repository: Bome2017/replayguard-build-week
Submitted package version: ReplayGuard 0.1.0
Purpose of this note: Explain post-deadline validation work without altering the judged submission

Submission-integrity statement

The public Build Week repository has intentionally not been updated with later executable work.

After submissions closed, OpenAI Build Week instructed entrants not to change the submitted description, video, repository, or other project materials during judging. I therefore preserved the submitted repository as the exact artifact available at the deadline.

The work described below occurred afterward in separate local repositories and benchmark workspaces. It is not a replacement for the submitted project, and judges should evaluate the Build Week entry from the frozen public repository.

What the submitted Build Week version contains

The submitted public version is ReplayGuard 0.1.0, a developer tool for metamorphic regression testing of evidence-grounded AI systems.

It implements four controlled evidence transitions:

  1. Replace decisive support with declared equivalent support.
  2. Add plausible but non-dispositive distractor evidence.
  3. Remove decisive support.
  4. Remove all usable evidence.

ReplayGuard then checks whether the target system changes—or refuses to change—in the required way.

The submitted implementation includes:

  • typed YAML fixtures;
  • deterministic perturbation construction;
  • evidence-role and citation checks;
  • clean, brittle, invalid, and execution-error outcomes;
  • local deterministic targets;
  • a JSON HTTP target boundary;
  • optional GPT-5.6 semantic assessment;
  • machine-readable JSON reports;
  • standalone HTML reports;
  • CI-oriented process exit codes;
  • committed clean and intentionally brittle examples.

Why the submitted repository was not replaced

A later local implementation, ReplayGuard 0.3.0, contains corrected and expanded assurance functionality that did not exist in the submitted 0.1.0 code.

Pushing that implementation into the Build Week repository during judging would have changed the submitted executable artifact after the deadline. I therefore kept the public submission frozen rather than retroactively presenting later work as part of the competition entry.

The later implementation and benchmark results described below should be understood only as post-submission technical validation of the project direction.

Post-submission ReplayGuard version

The later implementation tested locally was:

  • Version: 0.3.0
  • Commit: fc680c5851852f0bef662d0eb81aa0f3051261e0
  • Source state: clean and independently frozen before comparison
  • ReplayGuard test suite: 124 passed
  • Clean fixture: exit 0
  • Intentionally brittle fixture: exit 1
  • Certificate creation: exit 0
  • Independent certificate check: exit 0

The later version adds capabilities not present in the submitted public 0.1.0 implementation:

  • corrected evidence-transition semantics;
  • exact fixture and response identity binding;
  • exact selected-subject binding;
  • certificate-v2 creation;
  • independent semantic certificate recomputation;
  • a type-distinct fail-closed downstream gate.

Expanded independent benchmark

A separate benchmark was created to test whether ReplayGuard merely passed its own examples or correctly implemented a broader evidence-transition contract.

Contract extraction

The frozen ReplayGuard source yielded:

  • 87 extracted rules
  • 82 gating rules

The original two fixtures exercised only part of that rule surface, so a broader corpus was constructed.

Independent semantic oracle

A separate semantic oracle was implemented without importing ReplayGuard, Promptfoo, or Giskard and without reading their verdicts.

Before it was allowed to judge the implementations:

  • 15 of 15 intentional oracle mutations were killed
  • passing controls remained accepted
  • an initially over-derived citation rule was detected and removed before the corpus freeze

This mattered because the oracle initially appeared to expose a ReplayGuard failure, but inspection showed the oracle had imposed a restriction absent from ReplayGuard’s frozen specification. ReplayGuard was correct in that case.

Corpus

The final primary corpus contained:

  • 24 development fixtures
  • 16 sealed holdout fixtures
  • 40 total fixtures
  • a holdout generated only after the comparator implementations were frozen

The holdout seed was derived deterministically from:

  • the frozen corpus commit;
  • the frozen comparator commit;
  • a fixed benchmark domain string.

No implementation was changed after holdout generation.

ReplayGuard result

ReplayGuard 0.3.0 matched the independent oracle on:

  • 24/24 development fixtures
  • 16/16 sealed holdout fixtures
  • 40/40 total fixtures

Observed results:

  • zero false positives;
  • zero false negatives;
  • zero fail-open cases;
  • zero invalid-versus-execution-error confusion;
  • semantic determinism across three full-corpus runs;
  • zero ReplayGuard source modifications.

Comparison with public alternatives

The same evidence-transition protocol was reconstructed independently in two public evaluation frameworks.

Promptfoo 0.121.20

Promptfoo ultimately matched the oracle on all 40 fixtures, but doing so required:

  • 1,094 cumulative lines of ReplayGuard-specific comparator code
  • external orchestration;
  • a custom provider;
  • custom assertions;
  • custom input and result handling.

Promptfoo exposed 69 assertion types in the inspected release, but none natively compared the outputs of two separate test executions.

Giskard OSS 2.19.2

Giskard ultimately matched the oracle on all 40 fixtures, but doing so required:

  • 958 cumulative lines of benchmark-specific comparator code
  • custom tests;
  • a custom model wrapper;
  • external orchestration;
  • custom input and result handling.

Giskard provided two useful native relational behaviors out of the 21 capabilities classified for the comparison, but its RAG metrics were pointwise rather than cross-execution relational checks.

Functions not reproduced by either comparator

Neither completed comparator reproduced:

  1. exact selected-subject binding;
  2. certificate-v2 semantic recomputation;
  3. the type-distinct fail-closed consequence gate.

Benchmark verdict

The benchmark’s frozen primary verdict was:

SEALED_PROTOCOL_CONFIRMED_REPLAYGUARD_ADVANTAGE

This verdict does not mean ReplayGuard was more accurate than the completed reconstructions. All three implementations matched the oracle on 40/40 fixtures.

The measured advantage was narrower:

  • ReplayGuard implemented the protocol without reconstruction.
  • Promptfoo and Giskard required substantial protocol-specific code.
  • Neither alternative supplied the complete protocol natively.
  • ReplayGuard retained three integrated assurance functions that neither comparator reproduced.

The supported technical conclusion is:

ReplayGuard is the more complete ready-made implementation of this exact tested evidence-transition assurance protocol than the tested Promptfoo and Giskard OSS versions.

Important limitations

The post-submission benchmark used retained deterministic target responses.

It did not:

  • call a live LLM;
  • test a production RAG deployment;
  • establish that ReplayGuard catches failures in a real operational system;
  • establish commercial demand;
  • establish superiority for evaluation tasks outside this protocol;
  • establish that no private equivalent exists.

The result establishes implementation correctness and comparative architectural differentiation for the frozen protocol.

Relationship to the Build Week submission

The Build Week judges should evaluate the original public 0.1.0 repository, video, description, and submitted evidence exactly as they existed at the deadline.

This post-submission work is disclosed only to provide transparent context:

  • the project continued to be developed separately;
  • the submitted repository was deliberately left unchanged to protect submission integrity;
  • later testing provided stronger evidence for the underlying technical approach;
  • none of the later code or benchmark results are being represented as pre-deadline submission work.

Log in or sign up for Devpost to join the conversation.