Using AI to Debug and Manage Complex AI Systems in Production

incident · Tech · 2026 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production AI incident investigation and debugging

Incident needed to debug and improve AI investigation systems whose agent, prompt, tool, and telemetry traces had become too large and nested for humans to inspect manually at production scale.

Constraints:

Architecture

Incident built AI-native internal tooling for AI-system debugging. Evals live as YAML beside Go code but are manipulated through an agent-friendly CLI and runbooks. Complex trace UIs can be exported as structured file systems that Claude Code can grep, navigate, and analyze. For scale, back tests download thousands of investigations into file trees, Scrapbook playbooks launch parallel agents, cluster failure cohorts, and connect trace findings back to code and eval-driven fixes.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  production-investigation-system["Production investigation system"] --> telemetry-sources["Telemetry sources"]
  production-investigation-system --> prompt-and-agent-hierarchy["Prompt and agent hierarchy"]
  production-investigation-system --> back-test-runner["Back test runner"]
  prompt-and-agent-hierarchy --> file-system-trace-export["File system trace export"]
  eval-yaml-suite["Eval YAML suite"] --> eval-cli["Eval CLI"]
  eval-cli --> coding-agent-runbooks["Coding agent runbooks"]
  file-system-trace-export --> coding-agent-runbooks
  back-test-runner --> scrapbook-analysis-pipeline["Scrapbook analysis pipeline"]
  file-system-trace-export --> scrapbook-analysis-pipeline
  coding-agent-runbooks --> scrapbook-analysis-pipeline
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Production investigation system Runs AI-powered incident investigations over telemetry, code, and historical incident data. Telemetry sources, Prompt and agent hierarchy, Back test runner
Telemetry sources Provide logs, metrics, traces, historical incidents, and customer codebase context. Production investigation system
Prompt and agent hierarchy Contains the nested agents, prompts, tools, and components powering investigations. Production investigation system, File system trace export
Eval YAML suite Stores prompt inputs, expected behavior, and AI grading criteria beside Go code. Eval CLI, Coding agent runbooks
Eval CLI Lets coding agents list, edit, replace, add, and run eval cases without loading huge YAML files into context. Eval YAML suite, Coding agent runbooks
File system trace export Turns UI trace/debugging content into self-documenting files for coding agents. Prompt and agent hierarchy, Coding agent runbooks, Scrapbook analysis pipeline
Coding agent runbooks Codify workflows for creating evals, modifying prompts, checking regressions, and proposing fixes. Eval CLI, File system trace export, Scrapbook analysis pipeline
Back test runner Runs batches of investigations to measure performance across accounts over time. Production investigation system, Scrapbook analysis pipeline
Scrapbook analysis pipeline Launches parallel agents, stores incremental analysis files, clusters cohorts, and proposes fixes. File system trace export, Coding agent runbooks, Back test runner

Data flow

A problematic production interaction or back-test batch is captured into eval YAML or a downloadable file system. A coding agent uses CLI commands and markdown runbooks to inspect prompts, inputs, outputs, traces, and source code; adds an eval proving the failure; changes the relevant prompt or code; runs regression checks; and, for back tests, aggregates investigation analyses into cohorts that point developers at recurring failure modes and candidate fixes.

3 supporting quotes
“Each eval consists of a prompt, input data, execution, and grading criteria that determines pass/fail status.”summary, stated
“For any AI system interaction, they can export the complete context including all prompts, inputs, outputs, and trace information as a file system”summary, stated
“These playbooks codify exactly how agents should process the downloaded information, understand investigations, and conduct systematic analysis.”summary, stated

Why this architecture

Incident made debugging artifacts file- and CLI-native because coding agents are much better at navigating textual file systems and command surfaces than web UIs or giant YAML blobs. The same representation supports individual trace debugging and large back-test analysis.

3 supporting quotes
“coding agents couldn't work with them effectively. Loading these files into context would hit context limits, preventing agents from modifying or enhancing the eval suite.”summary, stated
“Inspired by Anthropic's discovery with Claude Code that these agents excel at navigating and analyzing file systems using standard tools”summary, stated
“file systems provide exceptionally good context for agents.”summary, stated

Models used: Claude Code · AI grading models · Coding agents

Scale

Alternatives considered (roads not taken)

Let humans inspect all production investigation traces manually

Rejected because: Trace volume and complexity made manual analysis intractable.

“Humans lack sufficient time to thoroughly analyze the volume of interactions the system generates, and agents cannot effectively use web UIs to perform systematic analysis.”summary, stated

Expose only web debugging UIs

Rejected because: Agents work better with structured file systems than with UI-only traces.

“Incident built UI tools to help humans inspect these complex traces, but these UIs have fundamental limitations.”summary, stated
“bulk downloading information into file systems that coding agents can grep through and navigate with standard tools proved far more effective.”summary, stated

Use aggregate back-test metrics alone

Rejected because: High-level accuracy numbers did not explain why performance changed or how to fix customer-specific failures.

“such aggregate numbers provide limited insight into why performance improved or degraded, or how to improve the system for specific customers.”summary, stated

Patterns

eval-driven-development (evaluation)

Incident treats evals as unit tests and uses agents to create failing evals, modify prompts, run regressions, and validate fixes.

“Incident treats evals as AI unit tests. Each eval consists of a prompt, input data, execution, and grading criteria that determines pass/fail status.”summary, stated
“The agent then creates an eval case proving the failure exists, modifies the prompt to pass the eval, verifies that no other evals in the suite were broken”summary, stated

tool-use-orchestration (agent tooling)

Coding agents use CLI tools, file exports, eval commands, code navigation, and analysis runbooks as a debugging toolchain.

“This CLI provides simple commands to list test cases, edit them, replace them, or add new ones. By creating this agent-friendly interface, they enabled coding agents to work effectively with their evaluation infrastructure.”summary, stated
“Because the code base is also available in the session, the agent can trace through the system hierarchy and identify exactly which component needs modification. From there, developers can leverage the eval red-green cycle described earlier to make and validate changes.”summary, stated

multi-agent-orchestration (analysis)

Scrapbook runs many agents in parallel over investigation batches and then clusters their findings.

“they parallelize analysis by starting approximately 25 agents simultaneously, each building independent analysis of individual investigations.”summary, stated
“after individual analysis completes, the pipeline performs cohort clustering to identify patterns across investigations”summary, stated

context-engineering (agent context)

Incident converts UI state, prompts, inputs, outputs, traces, and code context into navigable file systems that agents can inspect with standard tools.

“Complex traces that would be presented visually in UIs translate effectively to text files that LLMs can consume and analyze.”summary, stated
“For any AI system interaction, they can export the complete context including all prompts, inputs, outputs, and trace information as a file system”summary, stated

durable-execution (analysis pipeline)

Long-running Scrapbook analyses persist intermediate files so they can resume if interrupted.

“all analysis is stored incrementally in files within the downloaded file system, enabling the pipeline to start and resume if interrupted.”summary, stated

Tradeoffs

Agent-native file exports

Chose Download traces and UI content as structured file systems over Keep trace inspection only inside web UIs.

Rationale: File systems let coding agents use grep, navigation, code context, and standard tools for systematic debugging.

“bulk downloading information into file systems that coding agents can grep through and navigate with standard tools proved far more effective.”summary, stated

Runbook-driven agent workflow

Chose Codify debugging and eval-modification workflows as skills/runbooks over Ask agents to improvise debugging steps.

Rationale: Runbooks constrain the agent loop from failure reproduction to prompt change and regression checks.

“They took this further by creating runbooks or skills for coding agents that codify the entire eval modification workflow.”summary, stated

Parallel agent back-test analysis

Chose Launch about 25 agents over individual investigations, then cluster findings over Have humans manually inspect thousands of investigations.

Rationale: Parallel analysis made high-volume investigation review feasible and produced actionable cohorts.

“This parallel processing dramatically accelerates analysis of large batches.”summary, stated

Gotchas (what bit them)

Realistic production evals became too large for agents to edit.

Root cause: Captured incident contexts produced multi-megabyte YAML files that exceeded useful context limits.

Resolution: Incident built an eval CLI with focused commands so agents could manipulate the suite without loading whole files.

“Production evals that captured realistic failure scenarios often included nearly entire incident contexts, resulting in multi-megabyte YAML files”summary, stated
“Their solution was to build a small CLI tool called "eval tool" designed specifically to enable agents to leverage their eval suite files.”summary, stated

Debugging UIs blocked systematic agent analysis.

Root cause: Web UIs were designed for human inspection, not agent navigation across large trace sets.

Resolution: Incident made UI content downloadable as structured file systems.

“Humans lack sufficient time to thoroughly analyze the volume of interactions the system generates, and agents cannot effectively use web UIs to perform systematic analysis.”summary, stated
“Incident implemented the ability to download all UI content as structured file systems.”summary, stated

Aggregate back-test metrics hid root causes.

Root cause: Overall accuracy numbers did not explain customer-specific or cohort-level failure patterns.

Resolution: Scrapbook analyzes individual investigations in parallel, then clusters failure cohorts.

“such aggregate numbers provide limited insight into why performance improved or degraded, or how to improve the system for specific customers.”summary, stated
“This clustering yields actionable insights beyond simple pass/fail metrics.”summary, stated

AI debugging tools can introduce recursive complexity.

Root cause: Meta-level AI tooling may itself require debugging and maintenance.

Resolution: Organizations adopting the pattern need to account for extra layers of tooling complexity and dependency risk.

“The solutions described are meta-level applications of AI to manage AI systems, which introduces recursive complexity.”summary, stated

Evaluation

Incident evaluates its AI investigation system through AI-unit-test evals, repeatability checks, back tests across accounts, aggregate RCA metrics, cohort clustering, and production validation of fixes.

Metrics: Pass/fail eval status · Repeatability of eval outcomes · Back-test RCA accuracy such as 86% · Cohort-level failure patterns · Production validation after deployment

3 supporting quotes
“They run thousands of investigations daily across hundreds of customer accounts through what they call "back tests,"”summary, stated
“These back tests produce high-level metrics like "86% accurate RCA on our account," but such aggregate numbers provide limited insight into why performance improved or degraded, or how to improve the system for specific customers.”summary, stated
“checking that it passes with acceptable repeatability, and confirming the change is ready to proceed.”summary, stated

Outcomes

The system supports AI investigations across hundreds of customer accounts, thousands of daily investigations, at least 10 agents, 50+ hierarchy components, and parallel analysis with about 25 agents.

3 supporting quotes
“This demonstrates the complete loop from automated problem detection through resolution.”summary, stated
“Third, whenever complex analysis is required, consider creating AI runbooks instead of expecting humans to perform the analysis manually. The speaker claims this saves literally days or weeks of engineering time.”summary, stated
“When AI systems become too complex for traditional debugging approaches, AI-powered internal tooling becomes not just helpful but necessary.”summary, stated