SIRCA: Root Cause Attribution in LLM Agent Trajectories

SIRCA (Static Intervention for Root Cause Attribution, arXiv:2611.38588) isolates the exact originating failure steps in long LLM agent trajectories without re-executing tools or mutating live environments. By anchoring on negative user feedback, building an interstep error-propagation graph, and validating static repair proposals, SIRCA boosts Who&When accuracy by up to +36.59%.
SIRCA: Root Cause Attribution in LLM Agent Trajectories: SIRCA (Static Intervention for Root Cause Attribution, arXiv:2611.38588) isolates the exact originating failure steps in long LLM agent trajectories without re-executing tools or mutating live environments. By anchoring on negative user feedback, building an interstep error-propagation graph, and validating static repair proposals, SIRCA boosts Who&When accuracy by up to +36.59%. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Zero Live Replay Cost: Evaluates static counterfactual repair interventions directly on logged traces, avoiding side-effecting API re-runs.
- Feedback & Failure Anchoring: Grounds blame tracing on up to 5 validated negative user feedback messages or synthesized task-failure anchors.
- Propagation Graph Separation: Models interstep dependency (`delta_ipj`), error propagation (`eta_ipj`), and file-interaction edges to avoid blaming late symptoms.
- Benchmark-Leading Localization: Improves Who&When AG Exact Accuracy by +36.59% (51.59% with Gemini-3.8-Flash) and multi-root-cause recall by +32.52%.
import { createAgent } from '@smoke-monkey/harness';import * as fs from 'node:fs';// Capture structured Smoke Monkey trajectory events for SIRCA offline attributionconst traceEvents: Array<{ step: number; type: string; payload: unknown }> = [];const tracedAgent = createAgent({agentId: 'sirca-traced-worker',provider: 'deepseek',model: 'deepseek-chat',apiKey: process.env.DEEPSEEK_API_KEY,workspacePath: process.cwd(),permissions: { read_file: 'allow', write_file: 'ask', run_command: 'ask' },});tracedAgent.on('tool.call', (e) => {traceEvents.push({ step: traceEvents.length, type: 'tool_call', payload: e.data });});async function runAndExportTrace() {const res = await tracedAgent.run('Diagnose failing integration test in tests/auth.spec.ts');fs.writeFileSync('trajectory.json', JSON.stringify({ events: traceEvents, summary: res.summary }, null, 2));console.log('Saved structured trajectory for SIRCA static intervention analysis.');}runAndExportTrace().catch(console.error);
Watch: Related Video Guides
AI Observability in Production: Genie Code for Root Cause and Auto-Fix
How Uber's AI Agent Debugs Production Issues
What Is SIRCA? Replay-Free Trajectory Fault Localization
SIRCA (Static Intervention for Root Cause Attribution) is an open-source framework (github.com/lh1293151824-max/SIRCA) that locates originating failures in multi-step LLM agent logs without replaying live tools. It converts raw agent-user histories into attribution graphs anchored on negative feedback and validates candidate fault steps via static repair counterfactuals.
Standard step-by-step or all-at-once log analyzers often blame late trajectory steps where an error becomes obvious rather than the earlier step that corrupted a file or misread an observation. SIRCA separates origin from propagation: when relaxing exact step tolerance to ±1, baselines jump by 22.35 pp on Who&When AG while SIRCA shifts only 12.43 pp, proving tighter origin lock.
| Dataset / Backbone | Acc_step^exact | Acc_step^(±1) | Traj-F1 | Traj-R / Hit_step^any |
|---|---|---|---|---|
| Who&When AG (`DeepSeek-V4-Flash`) | 44.44% (`+36.59%` vs CHIEF) | 56.88% (+5.39% vs AAO) | — | — |
| Who&When AG (`Gemini-3.8-Flash`) | `51.59%` | `61.11%` | — | — |
| Who&When HC (`Kimi-K3`) | `31.03%` | 36.21% (41.38% Grok-4.6) | — | — |
| Wireless Agent (`50` Multi-Root-Cause) | — | — | `23.64%` (+9.58% rel) | `37.55%` (+32.52%) / `50.00%` |
Four-Stage Attribution Graph & Static Intervention Validation
SIRCA executes four deterministic-plus-LLM stages: (1) Trajectory Structuring merges each tool call with its first unmatched observation into sequence S_0..S_{N-1}; (2) Negative Feedback Anchoring validates up to K <= 5 user complaint records (or synthesizes an anchor from final failure metadata); (3) Feedback Graph Construction scores candidate role assessments A_ij, dependency strength delta_ipj, error propagation eta_ipj, and file-interaction edges; and (4) Static Intervention Validation tests whether proposing a static correction at candidate step S_k resolves the downstream error chain.
Adding explicit file-interaction edges is critical for coding agents: an agent may modify a config file at step 4 and only trigger a failing test observation at step 19.
Log Tool-Call + Observation Pairs and File Paths
To make agent traces SIRCA-compatible, ensure your observability logger records structured tool inputs, matched tool observations, and modified file paths in chronological step indices.
Reproducible SIRCA Setup & Trajectory Attribution Run
Clone the open-source SIRCA repository and wireless agent dataset to run static root-cause localization over Who&When or exported Smoke Monkey JSON trajectories.
# 1. Clone official SIRCA implementation and multi-root-cause dataset
git clone https://github.com/lh1293151824-max/SIRCA.git
cd SIRCA
pip install -r requirements.txt
# 2. Configure OpenAI-compatible judge endpoint (e.g. DeepSeek-V4-Flash or Gemini)
export OPENAI_API_KEY="$API_KEY"
# 3. Run root cause attribution on Who&When or custom JSON traces
python run_sirca.py \
--dataset who_and_when_ag \
--max-anchors 5 \
--enable-file-edges \
--static-interventionDebugging Multi-Turn Smoke Monkey Agents Without Re-Running Tools
Production coding agents in Smoke Monkey Harness frequently execute database migrations, git operations, or external API mutations that cannot be safely replayed during post-mortem debugging. Emitting chronological step logs via agent.on('tool.call', ...) lets engineering teams run SIRCA offline to pinpoint the exact bad prompt read, hallucinated parameter, or file edit behind a multi-step failure.
Frequently Asked Questions
Q:Why does SIRCA avoid replaying agent trajectories to find bugs?
Replaying multi-turn agent sessions is expensive, non-deterministic, and unsafe when tools modify files or call external APIs. SIRCA uses static intervention proposals over recorded logs instead.
Q:Does SIRCA work when a failed trajectory has no explicit user complaint?
Yes. When user feedback is absent, SIRCA automatically synthesizes an attribution anchor from task-failure information at the end of the trajectory.
Q:What makes SIRCA better than feeding the whole log into an LLM at once?
All-at-once and step-by-step baselines frequently confuse downstream symptom steps with the originating fault; SIRCA builds an explicit error-propagation graph (including file interactions) and validates candidate steps with static repair counterfactuals.
Q:Which datasets and models were used to validate SIRCA?
SIRCA was benchmarked on Who&When (126 Algorithm Generated and 58 Hand Crafted trajectories) and a 50-sample multi-root-cause Wireless Agent dataset across DeepSeek-V4-Flash, Gemini-3.8-Flash, Grok-4.6, GPT-5.6-sol, and Kimi-K3.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.