·

Engineering

Streaming with a trail.

Audit logs that keep up with tokens

Daniel Cho, Kofi Mensah

Halden Labs

10 June 2025

·

7 min read

Abstract

Every step of a Halden run, from each page read to each check and approval, is written to an append-only trail while the reply streams. The trail adds 4 ms to the first token at the median and is returned with every API call.

Added to first token

4 ms

Events per run

1,900

Kept for

7 years

Export

JSON

Engineering

A trail written after the answer is a summary. A trail written as the answer streams is a record.

A record, not a summary

Auditors do not want to know what the agent concluded. They want to know what it read, in what order, what it checked and who approved it. That has to be written down as it happens.

Keeping up

Trail events are written to an append-only log alongside the stream, batched every few milliseconds and signed in order. The reply never waits for the log, and the log never misses a step.

Getting it out

  • Every API response carries the trail for its run.

  • Webhooks deliver trail events to your own archive as they are written.

  • Exports keep the signatures, so a trail can be checked years later.

Cite

Cho, D. and Mensah, K. (2025). Streaming with a trail: audit logs that keep up with tokens. Halden Labs.

The full eval

Fewer errors,

by suite.

Errors per thousand held-out cases. Lower is better.

Halden 2

Halden 3

Contracts

312 cases

39

6

−85%

Audit trails

288 cases

46

11

−76%

Grid plans

240 cases

62

8

−87%

Clinical codes

260 cases

51

14

−73%

Insurance claims

140 cases

44

9

−80%

1,240 cases, graded blind by specialists. The full set and grading notes are in the paper.

The full eval

Fewer errors,

by suite.

Errors per thousand held-out cases. Lower is better.

Halden 2

Halden 3

Contracts

312 cases

39

6

−85%

Audit trails

288 cases

46

11

−76%

Grid plans

240 cases

62

8

−87%

Clinical codes

260 cases

51

14

−73%

Insurance claims

140 cases

44

9

−80%

1,240 cases, graded blind by specialists. The full set and grading notes are in the paper.

The Lab Letter

One thing we
learned,
once a month.

A short letter from the lab: one finding from our research, and what we changed.

Arrives

First Monday

Reads in

Three minutes

Costs

Nothing

Your email

By subscribing you agree to hear from us once a month. We never share your address, and every note has a one-click way out.

Latest note

The Lab Letter

One thing we
learned,
once a month.

A short letter from the lab: one finding from our research, and what we changed.

Arrives

First Monday

Reads in

Three minutes

Costs

Nothing

Your email

By subscribing you agree to hear from us once a month. We never share your address, and every note has a one-click way out.

Latest note

The Lab Letter

One thing we
learned,
once a month.

A short letter from the lab: one finding from our research, and what we changed.

Arrives

First Monday

Reads in

Three minutes

Costs

Nothing

Your email

By subscribing you agree to hear from us once a month. We never share your address, and every note has a one-click way out.

Latest note

The Lab Letter

One thing we
learned,
once a month.

A short letter from the lab: one finding from our research, and what we changed.

Arrives

First Monday

Reads in

Three minutes

Costs

Nothing

Your email

By subscribing you agree to hear from us once a month. We never share your address, and every note has a one-click way out.

Latest note

Create a free website with Framer, the website builder loved by startups, designers and agencies.