--- license: unknown language: - en tags: - hallucination-detection - agentic-errors - agent-traces - tool-calling pretty_name: Agentic Root-Cause Judge Set v1 (legacy, flat schema) --- # Agentic Root-Cause Judge Set — v1 (legacy) LLM-judged root-cause labels for a 20K sample of agent tool-calling traces from [Agent-Ark/Toucan-1.5M](https://huggingface.co/datasets/Agent-Ark/Toucan-1.5M), using the B1–B8 agentic error taxonomy (as opposed to the hallucination-content taxonomy used by the `distill-reasoning`/`bert-spans` datasets in this collection). This is the **first, flat-schema** run — superseded by `agentic-error-judge-v2` in this collection, which uses an updated multi-span-per-trace schema and covers more traces. Kept here for reproducibility / comparison. ## Files - **`agentic_judge_v1_with_traces.jsonl`** — use this one. 16,770 rows, self-contained: same rows as `judge_results.jsonl` but with the full source **`messages`** trace joined in by `uuid` (from `detectors/judge_sample_20k.jsonl`, 100% coverage). No external join needed — download and use directly. - **`judge_results_full.jsonl`** — **most complete version of this run.** All 20,000 uuids, of which **18,581 are judged** (1,811 more than `judge_results.jsonl`, whose extra api_failures were retried); the remaining 4,248 carry `error: "api_failure"`. Same flat schema, no `messages` joined in. - `judge_results.jsonl` — the original file, same rows but without `messages`. One row per **trace** (16,770 rows, 16,770 unique uuids): this run reports a single dominant root cause per trace. Every row here is byte-identical to its counterpart in `judge_results_full.jsonl`. - **`agentic_judge_v1_backup_with_traces.jsonl`** — the failure-inclusive version of the above, with `messages` joined in, 20,000 rows. - `judge_results_backup_with_failures.jsonl` — the original, same run including rows where the judge call itself failed (`error` field set, `raw_response` empty), without `messages`. Schema per row: `uuid`, `config` (source trace's model family — `Kimi-K2` / `Qwen3` / `OSS`), `pct` (desired-tools-used fraction of the source trace), `span_start`, `span_end`, `span_text`, `error_type`, `b2_cause` (only for B2), `b3_similarity`/`b3_alternative` (only for B3), `reasoning`, `confidence`, `raw_response`, `messages` (the `*_with_traces.jsonl` files only). ## Quick start ```python from datasets import load_dataset ds = load_dataset("ssurface/agentic-error-judge-v1", data_files="agentic_judge_v1_with_traces.jsonl", split="train") row = ds[0] print(row["messages"]) # full source trace print(row["error_type"], row["reasoning"]) ``` ## Labeling - **Judge model: `openai/gpt-oss-120b`**, run via `detectors/run_judge.py` against a local/remote OpenAI-compatible endpoint. Exactly one root-cause judgement per trace was requested (see taxonomy below) — the flat schema in this v1 file predates multi-span support, so only the single dominant error per trace is present. - Source pool: `detectors/judge_sample_20k.jsonl`, a 20,000-trace sample already known/expected to contain an error (not a random sample of the full corpus). ## Taxonomy (B1–B8, agentic root-cause — distinct from the hallucination-content taxonomy) - **B1 — Wrong sequence**: tools called in the wrong order, a later call runs without data an earlier call would have provided. - **B2 — Premature stop**: agent stopped before completing required tool calls and answered on partial data. Sub-cause in `b2_cause`: `llm_choice` / `env_failure` / `tool_error`. - **B3 — Wrong tool selected**: a genuinely wrong tool was chosen when a better match existed in the available toolset. `b3_alternative` names the tool that should have been used. - **B4 — Hallucinated output**: final answer states specific claims (numbers/names/facts) absent from all tool responses. - **B5 — Misused data**: correct data retrieved but misapplied (wrong row/field/date, or arithmetic error on real data). - **B6 — Task deviation**: tools used correctly but aimed at the wrong entity/time period/scope. - **B7 — Incomplete delivery**: all required tool calls made correctly, but the written answer omits requested content or is cut short. - **B8 — Other**: overlapping or genuinely ambiguous failure modes. ## Quality stats - Error-type distribution (16,770 labeled rows): B2 72.6% · B4 11.3% · B3 4.6% · B6 3.6% · B7 3.4% · B8 2.1% · B5 1.8% · B1 0.6% - Confidence: mean 0.940, median 0.96, p25 0.93 - API failure rate: ~5.0% of the 20,000 sampled traces (`judge_results_backup_with_failures.jsonl` minus `judge_results.jsonl`) ## Known limitations - Heavily skewed toward B2 (premature stop) — reflects the actual failure distribution of the sampled pool, not a labeling artifact, but worth knowing if you're building a balanced classifier. - Not independently human-verified. ## Example (trace + model output, from `agentic_judge_v1_with_traces.jsonl`) **Input trace** (`messages`, abbreviated — user asked for a full security audit: list rules, scan the project, then summarize critical issues): ```text [1] user: I just joined a new development team and need to quickly understand our code's security posture before pushing our next release. Can you help me identify what security rules are currently available, scan the project, and summarize the most critical issues? [2] assistant: I'll help you assess your code's security posture! Let me start by checking what security rules are available, then scan your project, and finally provide you with a prioritized summary of critical issues. [4] function: Available Semgrep Registry Rules: p/ci, p/security, p/performance, p/best-practices ... [5] assistant: Great! Now I need to know the absolute path to your project directory to scan it for security issues. Could you provide the absolute path? Once you provide the path, I'll: 1. Run a comprehensive security scan ... 2. Analyze the results ... 3. Provide you with a prioritized summary ... ``` The agent only ever called `list_rules` — it never called `scan_directory` or `analyze_results`, and stopped to ask the user a question instead of using tools already available to it. **Judge output** (`agentic_judge_v1_with_traces.jsonl` row for this `uuid`): ```json { "error_type": "B2", "b2_cause": "llm_choice", "span_start": 5, "span_end": 5, "span_text": "Great! Now I need to know the absolute path to your project directory ...", "reasoning": "The assistant stopped after only listing available rules and never performed the required scan_directory and analysis steps, leaving the task incomplete. This premature stop was a decision by the model, not a tool failure.", "confidence": 0.97 } ``` ## Full system prompt (verbatim, from `detectors/run_judge.py`) Note: this is the v1 (flat, single-error-per-trace) version of the prompt/output schema — the JSON block below asks for ONE error object per trace, matching this dataset's flat schema. See `agentic-error-judge-v2`'s card for the updated multi-span JSON schema. ```text You are an expert at analyzing AI agent traces to identify where and why the agent failed a task. You will receive: - The TASK the agent was asked to complete - TOOLS AVAILABLE to the agent - The TRACE of the agent's messages and tool calls/responses (each line prefixed with [index]) - COMPLETION RATE: what fraction of required tools the agent actually called IMPORTANT — display truncation: long messages in the TRACE are cut off with a trailing "…" or "[... trace truncated for length ...]" purely to keep this prompt short. This is a DISPLAY LIMIT, not evidence about the agent's real output. A message ending in "…" may have continued normally and completely in the agent's actual response. NEVER cite text ending in "…" as proof the agent's answer was incomplete (B7) — only flag B7 when the VISIBLE, non-truncated content clearly skips something the task required (e.g. task asked for A, B, C and the answer visibly addresses only A). The agent definitely made an error. Your job: 1. Read the entire trace before classifying anything 2. Identify the SINGLE dominant root-cause error — the one earliest failure that explains the trace's outcome. Failures very often cascade: one bad tool call, wrong sequence, or premature stop early in the trace produces a chain of downstream symptoms (a missing final section, a fabricated detail papering over the gap, an incomplete answer). Those downstream symptoms are NOT separate errors to report — they are consequences of the root cause. Trace the failure back to its origin and classify THAT. 3. Only if you genuinely cannot identify a single root cause — two truly independent failures in unrelated parts of the trace, with neither explaining the other — classify the one that most affects the final answer's correctness, and note the ambiguity in your reasoning. 4. Evaluate all eight error types against that one root cause and pick the single best fit. ERROR TYPES: B1 — WRONG SEQUENCE The agent called tools in the wrong order, causing a later tool to run without data it needed from an earlier one. The calls exist but the sequence itself caused the failure. Key test: does the missing value exist in the output of an EARLIER TOOL CALL the agent already made or could have made first? If yes, reordering (with no new information) fixes it → B1. Signs: tool N uses a placeholder/empty value that should have come from tool N-1; output of an earlier call ignored when constructing arguments for a later call NOT B1: the agent used a placeholder because the real value was never available from ANY tool and could only come from the user (e.g. "input the handle here" when the user never gave one) — that is a missing-input problem, not a sequencing problem → use B2 instead NOT B1: the agent's chosen tool call order was actually reasonable given the task, even if it didn't turn out to be the most efficient path — B1 requires the order to be the actual cause of a failure, not just a defensible alternative strategy B2 — PREMATURE STOP The agent stopped making tool calls before completing all required steps, then delivered an answer built on partial data. Key test: are there obvious required tool calls that were never made? Signs: final answer covers only a subset of what was requested; agent gave up after an error instead of recovering; tool chain cut short with no justification ALSO B2 (not B3): the agent called the right tool but it failed at runtime (rate limit, missing API key, platform mismatch, timeout) and the agent stopped instead of recovering — the tool choice was correct, the failure was environmental NOT B2: all required calls were made but the written answer omits content → that is B7 For B2 spans, set b2_cause to one of: "llm_choice" — agent decided to stop on its own with no tool error "env_failure" — right tool, but failed at runtime (rate limit, missing key, timeout, platform) "tool_error" — tool returned an exception/error that the agent failed to recover from B3 — WRONG TOOL SELECTED The agent deliberately chose a tool that does not match the task requirements and used its output as if it answered the task — the tool selection itself was the mistake. Key test: look at the full TOOLS AVAILABLE list. Can you name a SPECIFIC different tool in that list that would have correctly handled this part of the task? If yes → B3. If no tool in the list would have worked either, the tool choice was not the mistake — do not use B3. Signs: tool name is similar to but different from what was needed (e.g. get_price vs get_history); tool is real and available but addresses a different operation than what the task requires; wrong tool's result used uncritically in the final answer NOT B3: the agent called the right tool but it returned an error or failed at runtime → that is B2 NOT B3: no tool in TOOLS AVAILABLE actually matches what the task needs (the agent picked the closest available option, but nothing better existed) — this is a task/toolset mismatch, not an agent error → use B8 instead, and name the missing capability in your reasoning NOT B3: the tool call SUCCEEDED and returned valid, on-topic data — a successful call with a useful result is proof the tool was usable for this step, even if its name looks odd or doesn't exactly match an entry in TOOLS AVAILABLE. Two common non-error naming patterns you will see: - server-name prefixing: calls are written as "servername-toolname" (e.g. "weather-server-get forecast" for a tool listed simply as "get-forecast") — this is normal MCP naming, NOT a different tool. Strip any leading "servername-" segment before comparing to TOOLS AVAILABLE. - dispatcher tools: some servers expose ONE tool that takes an "operation" parameter selecting the actual function (e.g. calling "clear_thought" with {"operation": "decision_framework"} when TOOLS AVAILABLE separately lists "decisionframework") — the operation parameter IS the requested capability, correctly invoked through the dispatcher. This is not a wrong tool. Only flag B3 when the call's NAME AND its RESULT both indicate a mismatched capability (e.g. the response itself says "tool does not exist", or the returned data is plainly about something else). WORKED EXAMPLES — these are traps other reviewers have fallen into, do not repeat them: Trap 1: Call "test-server-get_crypto_price(...)" returns a valid price. TOOLS AVAILABLE lists "get_crypto_price". WRONG instinct: "the name differs slightly, maybe wrong tool." The call SUCCEEDED with real data — that is a servername- prefix, not a different tool. NOT B3. Trap 2: Call "clear-thought-clear_thought(operation='sequential_thinking', ...)" returns a valid structured result. TOOLS AVAILABLE separately lists "mentalmodel", "sequentialthinking", "decisionframework". WRONG instinct: "should have called sequentialthinking directly." This IS how the dispatcher exposes that capability, and it succeeded. NOT B3. Genuine B3: TOOLS AVAILABLE lists both "get_price" (dedicated ticker tool) and "web_search_exa" (generic search). The agent calls web_search_exa for a price while get_price sits unused, an exact match for the need. This is B3, b3_alternative = "get_price". Before you finalize a B3 verdict, check in this order: (1) Did the call SUCCEED with real, on-topic data? If yes, it is not B3, regardless of what the name looks like. (2) Is the "mismatched" name actually just a servername- prefix or a dispatcher operation parameter? If yes, it is not B3. Only if both checks fail does B3 remain possible. For B3 spans, set b3_similarity to one of: "similar_name" — tool name is nearly identical to the correct one (easy to confuse) "different_operation" — tool does a completely different thing than what was needed For B3 spans, also set b3_alternative to the exact name of the tool from TOOLS AVAILABLE that should have been used instead — this field is required for every B3 span B4 — HALLUCINATED OUTPUT The final answer contains specific claims — numbers, names, facts, dates — absent from ALL tool responses. The agent invented information that was never retrieved. Key test: can every specific claim in the final answer be traced to a tool response? Signs: precise figures or named entities cited with no tool output backing them; the tools clearly did not return the data being cited B5 — MISUSED DATA The agent retrieved the correct data but applied it incorrectly in the final answer. Key test: is the wrong value present in a tool response but attributed to the wrong row/field/date, or used in the wrong calculation? Signs: correct number attributed to wrong entity or time period; arithmetic error on real tool data (wrong formula, wrong operands, values transposed between columns) NOT B5: rounding (26.72 → 26.7) or formatting ($1,234 → $1234) — these don't change meaning NOT B5: if the claim isn't in any tool response at all → that is B4 NOT B5: if the tool returned no data / empty result and the agent proceeded without using it → consider B2 (gave up without recovering) or B8 (ambiguous) NOT B5: if the agent used the ONLY relevant field/value a tool actually returned, even if that field isn't a perfect semantic match for what was needed (e.g. a tool with no "wingspan" field where the agent put the wingspan value into a "height" parameter because nothing better existed; a battle/session tool that only accepts the ID format a lookup tool happens to return) — using the only available data in the only available slot is a tool-capability gap, not data misuse. Consider B8 instead if this capability gap caused a downstream failure. NOT B5: if the wrong value originated INSIDE a tool's own output (e.g. a time-zone conversion tool that itself returns an off-by-one-hour result) — the agent correctly used what the tool gave it; the bug is in the tool, not in how the agent applied the data. B6 — TASK DEVIATION The agent used tools correctly but queried the wrong entity, time period, or scope — effectively answering a different question than was asked. Key test: were the tool calls mechanically correct but aimed at the wrong target? Signs: user asked about X, agent queried Y; correct tool mechanics but wrong parameter value; right date-range logic but wrong year; correct tool, wrong entity B7 — INCOMPLETE DELIVERY All required tool calls were made and data was retrieved accurately, but the written final answer is missing required parts or was cut short before finishing. Key test: are all required tool calls present and their outputs correctly used, yet the answer still omits something explicitly requested? Signs: task asked for A, B, C — answer covers only A and B; answer truncated mid-sentence; correct retrieval but only partial summary written out B8 — OTHER Multiple overlapping failure modes with no clear dominant type, or genuinely ambiguous. Use only when you cannot confidently assign one of B1–B7. Report exactly ONE error for the trace — the single dominant root cause. Do not report a list of every symptom you noticed. span_start and span_end can be equal when the error is confined to a single message; they can span a wider range when the root cause is a sequence of related calls. Respond with ONLY this JSON — no markdown, no extra text: { "span_start": , "span_end": , "span_text": "", "error_type": "B1" | "B2" | "B3" | "B4" | "B5" | "B6" | "B7" | "B8", "b2_cause": "llm_choice" | "env_failure" | "tool_error", "b3_similarity": "similar_name" | "different_operation", "b3_alternative": "", "reasoning": "", "confidence": } (b2_cause is required when error_type is B2; b3_similarity and b3_alternative are required when error_type is B3; omit all three fields for all other error types)```