Foresight on Traza Cloud
Foresight is the engine’s Fate Map and predictive fuses, running on your project’s cell. This page covers using them on Traza Cloud; how the numbers are computed is in How Foresight works and the engine’s Foresight guide, and the limits are at the end of this page.
What it needs from your spans
Foresight reads runs, so it needs what every run surface needs:
- A run id on every span:
session.id(or the OpenInference and Traceloop equivalents), else each trace is its own run. - An agent name:
gen_ai.agent.nameon the first step, else the service of the run’s earliest span. Runs are only compared with runs of the same agent in the same project. - Outcomes, ideally declared: set
session.outcometosuccess,failureorabandonedwhen a run ends. Without it, a run’s outcome is the status of the span that ended last.
A run with no declared outcome whose last span ended in the last 15 minutes is
still active: it is unknown, left out of every rate, and counted.
Look at the map
In the console, open a project and choose Open explorer: the engine’s own Foresight view draws the Fate Map of each agent. Across projects, the organization’s Foresight page lists every agent with its success rate over time, its top fatal forks with example runs, and the behaviours that are new this week.
Over the API, with a read or full key:
# Every agent with completed runs in the last 30 days, and its base rate
curl -s https://api.trazadb.com/v1/fate/cohorts \
-H "Authorization: Bearer $TRAZA_API_KEY"
# One agent's tree: every branch with its rate, 95% interval, cost and example runs
curl -s "https://api.trazadb.com/v1/fate/map?agent=support-agent" \
-H "Authorization: Bearer $TRAZA_API_KEY"
# How runs like this one ended, and what the ones that succeeded did next
curl -s https://api.trazadb.com/v1/fate/runs/sess-9c21 \
-H "Authorization: Bearer $TRAZA_API_KEY"
/v1/fate/map takes depth (default 12), min_support (default 3),
max_nodes, task, and since/until in Unix nanoseconds (default: the last
30 days). Read the map’s calibration.depths[].skill before trusting a
verdict: it is how much better than the agent’s average the map predicted
runs it was not built from, and near zero means the agent’s fate does not
depend on its path.
Stop runs heading for failure
Add min_success_odds to a fuse policy, with a full key:
curl -s https://api.trazadb.com/v1/fuses/policies \
-H "Authorization: Bearer $TRAZA_API_KEY" \
-d '{"name": "support", "match": {"service": "support-agent"},
"limits": {"min_success_odds": 0.7, "max_cost_usd": 2.0}, "action": "stop"}'
At the pre-call check (POST /v1/fuses/check), when a run’s foresight stands
on at least 30 earlier runs (foresight_min_support), the run has at least 3
steps (foresight_after_steps), and the upper bound of the 95% interval is
below the odds, the policy’s action applies. Name the next tool in the check
("next": {"tool": "issue_refund"}) and the path is judged with that step
appended. The upper bound is what is compared, so thin history stops nothing.
A foresight stop is a prediction made again at every check: it is not latched, it never rides on an ingest acknowledgement, and a reset does not clear it. To let a run go on against its history, reset it with a grant of lower odds:
curl -s -X POST https://api.trazadb.com/v1/fuses/runs/sess-9c21/reset \
-H "Authorization: Bearer $TRAZA_API_KEY" \
-d '{"grant": {"min_success_odds": 0.05}}'
Maps are built in the background and cached on the cell, so the first checks after a quiet spell, or after an erasure (which drops every cached map), see no foresight for a few seconds. Missing evidence is never treated as evidence of failure: the check answers without a foresight stop.
Be told
Mission Control shows each live run’s foresight verdict beside its guard
verdict. An alert rule can fire when a run’s foresight reaches
likely_failure, and deliver it as a push to your phone or an interactive
Slack message with Kill and Nudge… (a run that is not stopped has
nothing to approve); see Steer.
From your coding agent
With MCP connected (MCP), the foresee_run tool answers the same
question for a run, in words and numbers the server computed.
Limitations
- Correlation, not cause. A fatal fork says runs that went that way ended worse. The step may be a symptom rather than the cause: the fork tells you where to look, and its example runs are a success and a failure from the same point to diff.
- Paths ignore inputs. The same tools in the same order are the same path, whatever their arguments or prompts, so the map sees where a command ran, never what it does. A behaviour that differs only in content is invisible to it.
- Outcomes are inferred. Without a declared
session.outcome, the span that ended last decides how a run ended, so a run that failed but ended on a successful span reads as a success. Declare outcomes where you can. - New paths start without odds. A path needs earlier runs of its agent
before it has odds. Until then its verdict is
insufficient_historyornovel, and missing evidence is never treated as failure. - The cohort is the agent, whatever changed. A new prompt, model or tool
catalog mid-window mixes two behaviours in one map; narrow the window
(
since) to after the change. - Many nodes, some luck. No correction is made for how many nodes were
tested, so in a large tree an occasional fork is chance. The 25-point gap
and the support rule make that rarer, and every fork carries its
p_value. - Buckets blur an open step. A run on its fourth test run is pooled with
the
×3-5runs that stopped at three, as well as those that went on. - The fuse reads every run as live, so even an ended run has its last step
pooled;
/v1/fate/runs/{run}judges a completed run at its own node. - Bounded paths and builds. A path holds at most 64 tokens, read from a
run’s earliest 192 steps. A cohort map holds at most 20,000 completed runs
and a build 50,000 nodes; a build that meets a bound says so, and a path
into a cut branch gets
insufficient_history, never a guess. - Calibration is noisier than the map. It predicts each run from half the cohort, so a small cohort’s skill moves with the split.
- One process. Maps are cached per server; replicas build their own.
Every limit, with the reasoning, is in the engine guide’s Limitations.