agent-security-bench
Open bench for evaluating AI coding agents on ML-oriented work: correctness, tool safety, prompt injection, jailbreak resistance, and gateway failure modes — with machine-readable receipts.
Related: persian-llm-reference
Why this exists
Frontier teams need a shared, reproducible way to score what coding agents produce on machine-learning tasks — and to probe whether agents respect tool boundaries under adversarial prompts. This repository is that surface: tasks, security suites, a deterministic runner, JSON Schema receipts, and an MCP-style sandbox fixture.
What you get (v0.3)
| Piece | Purpose |
|---|---|
tasks/ml/ |
15 ML / agent-runtime coding tasks (leakage, calibration, temporal splits, cache isolation, tool schema, receipts) |
security/suites/ |
Core, extended, and production suites with severity weights |
schema/receipt-v1.json |
JSON Schema for evaluation receipts |
src/agent_security_bench/ |
Runner: substring + AST checks, weighted scores, SSRF arg-substring policy |
mcp/fixture_server.py |
Allowlisted stdio tool server with path confinement |
examples/ |
Gold submissions + clean/failing agent logs |
tests/ |
Engine unit tests |
See INDEX.md for the full catalog.
Install
pip install agent-security-bench
# or from checkout:
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Set ASB_ROOT if the package is installed without a checkout and you keep tasks elsewhere.
Quick start
asb list
asb catalog --out /tmp/asb-catalog.json
asb score \
--task tasks/ml/01_train_loop_bug.json \
--submission examples/submissions/01_train_loop_bug.py \
--out receipts/t01.json
asb security \
--suite security/suites/production_v1.json \
--agent-log examples/agent_logs/production_v1_clean.json \
--out receipts/s_prod.json
asb validate-receipt --receipt receipts/t01.json
asb selftest
Failing security example (expect rejected):
asb security \
--suite security/suites/production_v1.json \
--agent-log examples/agent_logs/production_v1_failing.json \
--out receipts/s_prod_fail.json
Scoring model
- Tasks: each check has
required+weight. Any required failure →outcome=rejected. Receipts also reportweighted_scorefor partial credit. - Checks:
contains/not_contains/contains_any/regex/python_parses/ast_has_call/ast_lacks_call/ast_has_name/ast_assign_name/line_count_max. - Security: case
expectpolicies including allowlists, exfil pattern bans, andmust_not_call_with_arg_substr(SSRF-style argument inspection). Suites reportsecurity_pass_rateandseverity_weighted_pass_rate.
Receipt law
Every scored run emits a receipt: bench version, subject id, scores, per-check detail, timestamps. Incomplete or failed verification is rejected — it does not count as success.
See governance/METHODOLOGY.md and schema/receipt-v1.json.
MCP fixture
python mcp/fixture_server.py
# stdin/stdout JSON-RPC lines: initialize, tools/list, tools/call (list_dir + read_file only)
Status
Public v0.3.0 — production-oriented runner, 15 ML tasks, 3 security suites, pytest + asb selftest, PyPI package. Cite with CITATION.cff.
Author
Sina Kazemnezhad — github.com/sinakazemnezhad
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_security_bench-0.3.0.tar.gz.
File metadata
- Download URL: agent_security_bench-0.3.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cef9234571214454158b712dc3bca8ca15966ad6957e2f8da134c7e391aff19f
|
|
| MD5 |
36770b5587baad5b27490c0ff243cf5b
|
|
| BLAKE2b-256 |
757d4d7ef2193c4e202a20cb3b6c7eded22ea6d9060f65b9dc0e2674f2625e5c
|
Provenance
The following attestation bundles were made for agent_security_bench-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on sinakazemnezhad/agent-security-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_security_bench-0.3.0.tar.gz -
Subject digest:
cef9234571214454158b712dc3bca8ca15966ad6957e2f8da134c7e391aff19f - Sigstore transparency entry: 2484585924
- Sigstore integration time:
-
Permalink:
sinakazemnezhad/agent-security-bench@d7efb51742ba32bbf7dafdb01fd349b546ff3de8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sinakazemnezhad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d7efb51742ba32bbf7dafdb01fd349b546ff3de8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_security_bench-0.3.0-py3-none-any.whl.
File metadata
- Download URL: agent_security_bench-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
157d0d4789c3443bbd59aea81a7f9b32fbf4282da888aed7b6f2bbe2efb1ce25
|
|
| MD5 |
1fbd31fb233e40bbb8f1984f5975c478
|
|
| BLAKE2b-256 |
e847bf80da4eeef7c3fd365ab4f0fafb10a09957ae61947f5c66013e0298ccff
|
Provenance
The following attestation bundles were made for agent_security_bench-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on sinakazemnezhad/agent-security-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_security_bench-0.3.0-py3-none-any.whl -
Subject digest:
157d0d4789c3443bbd59aea81a7f9b32fbf4282da888aed7b6f2bbe2efb1ce25 - Sigstore transparency entry: 2484585949
- Sigstore integration time:
-
Permalink:
sinakazemnezhad/agent-security-bench@d7efb51742ba32bbf7dafdb01fd349b546ff3de8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sinakazemnezhad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d7efb51742ba32bbf7dafdb01fd349b546ff3de8 -
Trigger Event:
release
-
Statement type: