Your CI Quality Gate Is Always Green? Maybe It Can Never Turn Red

A CI quality gate that stayed green 12 times was never actually working—and that's worse than having no gate at all.
A developer discovered that a CI quality check for an LLM feature passed twelve times in a row—not because the feature was flawless, but because the prompt's own constraints made the targeted defect impossible to generate. The check never actually worked. The fix is surprisingly simple: place a "must-fail" test case next to every gate and run it every time. If it turns green, the gate itself is broken. When LLMs are involved, this practice upgrades from a good habit to a near-necessity—probabilistic outputs can't be validated by reading code alone, so you need to see the gate turn red at least once to trust it.
A Check That Can Never Fail
A developer shared a cautionary tale on Reddit: he had configured a quality check for an LLM feature in his CI (Continuous Integration) pipeline, and it came back green twelve runs in a row. He took this as a signal that the pipeline was working and the feature was stable — until one day he tried to deliberately make the check fail. He couldn't.
The root cause was almost darkly comic: the prompt itself contained a constraint that made the exact flaw the check was looking for impossible to generate. The checking code was fine, the logic was correct — it simply never had anything to catch. After twelve runs and $1.36 spent, someone finally thought to ask the most basic question: is it even possible for this check to fail?

Green Doesn't Mean Effective
This story hits a long-overlooked blind spot in testing and quality assurance: a check that always passes is functionally no different from a check that doesn't exist.
We tend to assume a green light means "the system was validated and everything is fine." But there's another explanation — the check was never capable of catching a problem in the first place. The assertion is written correctly, the gate is configured, the report looks clean, but the condition it's monitoring simply cannot trigger in the current environment. It looks like it's doing its job; it's actually just an expensive decoration.
What makes this worse is that this false sense of security compounds over time. Twelve consecutive green lights are more deceptive than one, because a continuous streak of passes lulls the team into complete complacency — until a real defect sneaks into production six months later.
The Fix Is Surprisingly Simple
The author's solution isn't clever engineering. It applies to any gate, not just LLM scenarios:
Next to every check, place a "must-fail" test case, and run it every time.
The logic is straightforward: if the test case that's supposed to fail turns green, the gate itself is broken. You'll catch the problem in that very run, not six months later during a production incident postmortem. The only cost is maintaining one extra test case.
This is essentially meta-testing — not just testing the subject under test, but testing whether the test itself is still alive. The idea is well-established in mature practices like mutation testing, which deliberately injects defects into code to see if the test suite catches them. The "must-fail" test case is the lightest-weight, lowest-cost version of that approach.
A note on mutation testing: Mutation testing is a mature technique for validating test adequacy, with roots going back to the 1970s. The core idea is to automatically inject small semantic changes into source code (called "mutants" — e.g., changing
>to>=, or+to-), then run the test suite to count how many mutants get "killed" (i.e., cause a test to fail). A surviving mutant indicates a coverage gap. The "must-fail" test case described here shares the same philosophy, but skips the complexity of automated mutant generation — the developer manually constructs a known-bad input as the lightest-weight "living documentation" that the gate is still alive. This practice is also known as "negative testing" or "sad path testing" in the industry. In safety-critical systems (medical, aviation software), it's often a mandatory certification requirement — yet it's routinely skipped in ordinary business development.
When Models Enter the Loop, the Problem Gets Worse
The author specifically notes that LLM involvement makes this problem significantly more dangerous.
For a deterministic assertion, you can read the code, reason about its behavior, and determine the conditions under which it passes or fails. But when the subject being checked is generated text, the reason it passes or fails isn't written in the code — it depends on the model's output, the prompt's constraints, and a host of factors you can't exhaustively reason through by static reading alone.
In other words, when dealing with LLM output, you can't look at the check's code to confirm it's still working effectively. The only reliable approach is to actually make it fail once, and see the red with your own eyes. This is exactly why the "must-fail" test case carries amplified value in AI quality engineering: in deterministic systems it's a good habit; in probabilistic systems it's close to essential.
A note on probabilistic vs. deterministic systems: These two paradigms differ fundamentally in testability — and this is one of the core challenges of LLM quality engineering. Traditional software functions produce identical output for identical input, and assertion validity can be inferred through static analysis or symbolic execution. Large language models, however, are influenced by temperature, sampling strategies, context windows, model version updates, and other sources of randomness. Even with an identical prompt, outputs can vary significantly across calls. This means a check that "catches defects today" may silently stop working after a model is quietly upgraded, or shift its behavior boundary due to a subtle wording change in the prompt. This is why the industry is converging on "evals as infrastructure" — evaluation systems for LLM features need to be version-controlled, continuously monitored, and periodically validated for effectiveness, just like production code.
Implications for AI Engineering Practice
This seemingly trivial war story actually touches on several critical issues in modern AI application development:
- The credibility of evaluations (evals) itself needs to be evaluated. As more teams build automated quality checks for LLM features, the eval system is becoming new infrastructure. But infrastructure that fails silently is far more harmful than any individual bug.
- Prompt constraints and quality checks can cancel each other out. When a prompt already prevents a certain class of defect, any check targeting that defect becomes meaningless — yet it keeps consuming compute and cost (even if just $1.36 per run, that adds up at production scale).
- Low-cost defenses beat complex tooling. The author openly maintains open-source tooling in this space, but emphasizes that the "must-fail" test case requires no tooling whatsoever — just one extra test case.
For any team running quality gates in their pipeline, this advice is worth acting on immediately: stop assuming green means safe. First confirm your gate is actually capable of turning red. A check that cannot fail is more dangerous than no check at all — because it makes you believe you're protected when you're not.
Related articles

Why Does the Tesla Roadster Need to Fly? A Deep Dive into Musk's Wild Demo
Tesla's Roadster launch showed wall-climbing, upside-down driving, and flying stunts—but The Vergecast notes the demo car may lack a battery, the Rocket version is invite-only and not street-legal, and the website terms don't guarantee delivery. After nine years of delays, why does this car still need to exist?

AI Is Not a Replacement: Human-AI Collaboration Through the Lens of Factory Root Cause Analysis
Starting from factory root cause analysis, this article explains how AI accelerates evidence chain construction rather than replacing human experts, exploring the pragmatic implementation logic and business value of 'AI supporting people rather than replacing them.'

AI Agent Decision Auditing: Building an Evidence Chain in Regulated Workflows
Starting from a Reddit discussion, this article analyzes three core issues in AI agent decision auditing within regulated workflows: what fields audit records should contain, how to handle feedback latency for erroneous decisions, and how to continuously calibrate LLM judge consistency with human judgment.