Agent Stress Lab
Agent Stress Lab is a CLI harness for agents that you already run. It sends test cases to an agent, forces failures at its tool boundary, and grades the result. It compares two agent versions and gives CI a pass or fail result. The harness does not need a web server or an OpenAI key. The target agent uses its own model.
Install
Use Python 3.12 or newer. Install the public package in a virtual environment.
python -m pip install agent-stress-lab
asl --help
The package supplies the CLI. The repository supplies the refund fixture and the full target protocol.
First run
Use uv to run the fixture from the repository.
If uv is not on PATH, use ./.venv/bin/uv in this checkout.
uv sync --locked
uv run --locked asl run \
--target examples/refund/target.toml \
--suite examples/refund/suite.yaml \
--output results/refund.json \
--html results/refund.html \
--junit results/refund.xml
The fixture suite reports nine passes, six faults that fired, and nine safety audits. It includes crashes after a refund and after an approval. The fixture sets the approval decision in each case. It does not ask a person for a decision. The fixture agent uses fixed rules. Its result shows the harness fault paths. It does not measure a model.
To see a real regression in the fixture, run the changed target. Then compare the two result files.
uv run --locked asl run \
--target examples/refund/target_regressed.toml \
--suite examples/refund/suite.yaml \
--output results/refund_regressed.json
uv run --locked asl compare results/refund.json results/refund_regressed.json
The changed target fails the timeout case. asl compare names that case and
returns exit code 1. asl run also returns exit code 1 if a case fails. It
writes the result files before it returns.
Connect an agent
A target file names a Python function, a JSON-lines process, or an HTTP endpoint. The target protocol gives the exact formats. A Python target has this small entry point:
def run(request, tools):
result = tools.call("lookup", {"id": request["input"]["id"]}, "call-1")
return {"answer": str(result), "outcome": "resolved"}
The agent can call its own model inside that function. The harness does not
replace the agent. For tool faults, the agent must send tool calls through the
supplied tools client. A target environment receives those calls and gives
the harness the final state. An optional auditor examines that state after
each trial. The harness starts a new process and environment for each trial.
An HTTP target can run black-box tests against an existing service. It can receive input faults. The agent returns an answer, outcome, and trace. A separate endpoint supplies the observed state. Tool faults need a Python or process target with a tool boundary.
Cases and results
Each YAML case states the input, initial state, optional fault, and assertions. Assertions can read the answer, outcome, final state, trace, or metrics. The grader also fails a case if its planned fault never fires. A safety audit finding fails a case. The result states how many trials received a safety audit. A pass without an audit does not mean that no unsafe action occurred.
The harness supports an input attack, tool timeout, tool error, replaced tool result, and process death after a tool effect. The process target restarts once after that crash. Its workspace and tool environment survive the restart.
Use --repeat N to run each case more than once. Use --case ID to run one
case. The JSON result includes each trial, its trace, its final state, its
assertions, and hashes of the target and suite files. The static HTML report
needs no server. The JUnit file works in CI.
uv run --locked asl report results/refund.json \
--html results/refund.html --junit results/refund.xml
Development
uv sync --locked --extra dev
uv run --locked --extra dev pytest -q
uv run --locked --extra dev ruff check asl tests examples/refund
The HTML specification describes the CLI harness and the next work for a real agent.
Metadata
Release files for agent-stress-lab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_stress_lab-0.1.0.tar.gz | 26.3 kB | With provenance | Details for agent_stress_lab-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_stress_lab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agent_stress_lab-0.1.0-py3-none-any.whl |
Total release size: 45.4 kB
Release files / agent_stress_lab-0.1.0.tar.gz
| Download URL | agent_stress_lab-0.1.0.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81704055999d42706638ca58e480ce0cc509d0d3ed6896c3e7e8da2a08f55bb9
|
|
BLAKE2b-256 checksum How to use checksums |
0aec3426ab816ffd74086e31f71d0934121d4cee109244b9eb18ef15979d0751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / agent_stress_lab-0.1.0-py3-none-any.whl
| Download URL | agent_stress_lab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9758b88daaa3f3cd5aa98bb39ea87c906c46ed7b8e2ae88862bb339bee15aebf
|
|
BLAKE2b-256 checksum How to use checksums |
bdb68b34ae1e94a20f28dc6782cae244822b3dde8023fec7427177eb55c7f48c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for agent-stress-lab 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_stress_lab-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.