Scan your whole stack
From OX Research Newsroom
Are you using inspect-test-utils?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.11.0
inspect-test-utils was last scanned on 1 Dec 2026 at version 1.11.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.11.0 LATEST | 1 Dec 2026 | No rules fired |
| 1.10.0 | 11 Nov 2026 | No rules fired |
| 1.9.0 | 22 Oct 2026 | No rules fired |
Findings for v1.11.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.11.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
inspect-test-utils
A small collection of tasks, scorers, and a simple model for use with the Inspect AI framework. It is designed to support integration/acceptance tests, demos, and reproductions by providing:
Passing arguments Most tasks and the hardcoded model accept parameters. With the Inspect CLI you can pass them via --task-arg and --model-arg repeatedly:
What’s included
Tasks (inspect_test_utils.tasks)
crash_after=n to arm a crash injector on the task's setup that crashes whichever agent the eval-set pairs with it on its n-th sandbox bash call — see "Crashing an arbitrary agent" below. Set refuse_execs=n to have the k8s sandbox provider refused its exec connections for n seconds — see "Refusing sandbox execs on a deployment" below.Scorers (inspect_test_utils.scorers)
Model (inspect_test_utils.hardcoded)
inspect_test_utils includes a crash/resume harness that verifies an (agent, task) pair correctly checkpoints and resumes after a mid-run or scoring crash. Use it with any task that calls react() (or another checkpointer-aware solver) and has a checkpoint trigger configured.
from inspect_ai import Task
from inspect_ai.agent import react
from inspect_ai.dataset import Sample
from inspect_ai.scorer import includes
from inspect_ai.util import CheckpointSampleConfig
from inspect_test_utils import (
run_resume_test,
after_turns,
at_scoring,
assert_resumed,
assert_agent_not_restarted,
assert_score_recovered,
)
task = Task(
dataset=[
Sample(
id="s1",
input="go",
target="done",
checkpoint=CheckpointSampleConfig(sandbox_paths={"default": ["/root"]}),
)
],
solver=react(...),
scorer=includes(),
sandbox="docker",
)
# Crash mid-run (after the 2nd sandbox exec) and assert the agent resumed:
r = run_resume_test(task, crash=after_turns(2), compute_baseline=False)
assert_resumed(r)
# Crash at the first scoring call and assert the agent was NOT re-run (scoring-only resume):
task_no_sandbox = Task(
dataset=[Sample(id="s1", input="hi", target="hi")],
solver=react(...),
scorer=includes(),
)
r = run_resume_test(task_no_sandbox, crash=at_scoring())
assert_resumed(r)
assert_agent_not_restarted(r) # agent loop skipped on scoring resume
assert_score_recovered(r) # score matches baseline
Both after_turns(n) (crash after the n-th sandbox exec) and at_scoring() (crash at the first scorer call) are supported. after_turns requires compute_baseline=False because the exec patch is incompatible with a second in-process checkpointed eval.
To bound an open-ended agent (a real model that won't submit on its own), pass message_limit= / time_limit= — these are forwarded to eval_set as eval-level limits that are recreated per attempt, so they survive the resume. (An as_solver(limits=[message_limit(...)]) does not: the same Limit instance is reused on the resume attempt and raises "a Limit may only be used once".) With a real model also set a request timeout on the model — e.g. get_model(name, config=GenerateConfig(timeout=90)) — so a hung provider call can't wedge the run.
run_resume_test uses an in-process soft crash (CrashInjected exception + eval_set retry), suitable for CI. For a true os._exit crash as in a real k8s/Hawk deployment, use the hard=True injector instead — see below.
To exercise crash + resume of a real agent on a platform that handles restart (k8s / Hawk), use the registered crashing_react solver — chain(crash_after_exec(n, hard=True), react(...)). On the n-th agent bash call it calls os._exit; the platform relaunches the sample and resumes it from its last checkpoint.
The injector is resume-safe: it arms only on the initial attempt (read from the sample's checkpoint attempt) and disarms itself on resume, so the wrapper can stay in the config the platform replays on resume — a deployment cannot swap solvers without breaking hydration — and the resumed run completes instead of re-crashing.
crashing_react is registered for plugin discovery (inspect_test_utils/crashing_react), so an eval-set can reference it from its solvers: block:
solvers:
- package: "git+https://github.com/METR/inspect-test-utils" # a version/tag exporting crashing_react
name: inspect_test_utils
items:
- name: crashing_react
args:
crash_after: 8 # os._exit on the 8th agent bash call
hard: true
checkpoint:
enabled: true
trigger: { type: turn, every: 1 }
Launch the eval-set, confirm a checkpoint fired before the crash (e.g. hawk trace <id>), then resume after the crash (hawk eval-set resume <id> --secret …); the resumed sample hydrates from its last checkpoint and runs to completion. See docs/user-guide/checkpointing.md in the Hawk repo for the resume workflow and requirements.
Never run
crashing_react(hard=True)(orcrash_after_exec(n, hard=True)) inside a pytest process —os._exitwould kill the test runner.hard=Trueis for real eval-set jobs only; for an in-process test userun_resume_test(above) or passhard=False.
To compose the injector with a different agent or tool set in-process, build the chain yourself: chain(crash_after_exec(n, hard=True), as_solver(react(tools=[...]))). This is the resume_probe pattern generalised to any agent via the shared sandbox-exec seam.
crashing_react bakes in upstream react. To crash a different agent on a platform like Hawk — where the agent is chosen as a separate config field and you can't author a chain(...) in YAML — put the injector on the task's setup instead of in a solver chain, then pair that task with any agent. configurable_sandbox(crash_after=n) does exactly this:
tasks:
- package: "git+https://github.com/METR/inspect-test-utils" # a version exporting crash_after
name: inspect_test_utils
items:
- name: configurable_sandbox
args:
sample_count: 1
crash_after: 2 # os._exit on the agent's 2nd sandbox bash call
solvers:
- package: "git+https://github.com/METR/inspect-agents#subdirectory=packages/agents"
name: metr_agents
items:
- name: react # the real production agent gets crashed + resumed
checkpoint:
enabled: true
trigger: { type: turn, every: 1 }
This works because a platform selects the agent via task × solver and keeps the task's setup when it overrides the solver, so the crash arms before any agent runs. It's agent-agnostic (react, metr_agents, inspect_swe, …) and resume-safe (the injector disarms once a checkpoint commits). Same constraints as above: single sample, crash_after >= 2 with trigger=turn every=1, and never crash_hard=True in-process.
To test that a run survives a sandbox command the cluster refuses, set refuse_execs on configurable_sandbox. For that many seconds, every new exec, read_file and write_file connection the k8s sandbox provider (inspect_k8s_sandbox) opens is answered with the status a production API server gave for an exec that containerd refused before starting it: a Failure with no details. Nothing is sent to the cluster for a refused connection, so no cluster access is needed. Not covered: a pod on the execd transport of METR's fork, whose commands do not open a connection each, and exec_stdio.
tasks:
- package: "git+https://github.com/METR/inspect-test-utils" # a version with refuse_execs
name: inspect_test_utils
items:
- name: configurable_sandbox
args:
refuse_execs: 8 # seconds the window lasts
refuse_execs_after: 45 # seconds from the first poll seen (the default)
The fault is injected below Inspect's sandbox interface, in the provider's transport, so the provider's own status reading and retry run for real; a fault raised from SandboxEnvironment.exec would never reach them. The setup solver is exported as refuse_execs for use outside this task.
The countdown starts at the first exec_remote_poll request the provider sends. A streaming exec_remote sends one every 5 s, as the sandbox agent bridge's proxy monitor does. exec_remote_poll_wait, which an awaitable exec_remote sends when INSPECT_EXEC_REMOTE_SERVER_WAIT is on, does not count, so a run with no streaming exec_remote never opens the window. Two warnings in the runner's log report it, the second logged by the first connection after the window:
refuse_execs: refusing new sandbox connections for 8.0 s
refuse_execs: window closed, refused 3 connections: exec_remote_poll=1 other=2
A refused connection is labelled with its JSON-RPC method if a request is found in the first 64 KiB written to it, else other. What the provider then does depends on its version: before its fix for a status without details the command fails at once with KeyError: 'details'; with the fix it is sent again up to four times, 15-19 s after the first attempt at the latest, so an 8 s window is survived and a much longer one is not.
The patch is process-wide and stays until the process ends, so every sample shares the one window: use it in single-sample runs. It depends on internals of the provider and of the kubernetes client:
k8s_sandbox._pod.op.stream being how the provider opens every connection;is_open(), then takes the status with read_channel);WSClient sets in its constructor (35.0.0 and 37.0.1
are covered).tests/test_k8s_faults_contract.py pins these against the installed libraries. When one changes, it shows as a RuntimeError at setup, a sample error from inside the provider, or a closing warning that never comes.
pip install inspect-test-utils
MIT. See LICENSE.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.