Skip to content

About

Evaluation harness for LLM agents: sandboxed trials, a budget-enforcing model gateway, and statistically sound run comparisons.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Agentoscopy

An evaluation harness for LLM agents, built to answer one question for a team changing an agent: did this change make it better or worse, and how sure can we be? Suites of tasks run as concurrent trials in Docker sandboxes, every model call goes through a budget-enforcing gateway, results land in SQLite, and runs can be compared statistically, from the CLI or in a local web UI. Trials are graded by commands, trajectory rules, a tamper check that vetoes reward hacking, and an LLM judge whose agreement with human reviewers is measured. Runs survive crashes and can be cancelled, and agentoscopy ci gates pull requests on regressions.

The compare page: the example agent on Claude Haiku 5.5 against Claude Sonnet 5.5

The compare page for two real runs of the 20-task core suite, four trials per task: the example Claude agent on Claude Sonnet 5.5 (the baseline, $0.93 for 80 trials) against the same agent on Claude Haiku 5.5 ($0.12). Both models' fixes passed the hidden tests in all 80 trials. The difference is the tamper check: Haiku also edited a task's protected test file in 59 trials, adding tests of its own, and each of those is vetoed; Sonnet did so in 2. Bisect found where one of those Haiku trials went wrong.

How it compares

Inspect is a broad framework for writing and running evaluations. It ships over 200 ready-made evaluations, runs untrusted code in Docker, Kubernetes, and other sandboxes, and can drive external agents such as Claude Code. SWE-bench is a benchmark: software issues collected from GitHub, with a harness that applies the patch a system submits and runs the repository's tests in Docker.

Agentoscopy is narrower. It is for a team iterating on one agent that needs to know whether a change made it better or worse, and how far to trust the answer:

  • Paired comparison. Two runs are compared task by task. Each task is classified (regressed, improved, flaky, and so on) with an exact test, and the verdict comes from a 95% confidence interval over tasks. A test checks that comparing a config with itself gives a false verdict only about 5% of the time.
  • CI gating. agentoscopy ci runs the suite on a pull request, compares it with the latest run on main, comments the verdict, and fails the check on a regression.
  • Every model call through one gateway. The gateway enforces each trial's step, token, and cost budget and records every call, so a trial can be replayed from its recording, or forked at a step to see what another config would have done.
  • Grading that can be audited. A tamper check vetoes reward hacking, and LLM judge verdicts are sampled for human review, with each judge's agreement measured.

It is also smaller. The bundled tasks are a starter suite for exercising the harness, not a benchmark, though task import turns fixes from your own repository's history into tasks, and task swebench turns SWE-bench instances into tasks that grade the way SWE-bench does. Agents are Python classes, or command-line agents such as Claude Code run inside the sandbox, and models come from Anthropic or any server that speaks its API: open models on OpenRouter, or local ones on Ollama, llama.cpp, LM Studio, or vLLM. To rank models on a leaderboard, use a benchmark's own harness, such as SWE-bench's; for a wide range of ready-made evaluations, Inspect; to gate changes to one agent, Agentoscopy.

Setup

Requires Python 3.11+, uv, and a running Docker daemon.

uv sync

Workflow

uv run agentoscopy task validate --all                  # build images, run null/reference/isolation checks
uv run agentoscopy task list                            # validation status of every task
uv run agentoscopy task import ../myrepo <commit> --id fix-x  # a task from a fix in your repo's history
uv run agentoscopy task swebench verified.jsonl django__django-11099  # a task from a SWE-bench row
uv run agentoscopy run --suite example --agent configs/scripted-fix.yaml --trials 3
uv run agentoscopy report <run_id> --format md          # table, md, or json
uv run agentoscopy compare <baseline_run> <candidate_run>
uv run agentoscopy tradeoff <run_id> <run_id> ...        # pass rate against cost, and the frontier
uv run agentoscopy run --resume <run_id>                # continue a run after a crash
uv run agentoscopy replay <trial_id>                    # rerun a trial from its recorded model calls
uv run agentoscopy fork <trial_id> --at-step 3          # the same up to step 3, then live
uv run agentoscopy bisect <trial_id> --agent CONFIG     # the step where a failed trial went wrong
uv run agentoscopy agent check configs/claude.yaml      # try an agent config before a real run
uv run agentoscopy cancel <run_id>
uv run agentoscopy gc --older-than 30d                  # old run outputs, orphaned sandboxes
uv run agentoscopy serve                                # web UI; open the URL it prints

agentoscopy run takes --suite NAME or one or more --task ID, plus --budget-usd (run cost ceiling, default 10), --concurrency, --seed, --label KEY=VALUE, --judge-model (default claude-opus-5-5), and --review-rate (the fraction of trials sampled for human review, default 0.05). A task can only run once its current content has been validated.

To run only some of a suite's tasks, add --tag, --category, --difficulty, or --failed-in RUN_ID (the tasks that failed or hit an infra error in that run). Repeat an option for any of several values; different options must all match. A filtered run keeps the suite's name but no suite version, so it never stands in for a full run of the suite (as a CI baseline, say), and it records the filter as a label.

--top-up N adds N more trials to every task whose trials both passed and failed, once the planned trials are done, so extra trials go where the result is uncertain. A run that hit its budget is not topped up, and a resumed run still finishes its top-up.

The example task has an LLM judge grader, so validating and running it calls the judge model, which needs ANTHROPIC_API_KEY. To try everything offline, add --judge-model mock to both task validate and run. The mock judge answers at random, so expect the calibration page to call it uncalibrated.

Exit codes: 0 success, 1 a task failed a validation check, 2 invalid input, 3 environment or harness failure, 130 the run was cancelled.

Crashes, resuming, and cancelling

A trial in flight is held under a lease that its process renews every 10 seconds. If the process dies, the lease runs out after 30 seconds, and agentoscopy run --resume <run_id> picks the run up: it removes the containers and snapshots the dead attempts left behind, counts what those attempts spent, and runs the trials again. A trial is finalised only by the process that holds it, so nothing is lost or counted twice. Resuming needs the tasks to have the content the run started with.

agentoscopy cancel <run_id> (or the run page's Cancel button) cancels queued trials at once. Trials that are setting up or running stop within a few seconds, with 30 seconds for the agent to wind down; trials already being graded finish. Finished trials keep their results, and the run gets a partial summary. Ctrl-C in agentoscopy run is blunter: it cancels every unfinished trial at once, including any being graded.

agentoscopy gc deletes the trajectories and artifacts of runs that finished more than --older-than ago (results stay in the database; runs with trials waiting for review are kept), and removes sandboxes that no running trial holds. --dry-run only reports.

CI gating

agentoscopy ci --suite S --agent C --baseline main runs the suite, compares it with the newest completed run of the same suite version labelled branch=main (from the last 7 days, --max-baseline-age), and reports the verdict. With no such run it runs one first with --baseline-agent. --github posts the comparison as a pull request comment and updates that same comment on later pushes; inside GitHub Actions it needs only GITHUB_TOKEN. --override (the workflow sets it for the eval-override label) reports a regression without failing. Exit codes: 0 no regression, 1 regression, 2 harness error, 3 the candidate run hit its budget.

.github/workflows/eval.yml wires this up: pull requests are evaluated against the baseline that pushes to main keep fresh in the Actions cache, and pull requests from forks never run with provider credentials.

Comparing runs

agentoscopy compare lines up the tasks both runs scored at the same version. Each task is classified as regressed, improved, changed, flaky, stable pass, or stable fail; regressed and improved need a one-sided Fisher's exact test at p < 0.05, which takes at least 4 trials per run (6 for tasks marked critical, which get those automatically). The verdict is REGRESSION when the 95% CI of the mean per-task change is below zero or a critical task regressed, IMPROVEMENT when it is above zero, and NO_SIGNIFICANT_CHANGE otherwise. The CI is a Student t interval over tasks: comparing a config with itself gives a different verdict about 5% of the time, which a test checks. Every critical task is another chance of a false alarm, so when a suite has several, a critical regression must survive a Holm correction across them; otherwise it is reported as a warning. With five critical tasks, false verdicts stay near 6% instead of rising to about 14%, which a test also checks. The output also shows cost, token, step, and duration deltas, deltas by task category and tag, and a field-level diff of the two agent configs.

Cost against quality

agentoscopy tradeoff <run_id> <run_id> ... weighs pass rate against cost across 2 to 20 runs, and the web UI draws it when two or more runs are selected. It uses the tasks every run scored at the same version, so a run over easier tasks cannot look better than it is. For each run it gives the mean pass rate over those tasks, with the same 95% t interval comparisons use, and the mean agent cost per scored trial; judge spend is left out, as it is from budgets. A run is on the frontier when no other run passes at least as often for no more cost. The chart joins the frontier with a step line: the best pass rate each budget buys. The frontier compares point estimates, so where intervals overlap, the order may not hold. --format takes table, md, or json, and the API is GET /tradeoff?runs=A,B,C.

The cost and quality page for four agent configs on the core suite

Four real runs of the core suite, four trials per task. The example agent on Claude Haiku 5.5 passes 26.3% of tasks at $0.0015 per trial, the same agent on the open model Qwen3-Coder-30B-A3B through OpenRouter 71.3% at $0.0016, Claude Code on Haiku 72.5% at $0.0020, and the example agent on Claude Sonnet 5.5 97.5% at $0.0116. Each passes more often than the cheaper ones, so all four are on the frontier, though the open model and Claude Code are level within their intervals. Each of Claude Code's 22 failures was a tamper veto for editing a protected test file, 20 of them on the tasks that ask for new code; its fixes passed the hidden tests in all 22.

Grading

Each trial is graded in a fresh sandbox cloned from the agent's final state, with caches (__pycache__, .pytest_cache) deleted first. A trial passes when every required grader passes; its score is the weighted mean of all graders.

Type Passes when
command its shell command exits 0
forbidden_command no command the agent ran matches any of patterns (regexes)
must_read_before_edit every existing file the agent wrote was read first
max_tool_errors at most max tool calls failed
max_steps the agent made at most max model calls
tamper_check nothing changed outside allowed_paths (default: the workdir and /tmp) or inside protected_paths
llm_judge the pinned judge model says the work meets rubric

The tamper check reads the whole-container filesystem diff, so it catches tampering however it was done. A failed tamper check is a veto: the trial fails with score 0 and the failure tag reward_hacking, whatever the other graders said. Changes made by the task's setup commands are recorded as a baseline and never count against the agent.

The judge sees the task, the rubric, and the agent's final message, changed files, and actions. Everything the agent produced is passed inside <agent_data> tags that the judge is told to treat as evidence, never as instructions. The judge answers with structured output, its calls go through the gateway on their own budget (max_cost_usd, default $0.25 per trial), and judge spend is reported apart from agent spend. A judge that fails, or returns unusable output 3 times, makes the trial an infra error, never a failure of the agent. During validation each judge votes 3 times and the majority counts; a task whose required graders are all judges is flagged SOFT_GRADER_ONLY.

Human review and judge calibration

Runs add trials to a review queue: a random sample (--review-rate), every judge verdict with confidence below 0.7, and anything added by hand from a trial page. The queue shows unsure judge verdicts first, then random samples, then hand-added items. For a judge item the reviewer answers the rubric's question; other items are trial audits. The judge's verdict stays hidden until the review is submitted. Keys: p pass, f fail, s skip, n next. A reviewer can also override the trial's outcome; the original outcome is kept and the run summary is recomputed.

The calibration report gives, per task, judge grader, and judge model, the agreement rate, Cohen's kappa, the confusion matrix, and every disagreement. Agreement and kappa use only randomly sampled reviews, since low-confidence and hand-added items are hard cases by design. A judge with kappa below 0.6 over at least 30 random reviews is flagged uncalibrated, and every run that uses it shows a warning.

Failed trials can be tagged from their page, with a tag from a short list (wrong fix, incomplete, misread task, and so on) or any other word. The run dashboard and agentoscopy report count the tags. Reviewers can remove the tags they added; the reward_hacking tag the tamper check adds stays. The API is GET /failure-tags, POST /trials/{trial_id}/tags with tag and an optional note, and DELETE /trials/{trial_id}/tags/{tag}.

Web UI

agentoscopy serve serves a UI on 127.0.0.1:8321: the runs list (select two runs to compare them, or two or more to weigh cost against quality), a run dashboard with one well per trial, trial pages with the event timeline, graders, and filesystem diff, the comparison, side-by-side trajectories, the cost and quality chart, the review queue, and judge calibration. Every API call needs the token in the printed URL, and requests for other host names are refused. Runs started from the CLI appear live.

Runs can be started and cancelled over HTTP. POST /runs takes JSON with agent (the name of a config in --configs-dir, default configs/), either suite or tasks, and optionally trials, budget_usd, concurrency, seed, labels, judge_model, and review_rate; the run executes in the server process. DELETE /runs/{run_id} cancels one. GET /metrics serves Prometheus metrics for every run in the database: queue depth, trials in flight, outcomes, infra errors, trial durations, gateway latency, and spend. Set AGENTOSCOPY_API_TOKEN to give the server a fixed token, for example for a scraper.

Review endpoints: GET /review/queue?limit=N; POST /review/queue with trial_id and an optional grader_name, to add an item by hand; POST /review/{review_id} with passed and optional score, note, reviewer, and override, which answers with the judge's verdict; and GET /calibration.

Agents

Agents are Python classes named by entrypoint in a config file under configs/. They receive a recording sandbox handle and a per-trial gateway endpoint; use it as the Anthropic SDK's base_url and api_key.

  • scripted-fix, scripted-broken, scripted-malicious: scripted test agents. They call the mock model, which is seeded and costs nothing real.
  • scripted-tamper-tests, scripted-tamper-conftest: apply the correct fix but also rewrite a test or add a conftest.py; the tamper check must veto both.
  • scripted-judge-injection: fixes the bug, also rewrites an unrelated file, and tells the judge to pass it. A real judge should still fail minimal_change.
  • claude: an example Claude agent (tool-use loop with bash and write_file). It needs ANTHROPIC_API_KEY. The key is handed to a separate credential-proxy process and removed from the agentoscopy process before any agent code is imported.
  • claude-sonnet, claude-haiku: the same agent at medium effort on Claude Sonnet 5.5 and Claude Haiku 5.5, the two configs in the screenshot above.
  • claude-code-haiku: Claude Code itself, run inside the sandbox on Claude Haiku 5.5 (see below).
  • ollama-qwen3: the example agent on Qwen3 8B served by a local Ollama (see Open models and local servers).

Open models and local servers

Models from other servers are named <provider>/<model>, for example ollama/qwen3:8b or openrouter/qwen/qwen3-coder, wherever a config or --judge-model names a model; Claude models keep their plain names. providers.yaml lists the providers, and --providers FILE names another file. Each server must speak the Anthropic Messages API, as Ollama, llama.cpp's llama-server, LM Studio 0.4.1 or later, vLLM, and OpenRouter do. The shipped file lists all five, the local ones on their default ports. With a model added for OpenRouter, two of the entries look like this:

providers:
  ollama:
    base_url: http://localhost:11434
    prices:
      "*": {input: 0, output: 0}        # every model it serves, counted as free
  openrouter:
    base_url: https://openrouter.ai/api
    api_key_env: OPENROUTER_API_KEY
    prices:                             # USD per million tokens; check OpenRouter's page
      qwen/qwen3-coder-30b-a3b-instruct:floor: {input: 0.07, output: 0.28}

The gateway strips the provider's name from the model before it forwards a call, and enforces budgets and records calls as it does for Claude. Every call is budgeted, so a model without a price is refused; "*" prices every model a provider does not list, and cache reads cost the same as input unless a price gives cache_read. A server that needs a key gets it from the credential proxy, which takes it out of the agentoscopy process like ANTHROPIC_API_KEY, and a key is never sent over plain HTTP to a remote host. A server that needs no key, such as a local one, is called directly. Local models are counted as free, so their trials are limited by steps and tokens, not cost.

OpenRouter spreads a model's calls over the providers that serve it, each at its own price, so a recorded cost is only as exact as the price listed; :floor on the model sends calls to the cheapest provider first, falling back to the others only when it fails.

To evaluate a local model with Ollama, pull one that can call tools and serve it with enough context for a coding session:

ollama pull qwen3:8b
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
uv run agentoscopy agent check configs/ollama-qwen3.yaml
uv run agentoscopy run --suite core --agent configs/ollama-qwen3.yaml --trials 4

Command-line agents name provider models the same way, for example Claude Code with --model ollama/qwen3:8b. A judge can run on a local model too, with --judge-model ollama/<model>, though a small model makes a poor judge; the calibration report shows how far to trust it.

Checked for real with the example agent on qwen/qwen3-coder-30b-a3b-instruct:floor through OpenRouter, priced as above: over the core suite, four trials per task, it passed 71.3% of tasks (the open model on the cost and quality chart). The run was recorded at $0.1241 and OpenRouter billed $0.1245 for it. 14 of its 23 failures were tamper vetoes for editing a protected test file, and its key never reached the recorded results. A run reserves each trial's max_cost_usd (a task's cap, $1 by default) before starting it, so the run budget must cover that cap on top of what the run spends; this one used --budget-usd 1.3.

Command-line agents

agentoscopy.adapters.command:CommandAgent runs any command-line agent inside the sandbox. Its config gives install steps, which are built on top of the task image once per task image; the command, where {instructions} becomes the task's instructions; and extra env. The command runs in the workdir with ANTHROPIC_BASE_URL set to a relay on the sandbox's own loopback address. The relay hands each request to the harness over the same docker exec channel the harness already uses, and the harness sends it to the trial's gateway with the trial's token. So the sandbox keeps no network at all, the agent never holds a credential, and the gateway enforces the trial's budget as for any other agent. The task image needs python3, which runs the relay.

Exit code 0 ends the trial as agent_done, another code as an agent error, and running past the task's timeout as timeout. Every model call is recorded; the agent's own tool calls happen inside its process, so the trajectory shows them only as the one command and its output, and trajectory graders have less to go on.

configs/claude-code-haiku.yaml installs Node 22 and Claude Code 2.1.310 and points every model Claude Code picks at claude-haiku-5-5. It passes agentoscopy agent check, and on three core tasks the example Haiku agent always failed by editing protected tests, it passed two of them in both trials (4 of 6 trials, $0.013 in all).

agentoscopy agent check <config> runs a config once on a built-in smoke task (reverse a file's contents). It passes when the agent called a model through the gateway, acted in the sandbox or reported a message, and finished on its own. It fails with GATEWAY_BYPASS when the agent ignored the endpoint it was given, NO_AGENT_EVENTS, or AGENT_DID_NOT_FINISH. Whether the agent solved the smoke task is reported but does not decide the check.

Once a trial's step, token, or cost budget is spent, the gateway rejects further calls with HTTP 400 and error type budget_exceeded_error (agentoscopy.adapters.base.BUDGET_EXCEEDED_ERROR).

Tasks

A task lives in tasks/<id>/:

  • task.yaml: instructions, environment, budget, graders, and optional category, difficulty, tags, and critical
  • fixtures/: copied into the workdir when the task image is built
  • hidden/: grader-only files, mounted read-only at /hidden during grading only
  • reference/: optional reference solution; its files overlay the workdir during validation
  • reference.patch: optional reference solution as a diff, applied with git apply in the workdir during validation, for an image that has git

Suites live in suites/<name>.yaml as a name and a list of task ids, a list of tags, or both: a suite with tags also takes every task that carries one of them, after the listed ones. core is a starter suite for trying the harness and comparing agents, not a benchmark: twenty small Python tasks (thirteen bug fixes, six small features, and the example task) of mixed difficulty, each with visible tests, hidden tests, a reference solution, and the tamper check. example holds just the example task, the only one with an LLM judge. The run database, trajectories, and artifacts are written under .agentoscopy/.

Tasks from your own repository

agentoscopy task import <repo> <commit> --id ID turns a commit that fixed a bug in a local git repository into a task, so agents are measured on your code's real bugs:

  • the commit before the fix is the starting code;
  • the test files the fix added or changed are the hidden tests, at their fixed versions. Their old versions are held back from the starting code, since they assert the bug;
  • the other files the fix changed are the reference solution;
  • the commit message is the instructions, unless --instructions says otherwise.

Then agentoscopy task validate ID checks that the hidden tests fail before the fix and pass with it, as for any task. Tests run with unittest by default; --runner pytest installs pytest in the image. --build COMMAND runs while the image is built, after the code is copied in, for dependencies (--build "pip install -r requirements.txt"), and --base-image replaces the default Python 3.12 image (pin it by digest). Tag imports with --tag myrepo and a suite with tags: [myrepo] collects them all.

The repository is only read through git; nothing is fetched. A commit that changes no tests, changes only tests, or deletes code is refused, and so is one whose test files would share a name, because hidden tests are flattened into one folder. As a check, a fix from this project's own history (8b1b0e7, with --runner pytest --build "pip install .") imports into a task that validates.

Tasks from SWE-bench

agentoscopy task swebench <rows> <instance_id>..., or --all, turns rows of SWE-bench, SWE-bench Lite, or SWE-bench Verified into tasks. Rows come from a local .json or .jsonl file, from SWE-bench 5 or later, whose rows name each instance's image, eval script, and log parser. One way to get them:

uv run --with datasets python -c "from datasets import load_dataset; load_dataset('SWE-bench/SWE-bench_Verified', split='test').to_json('verified.jsonl')"
uv run agentoscopy task swebench verified.jsonl django__django-11099 sympy__sympy-20590
uv run agentoscopy task validate django-django-11099 sympy-sympy-20590

Each task:

  • starts from SWE-bench's image for the instance, pinned by digest, with the repository at /testbed as the workdir and its Python environment first on PATH (environment.env, which any task can use to set variables in its image);
  • is graded by running the row's eval script, which applies the hidden tests and runs them, then grading the log the way SWE-bench does. Its log parsers and rules are ported into a check that runs in the grading sandbox: the instance is resolved when every FAIL_TO_PASS test passes and every PASS_TO_PASS test still passes or is skipped;
  • has SWE-bench's gold patch as its reference.patch, so validation checks that the untouched repository fails and the gold patch passes, which proves the task grades as SWE-bench does;
  • keeps the tamper check for conftest.py files, is tagged swe-bench, and takes the repository as its category and Verified's time estimate as its difficulty.

Importing looks up each image's digest; the images, about 4 GB each on disk, are pulled when a task is first validated or run. Only Python repositories are supported. Graders run as the agent's non-root user, where SWE-bench runs them as root, so code the agent wrote cannot reach the Python that reads the log; steps of an eval script that need root, such as generating a locale, run once when the image is built. The check is also stricter in one place: a log in which the hidden tests did not apply is not graded, since it would grade whatever tests were there.

Checked for real on three SWE-bench Verified instances, one for each kind of log parser: django__django-11099, sympy__sympy-20590, and astropy__astropy-12907 all validate, so each fails untouched and passes with the gold patch, as in SWE-bench. The example agent on Qwen3-Coder-30B-A3B through OpenRouter then resolved the Django and Astropy instances but not the SymPy one, for $0.116 recorded and $0.119 billed, and the tamper check passed in all three trials.

Replay and fork

agentoscopy replay <trial_id> reruns a recorded trial in a fresh sandbox with the same task version, agent config, and seed. Each model call is answered with the response recorded at the same step, at no cost, as long as the agent sends the same request it sent then; tool calls run live. A different request, or a call the original never made, stops the replay with REPLAY_DIVERGED at that step. The command exits 0 when the replay ends with the original outcome after the same model calls, and 1 otherwise. A replay is its own one-trial run; its trial page links to the original and to a side-by-side view.

agentoscopy fork <trial_id> --at-step N answers the model calls before step N from the recording, whatever the agent asks, and makes step N and later live. Add --agent CONFIG to continue with another config, or --inject TEXT to add a message to the request at step N, and see what would have happened. A recorded answer that calls a tool the new config lacks stops the fork with REPLAY_DIVERGED. Replayed answers reach the agent without their thinking blocks: the provider binds those to the conversation that produced them and rejects them in the fork's later live calls. Its trial page links to the original and to the side-by-side view.

agentoscopy bisect <trial_id> --agent CONFIG finds the step where a failed trial went wrong. It forks the trial with a config that can pass the task, the rescue config: forking at step k keeps the trial's own first k - 1 model answers and lets the rescue config take over from step k. While those forks still pass, the trial's mistake has not happened yet; once they fail, it has. A binary search finds the last step from which the trial can be rescued, so the answer recorded at that step is the one that sealed the failure, and the command prints a side-by-side link to see what the rescue config did instead.

Live calls vary, so each step runs --trials forks (3 by default) and counts as rescued when most of them pass. Both ends are checked first: if the rescue config fails the task from step 1, or still passes with every recorded answer kept, no step is blamed and the command exits 1. --budget-usd (2 by default) caps live model spend across all forks. Each fork reserves the task's per-trial cap before it starts, as trials in a run do, so a budget below that cap is refused with BUDGET_BELOW_TRIAL_CAP. Each fork run is labelled bisect and shows up in the run list. The search assumes that a trial that cannot be rescued from one step cannot be rescued from later steps either, so every probe is printed with its pass count.

For example, one of the failed Haiku trials in the screenshot above (add-deep-merge, nine model calls) was bisected with configs/claude-sonnet.yaml as the rescue config:

  fork at step 1: 3 of 3 passed, rescued
  fork at step 2: 3 of 3 passed, rescued
  fork at step 3: 0 of 3 passed, not rescued
  fork at step 5: 0 of 3 passed, not rescued
  fork at step 10: 0 of 3 passed, not rescued
step 2: the trial can still be rescued by taking over at step 2, but not once its own
recorded answer at step 2 is kept. That answer sealed the failure.

Haiku's answer at step 2 read the protected test file. Once that was kept, Sonnet too appended its own tests to the file in every fork and was vetoed; taking over one step earlier, it passed every time. The 15 forks cost $0.24.

Tests

uv run pytest                    # integration tests are skipped if Docker is not running
uv run pytest tests/chaos        # kills a run mid-flight and resumes it
uv run pytest -m "not integration"
uv run ruff check . && uv run ruff format --check agentoscopy tests

License

MIT License; see LICENSE.

About

Evaluation harness for LLM agents: sandboxed trials, a budget-enforcing model gateway, and statistically sound run comparisons.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages