# Strange Lab agent oversight: how to run the downloads

These are the commands for the three checks on <https://strangelab.ai/agent-oversight/>. Everything runs on a CPU. The scripts read and write local files and call no service. Read any script before you run it: the source is plain Python, about 5,000 lines in all.

## Files

All under `https://strangelab.ai/agent-oversight/files/`.

| File | What it is |
|---|---|
| `oversight-code.zip` | The scripts, and the adapter and featurizer source they import. |
| `oaihf-fivefold-model.zip` | Five frozen models for the incident corpus, as ONNX graphs. 16 MB. |
| `oaihf-features.zip` | The feature table for the incident corpus. 11 MB. |
| `oaihf-scores.jsonl` | Our score for each of that corpus's 11,609 runs. |
| `generic-model.zip` | The generic frozen model, as ONNX graphs. 1.4 MB. |
| `tau2-scores.jsonl` | Our score for each of tau2-bench's 8,340 runs. |

Unzip each archive into its own folder beside the scripts.

## Setup

Python 3.11 or later.

```
pip install numpy onnxruntime pydantic
```

Rebuilding the incident feature table from the raw dataset also needs `zstandard`.

## Check 1: reproduce the incident ranking

About 15 minutes on a laptop.

```
python score.py --bundle oaihf-fivefold-model --corpus oaihf-features \
    --out my-scores.jsonl --compare oaihf-scores.jsonl
```

The last line printed is a JSON report. The dataset holds 11,609 runs and every one is scored. An event is scored when at least four events come before it in its run. A run too short for that, 400 of them, is scored at every event after its first, and its line carries `"short": true`. The calibration used here was fitted on longer runs, so the ordering of these short runs is less reliable. `complete` is true when your run scored the same 11,609 runs as ours. `rank_correlation`, `top_30_shared` and `bottom_30_shared` say how closely the two rankings agree. Scores differ in the last decimal places between processors; `largest_score_difference` shows by how much.

`my-scores.jsonl` has one line per run, most unusual first. The first 30 lines, and the last 30 lines not marked `"short": true`, are the runs described at <https://strangelab.ai/agent-oversight/top-and-bottom/>.

### Optional: rebuild the feature table from the public dataset

A 1.9 GB download and about 10 more minutes.

```
pip install zstandard huggingface_hub
huggingface-cli download oai-hf-replication/oai-hf-incident-replication \
    --repo-type dataset --include "*.eval" --local-dir raw
python extract_transcripts.py --raw raw --out prepared
python prepare_corpus.py --prepared prepared --stream-dir events \
    --bundle oaihf-fivefold-model --out my-features
```

Then run `score.py` with `--corpus my-features`. Our table was built from the dataset as it stood in September 2026. Three runs have since changed by a few characters in one tool output each, so three rows can differ slightly.

## Check 2: score a second corpus

About 10 minutes on a laptop. The generic model was never trained on this corpus.

```
pip install huggingface_hub
huggingface-cli download AgentSuite/tau2-bench-trajectories \
    --repo-type dataset --local-dir tau2
python prepare_traces.py --format tau2 --records tau2 --stream-dir tau2-events
python prepare_corpus.py --stream-dir tau2-events --bundle generic-model \
    --out tau2-features
python score_generic.py --bundle generic-model --corpus tau2-features \
    --out my-tau2-scores.jsonl --compare tau2-scores.jsonl
```

The report has the same fields as in check 1. The first 30 runs are described at <https://strangelab.ai/agent-oversight/second-corpus/>.

## Check 3: score your own corpus

Needs at least 2,000 recorded agent runs, of tasks your agents do repeatedly. A corpus of 450,000 turns takes about 40 minutes.

Export your traces as one JSON object per line, in one of three formats:

- `langsmith`: runs, as LangSmith's runs query returns them.
- `langfuse`: observations, as Langfuse's observations API returns them.
- `otlp`: OpenTelemetry export requests (`resourceSpans`).

```
python prepare_traces.py --format langsmith --records runs.jsonl \
    --stream-dir my-events
python prepare_corpus.py --stream-dir my-events --bundle generic-model \
    --out my-features
python score_generic.py --bundle generic-model --corpus my-features \
    --out my-ranking.jsonl
```

Each step prints a JSON report. Check these before reading the ranking:

- `prepare_traces.py`: `episodes` is the number of traces kept as runs. `traces_under_min_turns` counts traces left out for having fewer than three turns.
- `prepare_corpus.py`: `runs` and `scored_turns` should match what you exported.
- `score_generic.py`: `runs_with_nothing_to_compare_against` counts runs that share a session with every other run, which cannot be ranked. If fewer than 20 runs can be compared the script stops, and under 2,000 it adds a caution.

`my-ranking.jsonl` has one line per run, most unusual first. `run` holds the trace id. `reading` says which of the model's two readings put the run where it is: `structure/situation` means the state after some turn was unlike the rest of the corpus, `structure/action` means an action was unlike others taken in a similar state. Read the first 30 and the last 30 runs in your own trace viewer and judge whether the first 30 are the ones worth a person's attention.

Unusual is not the same as harmful. The model ranks; a person or a frontier model decides what the top of the list means.

The generic model is not trained on your agents or calibrated to them. Strange Lab does both for a deployment: <admin@strangelab.ai>.

For traces in any other format, write to the same address.
