agent-security-bench
Agent Security Evaluation Kit — score agent code and refuse unsafe tools.
Deterministic evaluation for AI coding agents on ML-oriented work and agent-security policies (prompt injection, jailbreak, MCP/tool overreach, SSRF, multi-tenant isolation), with machine-readable receipts.
Related: persian-llm-reference
One job: score what an agent produced, and prove whether it respected tool boundaries.
Why this exists
Frontier teams buy Agent Execution Assurance — not another chat wrapper. They need a shared way to:
- Score coding-agent artifacts on real ML failure modes (leakage, calibration, temporal splits, cache isolation).
- Regression-test tool policy under adversarial prompts (injection, confused deputy, SSRF args).
- Emit receipts that CI and buyers can verify —
acceptedonly when required checks pass.
What you get (v0.4)
| Piece | Purpose |
|---|---|
tasks/ml/ |
23 ML / agent-runtime coding tasks |
security/suites/ |
Core, extended, and production suites with severity weights |
schema/receipt-v1.json |
JSON Schema for evaluation receipts |
src/agent_security_bench/ |
AST + weighted checks, trace adapters, leaderboard batch |
mcp/fixture_server.py |
Allowlisted stdio tool server with path confinement |
examples/ |
Gold submissions, agent logs, live session traces |
docs/DEMAND_MAP_2026.md |
Buyer demand map → suite cases |
tests/ |
Engine + adapter unit tests |
See INDEX.md for the full catalog. Demand → buyer map: docs/DEMAND_MAP_2026.md.
Install
pip install -U agent-security-bench==0.4.0
asb selftest
From checkout:
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Tasks/suites/schema ship inside the wheel. Override with ASB_ROOT only if you keep a custom data tree.
Five-minute score
asb list
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 leaderboard --out-dir receipts/leaderboard
Terminal walkthrough script (no extra deps):
bash scripts/five_minute_score.sh
Quick start (extended)
asb catalog --out /tmp/asb-catalog.json
asb score-trace \
--suite security/suites/core_v1.json \
--trace examples/traces/mcp_session_pass.jsonl \
--out receipts/trace_pass.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_score. - Checks: string/regex,
python_parses, AST predicates (ast_has_call, …). - Security: allowlists, exfil bans, SSRF
must_not_call_with_arg_substr. - Traces: OpenAI-style / Anthropic tool_use / generic MCP JSONL → agent log → same suite scorer.
- Leaderboard: task × agent matrix →
leaderboard.json.
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: initialize, tools/list, tools/call (list_dir + read_file only)
Status
Public v0.4.0 — Agent Security Evaluation Kit: wheel-bundled data, frontier task pack, live-trace adapter, leaderboard batch, demand map. Cite with CITATION.cff.
This kit does not train models, host GPUs, or replace a certified red team. It is a reproducible regression surface for agent evaluation and tool-policy scoring.
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.4.0.tar.gz.
File metadata
- Download URL: agent_security_bench-0.4.0.tar.gz
- Upload date:
- Size: 32.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72573b3920c6812e3381d48f0bdec4a9c5ebe06fb6e30f569028bfb322946a63
|
|
| MD5 |
9fb7047b282d7f4cb56cb00ff66a5c77
|
|
| BLAKE2b-256 |
5e1f5f4a74a7c1efe437cce963426f26120f45c409c7d1b35b6a5ece2a281479
|
Provenance
The following attestation bundles were made for agent_security_bench-0.4.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.4.0.tar.gz -
Subject digest:
72573b3920c6812e3381d48f0bdec4a9c5ebe06fb6e30f569028bfb322946a63 - Sigstore transparency entry: 2484631570
- Sigstore integration time:
-
Permalink:
sinakazemnezhad/agent-security-bench@aa081ff9b6a90b0f4edcc3e6236e3b4c0f8b3fb0 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/sinakazemnezhad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@aa081ff9b6a90b0f4edcc3e6236e3b4c0f8b3fb0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_security_bench-0.4.0-py3-none-any.whl.
File metadata
- Download URL: agent_security_bench-0.4.0-py3-none-any.whl
- Upload date:
- Size: 47.6 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 |
49b7e0ddb3cd25d75f05f3572ba7531a10868f6eb05d52510548be6c16f7a615
|
|
| MD5 |
d76fe30833e508763f1a607a9fed3d17
|
|
| BLAKE2b-256 |
565eeaf9c97a267e1d9a6c0377e11f1cef82764dd8eb75dbafc69f7472c3bb69
|
Provenance
The following attestation bundles were made for agent_security_bench-0.4.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.4.0-py3-none-any.whl -
Subject digest:
49b7e0ddb3cd25d75f05f3572ba7531a10868f6eb05d52510548be6c16f7a615 - Sigstore transparency entry: 2484631662
- Sigstore integration time:
-
Permalink:
sinakazemnezhad/agent-security-bench@aa081ff9b6a90b0f4edcc3e6236e3b4c0f8b3fb0 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/sinakazemnezhad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@aa081ff9b6a90b0f4edcc3e6236e3b4c0f8b3fb0 -
Trigger Event:
release
-
Statement type: