惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
S
Securelist
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tor Project blog
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
Scott Helme
Scott Helme
Project Zero
Project Zero
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News | PayPal Newsroom
博客园_首页
Cyberwarzone
Cyberwarzone
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
Security Latest
Security Latest
V
V2EX
AI
AI
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
W
WeLiveSecurity
Jina AI
Jina AI
博客园 - Franky
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
PCI Perspectives
PCI Perspectives
Help Net Security
Help Net Security
V2EX - 技术
V2EX - 技术
月光博客
月光博客
博客园 - 司徒正美
Schneier on Security
Schneier on Security
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
I
Intezer
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
P
Privacy International News Feed
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
雷峰网
雷峰网
A
Arctic Wolf
L
LangChain Blog
罗磊的独立博客

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Fallacies of GenAI Development #3: You Can Verify AI Output With Another AI
Bala Paranj · 2026-06-01 · via DEV Community

This is the third in a series of eight posts on the false assumptions teams make when building with generative AI. Fallacy #1 covered why faster generation doesn't mean faster engineering. Fallacy #2 covered why plausible isn't correct. This post covers why using one AI to check another doesn't solve the problem — it doubles it.


The Fallacy

"If the AI makes mistakes, use another AI to check its work."

Huang et al. (ICLR 2024) showed that LLMs cannot reliably self-correct their reasoning without external feedback, and in some cases self-correction makes the output worse. LLM-as-judge is a special case of this: the same class of system evaluating its own output using the same reasoning that produced the errors. Formal verifiers, schema validators, and dissimilar reasoning engines provide the external feedback the paper says is required.

Why it's tempting

The logic feels airtight. You wouldn't trust a single developer to ship code without review. So you add a reviewer. In AI systems, the reviewer is another AI — a guardrail, a grader, an LLM-as-judge. The first AI generates. The second AI checks. Two opinions are better than one.

The industry has formalized this into named patterns:

  • Guardrails on input: An LLM checks whether the user's prompt is safe before the main LLM processes it.
  • Guardrails on output: An LLM checks whether the main LLM's response is appropriate before the user sees it.
  • LLM-as-judge: A grader LLM scores the quality of the main LLM's output against a rubric.
  • AI code review: An LLM reviews AI-generated code for bugs, security issues, and style.

Each pattern adds a layer of verification. Each layer is another LLM call. The architecture looks like defense in depth.

Why it's wrong

The verifier has the same failure modes as the thing it's verifying.

An LLM checking another LLM's output for hallucination can itself hallucinate. An LLM checking for prompt injection can itself be prompt-injected. An LLM reviewing code for security vulnerabilities can miss the same subtle patterns the generating LLM introduced — because both are doing the same thing: pattern matching on text.

This is not defense in depth. Defense in depth requires each layer to have DIFFERENT failure modes. A firewall and an intrusion detection system provide defense in depth because they fail differently. The firewall fails on novel protocols, the IDS fails on encrypted payloads. Neither failure mode overlaps with the other.

Two LLMs have OVERLAPPING failure modes. Both hallucinate. Both are gullible to adversarial inputs. Both miss mathematical properties that are invisible in the text. Both confuse plausibility with correctness. Adding a second LLM doesn't eliminate the failure mode. It adds another instance of it.

The math of stacked probabilities

If your generating LLM is 95% reliable and your guardrail LLM is 95% reliable, the combined reliability is NOT 99.75% (as it would be with independent failure modes). It's somewhere closer to 95% — because the failure modes are correlated. The cases where the generator fails are disproportionately the cases where the guardrail also fails, because both struggle with the same category of hard inputs.

The inputs that fool one LLM are often the inputs that fool the other. A policy that's mathematically equivalent to Principal: * through complex condition logic fools the generator (it doesn't understand the math) and fools the guardrail (it also doesn't understand the math). A prompt injection disguised as a legitimate system instruction bypasses the input guardrail for the same reason it would bypass the main model — both process it as plausible text.

The prompt injection example

This makes the problem concrete. The Fowler/Subramaniam GenAI patterns article recommends guardrails on input to prevent prompt injection. The architecture:

User prompt → Guardrail LLM ("is this safe?") → Main LLM → Response

The guardrail LLM reads the user's prompt and decides whether it contains an injection attempt. But the guardrail is ALSO an LLM processing text. A sufficiently clever injection that reads as legitimate to one LLM will read as legitimate to the other — because both are doing the same kind of text pattern matching.

Now consider the alternative architecture. Instead of a free-text prompt surface, expose typed RPC methods:

Agent calls: search(query="s3 buckets", scope="production")
Agent calls: verify(property="no_public_access", resource="arn:aws:s3:::data")
Agent calls: compliance(framework="hipaa", account="prod-account")

There's no prompt to inject into. The agent calls typed methods that accept typed parameters and return structured data. The guard isn't another LLM, it's the type system. The attack surface doesn't exist because the architecture doesn't have a free-text channel.

Prompt injection isn't mitigated. It's structurally unreachable. The architecture doesn't have the surface for the attack to exist.

The pattern across nine Fowler mitigations

This isn't just about prompt injection. Every reactive GenAI pattern shares the same structural limitation:

Reactive pattern What it does Why it doesn't converge on reliability
RAG Provides context to reduce hallucination The LLM can still ignore the context
Input guardrails LLM checks if the input is safe The guardrail LLM has the same gullibility
Output guardrails LLM checks if the output is appropriate The guardrail LLM has the same blind spots
LLM-as-judge LLM scores output quality The judge LLM has the same hallucination risk
Query rewriting LLM improves the user's query The rewriting LLM can make the query worse
Reranking LLM rescores retrieved documents The reranker LLM has the same relevance errors
Fine-tuning Retrain the model on domain data The fine-tuned model still hallucinates
Evals LLM scores output against rubrics The eval LLM has probabilistic accuracy
AI code review LLM reviews code for bugs The reviewer LLM misses the same edge cases

Each pattern wraps a non-deterministic system with another non-deterministic layer. Each layer adds cost and latency. None makes the underlying unreliability structurally unreachable. They reduce the probability of failure. They don't eliminate the failure mode.

The boom

Teams that rely on AI-to-verify-AI hit a specific wall: the recursive hallucination.

Month 1: The team deploys an LLM guardrail to check AI-generated IAM policies before deployment. The guardrail catches obvious issues — wildcard principals, missing conditions. Leadership is satisfied. We have AI reviewing AI.

Month 3: A subtle policy change passes both the generator and the guardrail. The policy's condition blocks, evaluated together, are mathematically equivalent to Principal: *. Neither LLM understands the math. Both pattern-matched the text. The text looks restrictive. The math isn't.

Month 4: The incident. A public access path exists through the policy composition. Data is exposed.

Month 4, the post-mortem: "Why did the guardrail miss this?" Because the guardrail reads policy TEXT the same way the generator writes policy TEXT. It checked whether the text LOOKED like it restricted access. It didn't check whether the LOGIC restricted access. You didn't have two independent checks. You had two mirrors reflecting the same error back at each other.

Month 5, the response: The team adds a THIRD LLM to review the guardrail's decisions. The recursive hallucination deepens. The cost triples. The latency triples. The correlated failure mode remains. The next incident will be a different policy composition that all three LLMs approve because all three pattern-match text, not logic.

The recursive hallucination is the AI verification equivalent of an infinite loop. Each iteration adds cost without adding reliability, because each layer fails on the same category of inputs.

What deterministic verification looks like

The alternative isn't better AI verification. It's verification that doesn't use AI at all for the properties that can be checked mechanically.

Probabilistic (LLM-as-judge):
    "Does this code violate the security policy?"
    → Depends on the grader's interpretation
    → Run it twice, might get different answers
    → Misses mathematical equivalences invisible in text

Deterministic (mechanical check):
    "Does this configuration expose a public endpoint without authentication?"
    → Yes or no. Every time. Same input, same output.
    → Computed over the actual state, not over the text description
    → Catches mathematical equivalences because it evaluates logic, not text

Deterministic verification has specific tools at each level of sophistication:

Type checking. The compiler verifies type contracts. If the AI generates code that violates a type signature, the compiler catches it — instantly, deterministically, with zero LLM calls. This is verification at the speed of code generation with zero probability of false negatives for the properties types can express.

Contract testing. Tools like Pact and Dredd verify that an API implementation matches its OpenAPI specification. Every endpoint, every field, every response code — checked mechanically against the declared contract. The specification is the source of truth. The implementation either matches or it doesn't.

Property-based testing. Tools like QuickCheck and Hypothesis verify that a property holds across thousands of randomly generated inputs. Not "does this specific input produce this specific output?" but "does this property hold for ALL inputs the tool can generate?" One level of abstraction higher than example-based testing. One level closer to proof.

Static analysis. Tools like Semgrep, SonarQube, and Checkov check structural properties of the code without running it. "Does any code path reach a database query with unsanitized user input?" "Does this Terraform plan create a public S3 bucket?" Checked across the entire codebase or infrastructure definition, mechanically, on every commit.

Formal verification. Tools like Z3, Dafny, and Lean prove properties mathematically across ALL possible inputs. "Does there exist any request that this policy allows from a public principal?" If the solver says UNSAT, no such request exists — proved, not tested. AWS uses this (Zelkova) to verify IAM policies billions of times per day.

Each tool is deterministic. Each produces the same answer for the same input every time. Each catches a category of errors that LLM-as-judge cannot — because the errors are mathematical, not textual.

When to use which

Not every property can be verified deterministically. The decision tree:

Can the property be expressed as a type constraint?
    → YES: Use the type system. Cheapest. Fastest. Already deployed.

Can the property be expressed as a contract (API spec, schema)?
    → YES: Use contract testing. Mechanical. Deterministic.

Can the property be expressed as "for all inputs, X holds"?
    → YES: Use property-based testing. Thousands of random inputs.
           Or formal verification for mathematical proof.

Can the property be expressed as a structural pattern in code?
    → YES: Use static analysis. No runtime needed. Every commit.

Is the property about tone, style, user experience, or subjective quality?
    → YES: Use LLM-as-judge. This is the ONLY category where
           probabilistic verification is appropriate — because the
           property itself is subjective.

LLM-as-judge is appropriate for subjective properties. It's inappropriate for properties that have deterministic answers. Using an LLM to check whether code violates a type contract is like using a language model to check whether 2 + 2 = 4. You could. But the calculator is faster, cheaper, and never wrong.

The principle: match the verifier to the property

The resolution isn't never use AI for verification. It's use the right verification method for each property.

Subjective properties    → LLM-as-judge (probabilistic, appropriate)
    "Is this response helpful?"
    "Is this code well-styled?"
    "Is this documentation clear?"

Structural properties    → Static analysis (deterministic)
    "Does this code path sanitize user input?"
    "Does this function handle the error case?"

Contract properties      → Contract testing (deterministic)
    "Does this API match its specification?"
    "Does this response include all required fields?"

Universal properties     → Property-based testing / formal verification (deterministic)
    "Can any unauthorized principal access this resource?"
    "Does the balance ever go negative for valid transactions?"
    "Does there exist any input that causes this function to hang?"

Most properties in a security-critical, financially-critical, or data-integrity-critical system are NOT subjective. They have deterministic answers. Verifying them with an LLM is using the wrong tool — because a better tool exists for that specific category.

The teams that emerge from the trough of disillusionment fastest will be the ones that stop using AI to verify everything and start matching each property to the verification method that works for it. Subjective? LLM. Everything else? Mechanical.

What you can do this week

1. Audit your current AI verification stack. List every place you use an LLM to check another LLM's output. For each one, ask: is the property being checked subjective or deterministic? If it's deterministic, you're using the wrong tool.

2. Replace one probabilistic check with a deterministic one. If you have an LLM reviewing code for "does it match the API spec" — replace it with a contract test. If you have an LLM checking "is the output valid JSON" — replace it with a schema validator. One replacement. This week.

3. Measure the difference. How many violations did the deterministic check catch that the LLM missed? How much faster does it run? How much cheaper is it? The numbers will make the case for replacing the rest.

The LLM is a remarkable tool. Use it where it's good at: subjective judgment, creative generation, natural language understanding. Don't use it as a calculator. Don't use it as a type checker. Don't use it as a theorem prover. Those tools already exist. They're faster, cheaper, and they never hallucinate.


Next in the series: **Fallacy #4 — "Dropping Human Review Removes the Bottleneck."* Why removing a gate without replacing it isn't optimization — it's removing the brakes. Three models of review, and why the third one is the only one that works at AI speed.*

The Fallacies of GenAI Development: eight assumptions every team is making. Each one leads to an architectural failure. Each one has already been solved.