Practical technical guides / Agent-era architecture

Join Agent Decisions to Later Case Outcomes Before Claiming They Help

Decision records, closed attribution windows and a randomized holdout: why a naive reopen-rate comparison credits an agent with a difference it did not cause.

By Sandeep Belgavi · Published 2026-11-22

Decision records, closed attribution windows and a randomized holdout: why a naive reopen-rate comparison credits an agent with a difference it did not cause.

The dashboard that says the agent works

A team adds an agent that resolves simple help-desk cases at the fictional Belgavi's Book Store: wrong delivery address, a missing invoice, a refund for a book that arrived damaged. A month later the dashboard shows that cases the agent resolved are reopened 8.6 percent of the time, against 19.4 percent for cases handled by people. The obvious reading is that the agent more than halves reopens.

That reading is probably wrong, and nothing in the agent's traces can tell you. The agent was only offered easy cases. People handled everything else, including every hard case. A trace records what the agent did and why; it does not record what would have happened otherwise, and it usually does not record what happened a week later. To claim that an agent step helps, you need two more things in the architecture: a decision record that can be joined to a later business outcome, and a comparison group that differs from the agent's cases only in who handled them.

This guide builds both with synthetic data and shows how much the answer changes.

A decision record is not a trace

Observability for agents usually means traces: model calls, tool calls, latencies and token counts. Those answer "what happened in this run". An outcome question is different: "did the cases this policy handled end better?" It needs a record designed to be joined weeks later, with fields that do not change when the prompt or the model changes:

  • decision_id and case_id, the keys for the join.
  • policy, a version label for the whole decision procedure (prompt, model, tools, thresholds), so outcomes can be compared between versions.
  • eligible, whether this case could have been handled by the agent under the policy's own rules.
  • arm, who actually handled it: the agent, or a person because the case was held out.
  • decided_at, the start of the attribution window.

The outcome is emitted by a different system, often much later: the case was reopened, a refund was reversed, the customer contacted the store again. It carries the case_id and its own timestamp. Nothing in the agent needs to wait for it.

Attribution windows and censoring

Join each decision to outcomes inside a fixed window after the decision. Seven days is used here; the right length is a business choice about how long a reopen still reflects the original handling. Two rules keep the join honest:

  1. An outcome counts only if it falls inside the window. A reopen on day eight is a new problem, not evidence about the decision.
  2. A decision counts only once its window has closed. A case decided yesterday has had one day to be reopened. Mixing it with cases that have had seven days lowers the measured rate for whichever arm has more recent decisions.

The second rule is the one dashboards most often break, because "reopen rate so far" is the easiest query to write.

def join(decisions, outcomes, as_of_day, window=7):
    reopened = {}
    for o in outcomes:
        reopened.setdefault(o['case_id'], []).append(o['reopened_day'])
    rows = []
    for d in decisions:
        closes = d['decided_day'] + window
        hit = any(d['decided_day'] < day <= closes and day <= as_of_day
                  for day in reopened.get(d['case_id'], []))
        rows.append({**d, 'window_closed': closes <= as_of_day, 'reopened': hit})
    return rows

A comparison group by design

The naive comparison fails because the agent's cases and the people's cases differ in difficulty, not only in handler. The fix is to hold out a random share of eligible cases: the policy says the agent may handle a case, and a coin flip with a fixed probability sends some of those to a person anyway. Compare agent cases with held-out eligible cases, never with all person cases. This is the logic of a controlled experiment; Kohavi and colleagues' survey of online controlled experiments describes the same randomization and the pitfalls of comparing self-selected groups.

The holdout costs something: those customers do not get the agent, and people handle cases the agent could have taken. Keep it small and time-limited, and say so in the policy record.

The worked numbers

The companion example generates 1,000 synthetic cases with a seeded generator. About 60 percent are easy and eligible for the agent. Of the eligible cases, 20 percent are held out. The generator's reopen probabilities are settings, not measurements: 8 percent for easy cases handled by a person, 10 percent for easy cases handled by the agent, 30 percent for hard cases. So, by construction, the agent is slightly worse than a person on the cases it handles.

After every window has closed:

  • Agent cases: 41 of 479 reopened, 8.6 percent.
  • All person cases: 101 of 521, 19.4 percent.
  • Eligible held-out cases: 9 of 116, 7.8 percent.

The naive difference, agent minus all person cases, is -10.8 points, with a normal-approximation 95 percent interval from -15.0 to -6.6. It looks like a large, confident improvement, and it is produced almost entirely by case difficulty. The holdout difference is +0.8 points, with an interval from -4.7 to +6.3. That interval contains zero, so this sample cannot tell whether the agent is better or worse than a person on eligible cases. That is the honest answer, and it is consistent with the true +2 points built into the generator.

Reading at day 24, before the last windows close, and ignoring the closed-window rule, the agent arm shows 37 reopens instead of 41. The rate looks better because recent decisions have not had time to fail.

What changes in an existing system

Most help-desk and order systems already have a case table and a reopen event. The changes are small and mostly additive:

  1. Emit a decision record at the moment the routing decision is made, from the deterministic code that decides eligibility and assignment, not from the agent. The agent never writes its own outcome data.
  2. Add the holdout to the router as a deterministic function of the case id and a salt, so the assignment can be recomputed and audited.
  3. Keep outcome events in the systems that already own them. The join is a scheduled query, not a new pipeline inside the agent.
  4. Report agent-versus-holdout with interval and sample size, by policy version, only for closed windows.
  5. Add a minimum sample before any rollout decision. With 116 held-out cases the interval is about eleven points wide; detecting a two-point difference at these rates needs thousands of cases per arm.

Failure modes

  • Eligibility drift: the policy is changed to send harder cases to the agent, but old decisions are compared with new ones. Version the policy and compare within a version.
  • Leaking the holdout: a person handling a held-out case can see the agent's draft and copy it. Then the holdout measures the agent's draft plus a reviewer, not a person alone.
  • Several decisions per case: attribute an outcome to the last decision before it, or to all of them, but choose explicitly and test it.
  • Outcome definition changes: if "reopened" starts including automatic reopen-on-reply, every rate shifts. Version the outcome query too.
  • Peeking: checking the interval every day and stopping when it first looks good inflates false positives. Decide the sample size in advance.

When this is unnecessary

If the agent only drafts text for a person who always reviews and sends it, the outcome is mostly the person's, and a holdout measures little. If the decision is reversible within minutes and errors are visible immediately, direct review of the decisions may be enough. And if the volume is a few dozen cases a week, an experiment will not reach a useful sample; review individual cases instead and say that the effect is unmeasured.

Verification

The six tests in the companion example pin the counts after windows close, the naive and holdout differences and intervals, the undercount when reading early, the rule that a reopen on day eight is not attributed, and that the generator is deterministic. In production, the equivalent checks are a daily reconciliation that every routed case has exactly one decision record, and an alert when the holdout share drifts from its configured value.

Run the example yourself

The seeded case generator, the windowed join, both comparisons with intervals and six tests. Companion code on GitHub; its README lists the prerequisites, exact commands, expected output and limits.

Primary references and authorship

Sources read 22 November 2026. Original explanation, measurements and synthetic examples by Sandeep Belgavi. Views are my own and do not represent any employer, past or present.

Related on this site: