Stop grading your state machines like chatbots. Here is the engineering guide to agentic telemetry, trajectory analysis, and deterministic evaluation.
By Ashu Kumar
Published: 2026-04-21
URL: https://theagenticstack.substack.com/p/the-llm-as-a-judge-fallacy-how-to

Earlier this week, a reader left a fantastic comment on our post about the OpenAPI Spec Delusion. They asked a question that perfectly captures the current anxiety of engineering leaders who are moving past the prototype phase:
“In production, how do we measure if an agent is actually working? What metrics do you use? Is LLM-as-a-Judge enough?”
I gave a brief reply in the comments, but this question demands a flagship architectural breakdown. Because right now, the industry is suffering from a massive, collective Chatbot Hangover.
Thanks for reading! Subscribe for free to receive new posts and support my work.
For the last three years, we have been building conversational interfaces. If you build a chatbot, the output is unstructured text. And if the output is text, it makes logical sense to evaluate it heuristically. You take the chat transcript, feed it to an evaluator model like gpt-4o, and ask: “On a scale of 1 to 10, how polite, accurate, and helpful was this response?” This is the much-hyped “LLM-as-a-Judge” paradigm. It is the backbone of most AI evaluation frameworks today.
But we are not building chatbots anymore. We are building Agents.
Agents are autonomous digital workers. They execute multi-step workflows. They query and manipulate databases. They mutate production state. They spend enterprise money.
If your agent’s job is to deactivate a compromised user account, you cannot evaluate its success by asking another LLM if the agent’s final message was “helpful.” You must evaluate whether the account\_status in your PostgreSQL database successfully transitioned to LOCKED.
You cannot grade a state machine on its “tone.” You must grade it on its deterministic impact on your enterprise infrastructure.
In this deep dive, we will tear down the LLM-as-a-Judge fallacy and build a production-grade Agentic Telemetry and Evaluation pipeline based on the four true metrics of autonomous AI.
Chapter 1: The Fallacy of Semantic Evaluation
Let’s visualize the fundamental disconnect in how the industry currently evaluates agents.
Imagine you have built a “Refund Processing Agent.” A customer emails in, angry that their shipment arrived broken. The agent is supposed to look up the order, calculate a 50% partial refund, execute the Stripe API call, and email the customer.
If you use a standard LLM-as-a-Judge to evaluate this in your CI/CD pipeline, the Evaluator looks at the trace:
- User: “My vase is broken, I want a refund.”
- Agent (Internal Thought): I need to refund this user.
- Agent (Tool Call):
stripe\_refund(amount=50)-> Fails due to malformed API key.
- Agent (Output to User): “I am so sorry about the broken vase. I have successfully processed a $50 refund to your original payment method.”
The Evaluator LLM reads step 4, compares it to the user’s request, and proudly grades the execution a 10/10 for accuracy and helpfulness.
The LLM-as-a-Judge is a sycophant. It evaluates the string, entirely blind to the state.
The agent hallucinated a success. It lied to the user. No money was moved. But your evaluation dashboard is glowing green. If you deploy this to production, you will face an army of furious customers checking their bank statements three days later.
Evaluating an autonomous agent based on its conversational output is like evaluating a heart surgeon based on their handwriting. It measures a superficial artifact while completely ignoring the terminal objective.

Chapter 2: Metric 1 - Deterministic State Validation (Terminal Success)
If LLM-as-a-Judge is out, what replaces it? We return to hardcore software engineering: The Deterministic Assertion.
The first and most important metric for an agent is the Verifiable Terminal State (VTS). When testing an agent, we do not care what it says. We only care what it did to the underlying system.
To build this, you must treat your agents like integration tests. When you run an evaluation framework (offline in CI/CD, or shadow testing in production), your test suite must bypass the agent entirely and query the underlying infrastructure to verify success.
Here is the blueprint for how you engineer a Deterministic Agent Eval in Python using PyTest:
Python
import pytest from your_org.agents import RefundAgent from your_org.infrastructure import StripeSandboxDB @pytest.mark.asyncio async def test_agent_partial_refund_execution(): """ Evaluates the agent based on deterministic state mutation, NOT the semantic text output. """
# 1. Setup the initial deterministic state
test_user_id = "user_9981" initial_balance = StripeSandboxDB.get_balance(test_user_id) # e.g., $100.00
# 2. Execute the Agent
agent = RefundAgent() user_prompt = "My order #445 arrived slightly scratched. Can I get a partial refund?"
# We do not evaluate this text response!
agent_response = await agent.run(user_id=test_user_id, input=user_prompt)
# 3. The Verifiable Terminal State (VTS) Assertion
# We query the sandbox database to ensure the tool call actually fired
# and mutated the state correctly.
final_balance = StripeSandboxDB.get_balance(test_user_id)
# Assert the state changed by exactly 50% of the item cost ($25.00)
expected_balance = initial_balance - 25.00 assert final_balance == expected_balance, \ f"AGENT FAILURE: Agent claimed success, but DB state is {final_balance}. Expected {expected_balance}."
# 4. Assert the Audit Log (Ensuring no ghost execution)
audit_logs = StripeSandboxDB.get_audit_logs(test_user_id) assert "partial_refund_issued" in audit_logs[-1].action_type
Why this matters:
This test cannot be fooled by a hallucination. If the agent gets stuck in a loop, or hallucinates the right text but fails the API call, this test turns red. This is the only way to achieve true confidence in your CI/CD pipeline for autonomous systems.
Chapter 3: Metric 2 - Trajectory Efficiency (The Cost of Cognition)
Once your agent can reliably achieve the Verifiable Terminal State, you hit the second wall of production AI: The Token Hemorrhage.
Imagine two agents running the exact same task in LangGraph.
Agent Alpha:
- Step 1: Queries database for user ID.
- Step 2: Executes refund tool.
- Result: Success. (Time: 3 seconds. Cost: $0.01).
Agent Beta:
- Step 1: Queries database for user ID.
- Step 2: Tries to call Stripe, forgets the amount. Error!
- Step 3: Reads error, queries database again.
- Step 4: Tries to call Stripe, uses wrong enum. Error!
- Step 5: Reads error, finally calls Stripe correctly.
- Result: Success. (Time: 25 seconds. Cost: $0.15).
If you are using LLM-as-a-Judge, both agents get a “Pass.”
If you are using Deterministic State Validation (Metric 1), both agents get a “Pass” because the database was ultimately updated.
But Agent Beta is an infrastructure disaster. If you deploy Agent Beta to 10,000 customers, it will throttle your internal database with redundant queries, provide a terrible user experience due to latency, and cost 15x more to operate.
You must measure the Trajectory Efficiency, also known as the “Cost of Cognition.”
In your observability platform (like LangSmith, Datadog, or your custom telemetry database), you must track the Directed Acyclic Graph (DAG) path the agent took to solve the problem.
Your core Trajectory Metrics should include:
- Node Transition Count: The number of edges traversed in your LangGraph state machine. (Set a strict threshold, e.g.,
assert transitions <= 4).
- Tool Retry Rate: How many times the agent received a
400 Bad Requestfrom your Zero-Trust Sidecar and had to self-correct.
- Cumulative Token Burn: The total context window consumed for the session.
If an agent requires 8 internal reasoning steps and 4 API errors to stumble blindly into the correct solution, that is a failed evaluation, even if the terminal state is correct. You must fail the build and rewrite your system prompt or tool descriptions to be more deterministic.

Chapter 4: Metric 3 - Blast Radius (Silent Failure Tracking)
This metric directly complements our Shadow Mode deployment strategy.
In traditional software, functions are heavily isolated. In Agentic AI, LLMs are given access to a suite of tools, and their reasoning engine decides which tools to pull.
This introduces the risk of the Silent Collateral Failure.
What happens if your agent successfully calculates the refund, successfully hits the Stripe API, but gets confused during its thought process and also triggers the delete\user\billing\_profile() tool?
Your Metric 1 (Terminal Success) will pass! The refund went through. The user is happy today. But the user is silently broken in your system, and next month’s subscription renewal will fail.
You cannot evaluate agents merely by checking if they hit the target. You must evaluate the Blast Radius.
To do this, your telemetry and evaluation pipeline must include Compensation Monitors. When a test runs, your framework must snapshot the surrounding state before execution, and diff the state after execution.
Python
# The Blast Radius Evaluation
def test_agent_blast_radius(): pre_execution_snapshot = UserDB.get_full_profile(user_id) agent.run_refund_workflow() post_execution_snapshot = UserDB.get_full_profile(user_id)
# Check what changed
diff = generate_state_diff(pre_execution_snapshot, post_execution_snapshot)
# We expect 'wallet_balance' to change.
# If 'payment_methods' or 'account_status' changed, the agent went rogue.
allowed_mutations = ["wallet_balance", "last_contacted_date"] for changed_field in diff.keys(): assert changed_field in allowed_mutations, \ f"BLAST RADIUS FAILURE: Agent illegally mutated '{changed_field}'."
If your agent is touching data it wasn’t explicitly authorized to touch for that specific intent, it is acting non-deterministically.
Chapter 5: The Proper Role of LLM-as-a-Judge
By now, it sounds like I am advocating for the complete eradication of LLM-as-a-Judge. I am not. I am advocating for reassigning it to the correct architectural layer.
LLMs are terrible at verifying execution. But they are unparalleled at evaluating Intent and Semantic Routing.
In a robust multi-agent orchestrator, the very first step is routing the unstructured user input to the correct specialized agent (e.g., routing “I want my money back” to the Billing Agent and not the Tech Support Agent).
You should use an LLM-as-a-Judge to evaluate your Orchestrator’s routing accuracy!
You can run nightly evaluations feeding 1,000 historical support tickets through your orchestrator. You then use gpt-4o as a judge to evaluate: “Did the Orchestrator extract the correct JSON intent from this angry customer email?”
The Rule of Thumb for Evaluation:
- Use LLMs to evaluate Extraction and Routing (unstructured data to structured intent).
- Use Deterministic Code to evaluate Execution and State (structured intent to infrastructure mutation).
Chapter 6: The Executive Mandate: Measure the Machine, Not the Magic
Engineering teams are currently flying blind because they are staring at the wrong dashboards.
When your leadership asks, “How is our new Agent performing?” and your engineering team answers, “GPT-4 says its responses are 95% helpful!” — you have an organizational crisis. You are measuring the illusion of the agent, not its reality.
To safely scale autonomous systems in 2026, you must enforce strict, hardcore evaluation standards:
- Mandate Verifiable Terminal States: Stop evaluating chat strings. Query the database to prove the agent did the work.
- Track the Cost of Cognition: Punish agents in CI/CD that require infinite loops and excessive tool retries to find the answer.
- Monitor the Blast Radius: Ensure your agents aren’t destroying collateral data while successfully completing their primary task.
- Demote the LLM Judge: Use Evaluator LLMs strictly for intent classification, never for state verification.
The era of “vibes-based” AI development is over. If you want to build agents that mutate enterprise infrastructure, you must measure them with the exact same ruthless, deterministic telemetry you use for your payment gateways.
Stop reading the chat logs. Start asserting the state.
Over to you: How is your team currently running evaluations? Are you stuck in the “Chatbot Hangover” relying on LLM-as-a-Judge, or have you started writing deterministic state tests for your LangGraph DAGs? Drop your strategies in the comments below.
If you found this telemetry breakdown helpful, share it with your QA and DevOps teams before your next sprint planning. Subscribe to the Agentic Stack to keep up with production AI architecture.
Thanks for reading! Subscribe for free to receive new posts and support my work.