See the failure coming.

Traza learns which paths your agents’ runs fail on, and flags a live run heading down one.

Start free
Prompt for your coding agent
Set up Traza Foresight for the agent in this repo. Traza Cloud's API is https://api.trazadb.com; the key is in TRAZA_API_KEY (a full key, to change fuses).

1. Export the agent's spans over OTLP/HTTP:
   OTEL_EXPORTER_OTLP_ENDPOINT=https://api.trazadb.com
   OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20$TRAZA_API_KEY"
   OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
   Put session.id on every span and gen_ai.agent.name on the first step, and set session.outcome to success, failure or abandoned when a run ends.
2. Once runs have completed, read the agent's Fate Map: GET https://api.trazadb.com/v1/fate/map?agent=<agent name> with the header "Authorization: Bearer $TRAZA_API_KEY". Read calibration.depths[].skill before trusting a verdict.
3. Add a predictive fuse: POST https://api.trazadb.com/v1/fuses/policies with {"name": "<agent name>", "match": {"service": "<service name>"}, "limits": {"min_success_odds": 0.3}, "action": "stop"}.
4. Before each tool call, POST https://api.trazadb.com/v1/fuses/check with {"run": "<session id>", "next": {"tool": "<tool name>"}}. When it answers "verdict": "stop", skip the call and show reasons[0].
   If the agent is Claude Code, use the engine's hook pack for this step instead: from a checkout of https://github.com/toshish/traza, run python3 examples/claude-code/install.py --url https://api.trazadb.com and set TRAZA_TOKEN to a read key.

Docs: https://www.trazadb.com/docs/foresight/

Fate Map of ci-fix Fate Map of ci-fix: 165 completed runs over the last 30 days, base rate 64%. Branch Bash, Read, Edit, Bash: 45 of 50 succeeded. Branch Bash, mcp__github__add_issue_comment: 20 of 30 succeeded. Branch Agent, test-investigator, Grep, Edit, Bash: 38 of 45 succeeded. Branch Bash×3-5: 3 of 40 succeeded; a fatal fork at Bash×3-5, against 82% for its siblings, Fisher p = 5.0 × 10⁻¹⁸. The run in flight live-ci-doomed-0 walks down the map: likely_failure. Before its next call, tool:Bash, the predictive fuse answers stop.
  1. llm:claude-sonnet-5-5 Bash llm:claude-sonnet-5-5 Read llm:claude-sonnet-5-5 Edit llm:claude-sonnet-5-5 Bash llm:claude-sonnet-5-5

    90%
  2. llm:claude-sonnet-5-5 Bash llm:claude-sonnet-5-5 add_issue_comment llm:claude-sonnet-5-5

    67%
  3. llm:claude-sonnet-5-5 Agent test-investigator llm:claude-haiku-5-5 Grep llm:claude-haiku-5-5 llm:claude-sonnet-5-5 Edit llm:claude-sonnet-5-5 Bash llm:claude-sonnet-5-5

    84%
  4. llm:claude-sonnet-5-5 Bash×3-5 stop llm:claude-sonnet-5-5

    8%

    fatal fork

likely_failure Runs that took this path succeeded 3 of 40 times.

Stop on the odds.

Set a floor on success odds, and when your agent asks before a step, Traza answers stop if the path’s best case is below it.

POST /v1/fuses/policies
{"name": "ci-fix", "match": {"service": "ci-fix"},
 "limits": {"min_success_odds": 0.3}, "action": "stop"}

Counted from your runs, never guessed.

Odds are counted from your own finished runs, with a 95% interval; a path with too little history gets no guess.

  • on_track The upper bound clears both 50% and the agent’s base rate.
  • at_risk The upper bound is below the agent’s base rate.
  • likely_failure The upper bound is below 50%: runs here mostly fail.
  • novel A step no earlier run took at this point.
  • insufficient_history Fewer than 30 earlier runs share the path. No guess.

Put your agent’s runs on the map.

Send spans with a session id and an agent name; say how each run ended.