Skip to main content Switch to mobile version agent-scorecard 0.1.0 Score how safely an AI agent codebase is built: tool tiers, approval gates, audit, secrets, budgets, untrusted input, evals.
pip install agent-scorecard Copy PIP instructions
How safely is your AI agent built? agent-scorecard reads an agent codebase and scores it 0 to 100 against 27 checks across the seven layers that keep production agents out of trouble: tool boundaries, human approval gates, audit trail, secrets and egress, budgets, untrusted input, and evals.
$ agent-scorecard scan ./my-agent # example output # Agent Safety Scorecard: my-agent **Score: 77/100 · Grade C** (capped at C by a missing critical control) | # | Layer | Score | | |---|--------------------------------|------:|------------| | 1 | Tool boundaries | 54 | █████░░░░░ | | 2 | Human approval gates | 100 | ██████████ | | 3 | Audit trail and observability | 92 | █████████░ | | 4 | Secrets and egress | 62 | ██████░░░░ | | 5 | Budgets and limits | 100 | ██████████ | | 6 | Untrusted input handling | 57 | ██████░░░░ | | 7 | Evals, testing and rollback | 71 | ███████░░░ | ## Critical gaps - **UI-01 Untrusted content is marked as data.** No handling of untrusted content found. ... Every finding links to file:line evidence, and every gap comes with the fix.
Framework-aware. Understands the Claude Agent SDK, LangGraph, CrewAI, OpenAI Agents SDK, AutoGen, LangChain, MCP servers and MCP client configs, and agents built straight on the Anthropic, OpenAI or Bedrock APIs, in Python, TypeScript and Go.
Runs as a CLI or an MCP server. Ask your coding agent to score the repo it's working in.
Safe to point at anything. It only reads. It never imports, executes or installs code from the target, never follows symlinks, and makes no network calls.
Zero runtime dependencies. Standard library only, so its own supply chain is trivial to audit.
$ pipx install agent-scorecard # or: pip install agent-scorecard $ agent-scorecard --version Or run from a checkout with uv run agent-scorecard ... or PYTHONPATH=src python -m agent_scorecard ....
$ agent-scorecard scan PATH # Markdown scorecard to stdout $ agent-scorecard scan PATH --format json # machine-readable, for dashboards $ agent-scorecard scan PATH --out SCORECARD.md # write to a file $ agent-scorecard scan PATH --fail-under 70 # exit 1 below 70: use it as a CI gate $ agent-scorecard scan PATH --only AG-01,AG-03 # run a subset of checks $ agent-scorecard explain AG-03 # why a check matters and how to fix it $ agent-scorecard rubric # the full rubric as Markdown In CI
# .github/workflows/agent-scorecard.yml on: [pull_request] jobs: scorecard: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: pipx run agent-scorecard scan . --fail-under 70 --out scorecard.md - run: cat scorecard.md >> "$GITHUB_STEP_SUMMARY" if: always() As an MCP server
{ "mcpServers": { "agent-scorecard": { "command": "agent-scorecard", "args": ["mcp"] } } } Tools: scan_repository(path, format?, checks?), list_checks(), explain_check(check_id), get_rubric(). All are annotated read-only. The server speaks MCP over stdio (protocol versions 2024-11-05 through 2025-06-18) and is tested against the official MCP Python client.
27 checks, 7 layers. RUBRIC.md has the full text of each: why it matters, what the scanner looks for, what earns full and partial credit, and how to fix it.
Each check is PASS (2 points), PARTIAL (1) or MISSING (0), weighted by severity (critical ×3, high ×2, medium ×1). Checks that can't apply are N/A and left out: sandboxing when nothing executes commands, or the approval layer in a chat-only app that never calls tools. A layer's score is its share of possible points; the overall score is the plain average of the layers, because a perfect audit trail doesn't make up for having no approval gate. Grades run A (85+) to F (under 40), and any missing critical control caps the grade at C.
scorecards/ holds scorecards for seven real agent repositories, with commit hashes so anyone can reproduce them.
repo on disk ──► RepoIndex ──► ScanContext ──► 27 checks ──► Scorecard ──► Markdown / JSON / MCP (walk, classify, (frameworks, (registry, (weighted mask comments) tool use, evidence) layers, cap) agent files) repo.py walks the tree once (skipping vendored and generated directories, symlinks, binaries and files over 512 KB), classifies each file as code, config, CI or docs, and flags tests, examples and developer tooling so they don't count as production controls. Comments and docstrings are masked: a comment saying "we fail closed" is not a control. Prompts in triple-quoted strings are kept, because that is where untrusted-data labels live.
frameworks.py detects frameworks from manifests and imports. Checks use it, along with "does this code call tools at all?" and "which files talk to a model?", to decide what applies and to keep generic words such as max_steps from counting outside agent code.
checks/ holds one module per layer. Each check is a small function registered with its rubric text, so the scanner and RUBRIC.md can't drift: RUBRIC.md is generated from the registry, and a test fails if it is out of date.
Signals that only mean something together are matched by proximity. An HMAC counts toward "approvals are bound to the action" only within a few lines of approval code, not anywhere in the same 3,000-line file.
Anti-patterns (bypassPermissions, shell=True, committed keys, unpinned npx -y MCP servers) are reported as negative evidence. Secret values are redacted in every report.
This is a static scan. It shows whether a control is present, not that it works, and it reads names and structure, not intent. A PASS means the signal is there; a MISSING can be a control written in a way the scanner doesn't recognise yet. The useful output is the list of gaps to look at, not the number. Large repos take a few seconds (about 18 s for 2,000 files).
For a review that goes past signals (threat model, data flows, tested controls, a fix plan), see the paid review.
$ uv run --with pytest pytest # or: python -m pytest $ PYTHONPATH=src python -m agent_scorecard rubric --out RUBRIC.md # after changing a check Add a check by writing a function in the right checks/ .py with the @check(...) decorator, then add PASS and MISSING cases to tests/test_checks.py (a test enforces both) and regenerate RUBRIC.md.
Both files in this release have provenance metadata.
MIT View SPDX License List
ai-agents claude-agent-sdk crewai langgraph llm mcp security static-analysis
Development Status 3 - Alpha
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Software Development :: Quality Assurance
Release files for agent-scorecard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 158.7 kB
Release files / agent_scorecard-0.1.0.tar.gz
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Release files / agent_scorecard-0.1.0-py3-none-any.whl
Security for agent-scorecard 0.1.0
Both files in this release have been uploaded with provenance metadata.
With provenance agent_scorecard-0.1.0.tar.gz Nov 24, 2026
Attestation for agent_scorecard-0.1.0.tar.gz
A 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.
Release history Release notifications | RSS feed
Nov 24, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




