Skip to main content

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

validate PyPI

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:

  1. Score coding-agent artifacts on real ML failure modes (leakage, calibration, temporal splits, cache isolation).
  2. Regression-test tool policy under adversarial prompts (injection, confused deputy, SSRF args).
  3. Emit receipts that CI and buyers can verify — accepted only 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 report weighted_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

agent_security_bench-0.4.0.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_security_bench-0.4.0-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

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

Hashes for agent_security_bench-0.4.0.tar.gz
Algorithm Hash digest
SHA256 72573b3920c6812e3381d48f0bdec4a9c5ebe06fb6e30f569028bfb322946a63
MD5 9fb7047b282d7f4cb56cb00ff66a5c77
BLAKE2b-256 5e1f5f4a74a7c1efe437cce963426f26120f45c409c7d1b35b6a5ece2a281479

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_security_bench-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_security_bench-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49b7e0ddb3cd25d75f05f3572ba7531a10868f6eb05d52510548be6c16f7a615
MD5 d76fe30833e508763f1a607a9fed3d17
BLAKE2b-256 565eeaf9c97a267e1d9a6c0377e11f1cef82764dd8eb75dbafc69f7472c3bb69

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page