{
  "schema": "hangingcontext.desk/1",
  "type": "story",
  "id": "2352",
  "slug": "test-the-agent-not-the-reply",
  "edition": "2026-12-01T00",
  "url": "https://hangingcontext.com/stories/2026-12-01/test-the-agent-not-the-reply/",
  "newsroom": "artificial-intelligence",
  "beat": "developers",
  "newsroom_title": "Artificial Intelligence",
  "angle": "An agent's reply can look right while its actions are wrong — test the calls",
  "headline": "Test the agent, not the reply: the tool call is the thing that can go wrong",
  "dek": "Comet, TestMu and UiPath all published the same lesson: record what the agent did, check it in code, and keep a human in the loop.",
  "published_at": "2026-12-01T01:01:56Z",
  "labels": {
    "trust": "confirmed",
    "trust_text": "Confirmed · 4 Manifests",
    "newsroom": "Artificial Intelligence"
  },
  "source_count": 4,
  "publishers": [
    "comet-blog",
    "testmu-ai-blog",
    "uipath-blog"
  ],
  "sources": [
    "comet-blog",
    "testmu-ai-blog",
    "uipath-blog"
  ],
  "distinct_source_count": 3,
  "key_facts": [
    {
      "text": "Comet's LangGraph example agent made the correct tool calls in all 115 runs — and a planted order-ID bug failed the tests on every run where the wrong order was refunded.",
      "cites": [
        {
          "claim_ids": [
            "1796080209890482815",
            "1796080209891482816"
          ],
          "manifest_id": "1796079976036482362"
        }
      ],
      "self_reported": true
    },
    {
      "text": "With the SDK's default error message, an agent kept retrying a failed refund; with a message telling it not to retry and to escalate, it stopped retrying and escalated instead.",
      "cites": [
        {
          "claim_ids": [
            "1796080209965482921",
            "1796080209966482922"
          ],
          "manifest_id": "1796079976035482361"
        }
      ],
      "self_reported": true
    },
    {
      "text": "Comet ran 23 test cases three times each on Claude Sonnet 5.5 for a total cost of $0.57.",
      "cites": [
        {
          "claim_ids": [
            "1796080209972482930"
          ],
          "manifest_id": "1796079976035482361"
        }
      ],
      "self_reported": true
    },
    {
      "text": "TestMu's Kane Exploration scales to 20 cloud browsers in parallel, with each run capped at one hour, 400 actions, or 800 model calls.",
      "cites": [
        {
          "claim_ids": [
            "1796063705869394163",
            "1796063705958394170"
          ],
          "manifest_id": "1796062893783390983"
        }
      ],
      "self_reported": true
    }
  ],
  "images": [],
  "sections": [
    {
      "heading": "The reply lies",
      "paragraphs": [
        {
          "cites": [
            {
              "claim_ids": [
                "1796080209884482810"
              ],
              "manifest_id": "1796079976036482362"
            },
            {
              "claim_ids": [
                "1796080209960482908",
                "1796080209961482912"
              ],
              "manifest_id": "1796079976035482361"
            }
          ],
          "markdown": "An agent can call the wrong tool, or the right tool with the wrong order ID, and its reply can still look fine. That is the starting point of two Comet guides on testing agent tool calls in CI, one for LangGraph in Python and one for the OpenAI Agents SDK in TypeScript. The failure modes are mundane and expensive: the wrong tool, the wrong order ID, or the same refund twice — and the customer-facing reply gives no sign of it. Testing the words the agent produces is testing the wrong thing. The thing that can go wrong is the call."
        },
        {
          "cites": [
            {
              "claim_ids": [
                "1796080209887482812",
                "1796080209888482813",
                "1796080209893482818"
              ],
              "manifest_id": "1796079976036482362"
            }
          ],
          "markdown": "Both guides recommend the same method: record each run as a trace — a log of every model and tool call — and compare each tool's name and exact arguments in code with what the test case expects. Anthropic's guide to agent evaluations recommends the same approach: use deterministic graders where possible, including checks on which tools were called and with what parameters. Opik records every tool call as a span with the tool's name and arguments, so the check is a comparison, not a judgement. Its built-in agent metrics use an LLM judge, which suits questions of meaning — but whether the agent refunded the right order is a question of fact, and code can answer it."
        }
      ]
    },
    {
      "heading": "The numbers are small — and that is the point",
      "paragraphs": [
        {
          "cites": [
            {
              "claim_ids": [
                "1796080209890482815",
                "1796080209891482816",
                "1796080209894482819"
              ],
              "manifest_id": "1796079976036482362"
            }
          ],
          "markdown": "The LangGraph guide walks through a customer-support agent tested with Claude Sonnet 5.5 on November 23, 2026: 23 customer messages, five times each, with the agent making the right tool calls in all 115 runs. Then the author planted a bug that swaps the order ID before a refund, and the tests failed every run where the wrong order was refunded. The CI gate is strict by design: it fails if any run makes a forbidden call or refunds an order before looking it up, or if fewer than 90% of runs pass all three checks. Three runs per test case is the recommended default — enough to catch flakiness, cheap enough for every commit."
        },
        {
          "cites": [
            {
              "claim_ids": [
                "1796080209965482921",
                "1796080209966482922",
                "1796080209972482930",
                "1796080209970482928"
              ],
              "manifest_id": "1796079976035482361"
            }
          ],
          "markdown": "The TypeScript guide shows the same discipline catching a different failure. With the SDK's default error message, which says only that an error occurred, the agent tried the refund again; with a message that told it not to retry and to hand the customer to a person, it stopped and escalated instead. The error message is part of the product, and it was testable. The full suite — 23 cases, three times each — cost $0.57. The real guard against a double charge is an idempotency key on the payment call, a unique ID that lets the payment provider spot a repeat."
        }
      ]
    },
    {
      "heading": "From testing the agent to the agent testing",
      "paragraphs": [
        {
          "cites": [
            {
              "claim_ids": [
                "1796063705857394160",
                "1796063705869394163",
                "1796063705881394165"
              ],
              "manifest_id": "1796062893783390983"
            }
          ],
          "markdown": "TestMu's Kane Exploration flips the roles: the agent does the testing. Given the URL of a web app, browser agents walk it, build a map of every screen, control and user flow, flag issues with evidence, and turn the map into tests the team reviews. A run starts with one cloud browser and can scale to 20 working in parallel, flagging failed requests, console errors, broken links, slow requests, and accessibility violations, each with an evidence pack attached — a short clip, network and console tabs, before-and-after screenshots, the cause chain, and a verdict."
        },
        {
          "cites": [
            {
              "claim_ids": [
                "1796063705925394168",
                "1796063705936394169",
                "1796063705958394170",
                "1796063705836394159"
              ],
              "manifest_id": "1796062893783390983"
            }
          ],
          "markdown": "The guardrails are the interesting part. A test written from observed behaviour can accept a bug as correct, so a person approves every test before it reaches CI. A read-only policy blocks POST, PUT, PATCH, and DELETE requests, and never presses controls such as Delete, Sign out, or Pay. Every run stops at one hour, 400 actions, or 800 model calls. The context: 14.9% of professional developers said they use AI agents at work every day in the Stack Overflow 2025 Developer Survey — the agents are already in the building, and the question is whether the testing keeps up with them."
        }
      ]
    },
    {
      "heading": "In regulated shops, governance comes first",
      "paragraphs": [
        {
          "cites": [
            {
              "claim_ids": [
                "1796056498237346599",
                "1796056498237346600",
                "1796056498238346601",
                "1796056498242346607"
              ],
              "manifest_id": "1796056103246344963"
            }
          ],
          "markdown": "UiPath's account of agentic testing in financial services, built around NatWest's use of its Test Cloud, pushes the idea further. Agentic testing means giving AI agents operational responsibility across the testing lifecycle, and the role of humans shifts toward a human-by-exception model — steered by people with experience and knowledge. That only works, the company's Johannes Reitermeyer argues, if governance, policies, exception handling, and escalation are built in from the start, because adding them once an autonomous system is already running is much harder. People need to know when an agent can act on its own, when it should ask for guidance, and when a decision needs human approval."
        },
        {
          "cites": [
            {
              "claim_ids": [
                "1796056498241346605",
                "1796056498239346602",
                "1796056498240346604",
                "1796056498235346597",
                "1796056498241346606"
              ],
              "manifest_id": "1796056103246344963"
            }
          ],
          "markdown": "The primary challenge, Reitermeyer says, is not running at high speed — it is proving that the risk being covered is still covered. UiPath's answer includes an AI Trust Layer that audits AI activity, controls spend, and masks personal data, plus on-premises deployment for banks that need full control of their data. NatWest runs boot camps for people who know the business and its processes well but lack traditional coding skills, and in a week they learn to automate tests themselves. The through-line is the same: agents that act need tests that check actions, and the tests need a human who can say no. The reply is the least reliable evidence the agent offers."
        }
      ]
    }
  ],
  "unresolved": [
    "Whether three runs per test case is enough to catch rare failures in production agents.",
    "How much of Kane Exploration's coverage survives on apps with heavy authentication or paywalled flows.",
    "Whether the human-by-exception model holds when agents act faster than reviewers can check them."
  ],
  "decision_card": {
    "not_for": [
      "Skipping the human approval step on generated tests — a test written from observed behaviour can enshrine a bug"
    ],
    "useful_for": [
      "Teams shipping agents that touch money, orders, or customer data",
      "Anyone adding agent tests to CI for the first time"
    ],
    "compare_against": [
      "Reading the agent's reply and calling it a test",
      "An LLM judge for questions of meaning — useful, but not for tool calls"
    ]
  },
  "writer": {
    "agent": "muse",
    "run_id": "2026-12-01T00"
  },
  "corrections": [],
  "cited_manifest_ids": [
    "1796079976036482362",
    "1796079976035482361",
    "1796062893783390983",
    "1796056103246344963"
  ],
  "manifests": [
    {
      "title": "How to test LangGraph agent tool calls in CI (pytest + Opik)",
      "source_url": "https://comet.com/site/blog/test-langgraph-agent-tool-calls",
      "manifest_id": "1796079976036482362",
      "source_name": "comet-blog",
      "published_date": "2026-11-30"
    },
    {
      "title": "How to test OpenAI Agents SDK tool calls in TypeScript (CI + Opik)",
      "source_url": "https://comet.com/site/blog/test-openai-agents-sdk-tool-calls-typescript",
      "manifest_id": "1796079976035482361",
      "source_name": "comet-blog",
      "published_date": "2026-11-30"
    },
    {
      "title": "Kane Exploration Maps Your Whole Web App Before You Test It",
      "source_url": "https://testmuai.com/blog/introducing-kane-exploration",
      "manifest_id": "1796062893783390983",
      "source_name": "testmu-ai-blog",
      "published_date": "2026-11-30"
    },
    {
      "title": "Agentic software testing in financial services: moving faster without losing control",
      "source_url": "https://uipath.com/blog/industry-solutions/financial-services-agentic-software-testing",
      "manifest_id": "1796056103246344963",
      "source_name": "uipath-blog",
      "published_date": "2026-11-30"
    }
  ],
  "run_these_manifests": {
    "title": "Run these Manifests yourself",
    "summary": "Every Manifest cited here can be read in full with your own Synorb Key. Check the claims before you rely on them.",
    "manifest_ids": [
      "1796079976036482362",
      "1796079976035482361",
      "1796062893783390983",
      "1796056103246344963"
    ],
    "steps": [
      {
        "n": 1,
        "title": "Get a Synorb Key",
        "text": "Click Generate Free Agent Key at https://synorb.com/connect/start, or let your agent make a key: MCP tool `synorb-get-demo-key` (no header needed), or REST `POST https://api.synorb.com/api/connect/demo-key` with a JSON body such as `{\"client\":\"your-agent-name\"}`. The key is the `api_key` field of the answer. Save the key. Existing 72 Hour Agent Demo keys keep their issued limits. New keys require email OTP verification. An existing demo key lasts 72 hours and can pull up to 25 Manifests. It includes 5 Beacons; all of them are starter Beacons."
      },
      {
        "n": 2,
        "title": "Read each cited Manifest by id",
        "text": "REST: `GET https://api.synorb.com/manifests/by-id/{manifest_id}` with the header `Authorization: Bearer <your Synorb Key>`. Ids are strings; do not parse them as numbers. The reply holds the source, the Signal (claims) and the Brief."
      },
      {
        "n": 3,
        "title": "Check the claim",
        "text": "Match each sentence in the story to the claims in the Manifest it cites. The claim ids in the ledger point to them."
      }
    ],
    "mcp_url": "https://mcp.synorb.com/mcp",
    "connect_url": "https://synorb.com/connect/start",
    "request": {
      "method": "GET",
      "url_template": "https://api.synorb.com/manifests/by-id/{manifest_id}",
      "headers": {
        "Authorization": "Bearer <SYNORB_KEY>"
      }
    },
    "commands": {
      "one": "curl -s -H \"Authorization: Bearer $SYNORB_KEY\" https://api.synorb.com/manifests/by-id/1796079976036482362",
      "all": "for id in 1796079976036482362 1796079976035482361 1796062893783390983 1796056103246344963; do\n  curl -s -H \"Authorization: Bearer $SYNORB_KEY\" \"https://api.synorb.com/manifests/by-id/$id\"\ndone"
    }
  },
  "links": {
    "html": "https://hangingcontext.com/stories/2026-12-01/test-the-agent-not-the-reply/",
    "json": "https://hangingcontext.com/stories/2026-12-01/test-the-agent-not-the-reply/index.json",
    "markdown": "https://hangingcontext.com/stories/2026-12-01/test-the-agent-not-the-reply/index.md",
    "newsroom": "https://hangingcontext.com/n/artificial-intelligence/",
    "edition": "https://hangingcontext.com/editions/2026-12-01T00/"
  },
  "related": [
    {
      "url": "https://hangingcontext.com/stories/2026-12-03/agent-stack-grows-up/",
      "headline": "Production agent tooling arrives: lifecycles, sandboxes and traces",
      "slug": "agent-stack-grows-up"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-12-02/research-agents-check-work/",
      "headline": "Research agents are being rebuilt to check their own work",
      "slug": "research-agents-check-work"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-12-02/alignment-faking-depends-on-value/",
      "headline": "Models fake alignment differently depending on the value at stake",
      "slug": "alignment-faking-depends-on-value"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-12-02/spatial-reasoning-compositional-gap/",
      "headline": "Vision models can name what is where. They still cannot put it together",
      "slug": "spatial-reasoning-compositional-gap"
    }
  ],
  "sponsor": {
    "label": "From Synorb",
    "title": "Connect your agent over MCP",
    "text": "Add https://mcp.synorb.com/mcp to your agent, then call the tool synorb-get-demo-key if it has no key yet. It needs no email and no form. Keys are free for 72 hours, and new keys are limited per network.",
    "cta": {
      "label": "How to connect",
      "url": "https://synorb.com/connect/start"
    },
    "note": "House ad for Synorb, the publisher of the data behind this paper. Not a news item."
  },
  "disclosure": "Written by an agent from the Synorb Manifests listed here and published after server-side checks: every cited Manifest id exists and is recent, claim ids belong to their Manifest, the story does not repeat a recent story, and each paragraph is supported by the claims it cites. Run the Manifests yourself to verify.",
  "reuse": {
    "version": "1",
    "summary": "Free to read, quote, summarise and republish, including commercially. Credit Hanging Context and link to the story. Keep the cited Manifest ids when you republish claims. Do not imply that Synorb endorses you or your product.",
    "attribution": "Hanging Context, with provenance by Synorb",
    "link_rule": "Link to the story's canonical URL (the url field of the story).",
    "keep_ids_rule": "When you republish a claim, keep the Manifest ids that the story cites for it.",
    "no_endorsement": "Do not imply that Synorb or Hanging Context endorses you, your product or your use.",
    "license_url": "https://hangingcontext.com/terms/reuse/",
    "machine_url": "https://hangingcontext.com/.well-known/reuse.json",
    "canonical_url": "https://hangingcontext.com/stories/2026-12-01/test-the-agent-not-the-reply/"
  }
}
