MCP Hub
Back to servers

agentaudit

Security scanner for AI packages — MCP server + CLI

Updated
Feb 26, 2026

Quick Install

npx -y agentaudit
AgentAudit -- Security scanner for AI packages

🛡️ AgentAudit

Security scanner for AI agent packages — CLI + MCP server

Scan MCP servers, AI skills, and packages for vulnerabilities, prompt injection, and supply chain attacks. Powered by regex static analysis and deep LLM audits.

AgentAudit npm version Trust Registry License


📑 Table of Contents


What is AgentAudit?

AgentAudit is a security scanner purpose-built for the AI package ecosystem. It works in two modes:

  1. CLI tool — Run agentaudit in your terminal to discover and scan MCP servers installed in your AI editors
  2. MCP server — Add to Claude Desktop, Cursor, or Windsurf so your AI agent can audit packages on your behalf

It checks packages against the AgentAudit Trust Registry — a shared, community-driven database of security findings — and can perform local scans ranging from fast regex analysis to deep LLM-powered 3-pass audits.


🚀 Quick Start

AgentAudit CLI — discover and scan

Option A: CLI (recommended)

# Install globally (or use npx agentaudit)
npm install -g agentaudit

# Discover MCP servers configured in your AI editors
agentaudit

# Quick scan — clones repo, checks code with regex patterns (~2s)
agentaudit scan https://github.com/owner/repo

# Deep audit — clones repo, sends code to LLM for 3-pass analysis (~30s)
agentaudit audit https://github.com/owner/repo

# Registry lookup — check if a package has been audited before (no cloning)
agentaudit lookup fastmcp

Example output:

  ⛨ AgentAudit v3.12.9  │  my-scanner #3 · 280pts · 19 audits

  Discovering MCP servers in your AI editors...

•  Scanning Cursor  ~/.cursor/mcp.json    found 3 servers

├──  tool   supabase-mcp              ✔ ok
│   SAFE  Risk 0  https://agentaudit.dev/skills/supabase-mcp
├──  tool   browser-tools-mcp         ✔ ok
│   ⚠ not audited  Run: agentaudit audit https://github.com/nichochar/browser-tools-mcp
└──  tool   filesystem                ✔ ok
│   SAFE  Risk 0  https://agentaudit.dev/skills/filesystem

  Looking for general package scanning? Try `pip audit` or `npm audit`.

Enhanced banner: When logged in, the banner shows your agent name, rank, points, and audit count. Run agentaudit setup to create an account.

Option B: MCP Server in your AI editor

Add AgentAudit as an MCP server — your AI agent can then discover, scan, and audit packages using its own LLM. No extra API key needed.

Claude Desktop~/.claude/mcp.json
{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}
Cursor.cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}
Windsurf~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}
Continue.dev~/.continue/config.json

Add to the mcpServers section of your existing config:

{
  "mcpServers": [
    {
      "name": "agentaudit",
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  ]
}
Zed~/.config/zed/settings.json
{
  "context_servers": {
    "agentaudit": {
      "command": {
        "path": "npx",
        "args": ["-y", "agentaudit", "--stdio"]
      }
    }
  }
}

Then ask your agent: "Check which MCP servers I have installed and audit any unaudited ones."


📋 Commands Reference

Scan & Audit

CommandDescriptionExample
agentauditDiscover MCP servers (default, same as discover)agentaudit
agentaudit discoverFind MCP servers in Cursor, Claude, VS Code, Windsurfagentaudit discover
agentaudit discover --quickDiscover + auto-scan all serversagentaudit discover --quick
agentaudit discover --deepDiscover + interactively select servers to deep-auditagentaudit discover --deep
agentaudit scan <url>Quick regex-based static scan (~2s)agentaudit scan https://github.com/owner/repo
agentaudit scan <url> --deepDeep audit (same as audit)agentaudit scan https://github.com/owner/repo --deep
agentaudit audit <url>Deep LLM-powered 3-pass audit (~30s)agentaudit audit https://github.com/owner/repo
agentaudit lookup <name>Look up package in trust registryagentaudit lookup fastmcp

Community

CommandAliasDescription
agentaudit dashboarddashInteractive full-screen TUI with 5 tabs (Overview, Leaderboard, Benchmark, Activity, Search)
agentaudit leaderboardlbTop contributors ranking (pipe-friendly)
agentaudit benchmarkbenchLLM model audit performance comparison
agentaudit activitymyYour recent audits & findings
agentaudit search <query>findSearch packages in the registry by name, ASF-ID, or hash

Configuration

CommandAliasDescription
agentaudit modelInteractive LLM provider + model configuration
agentaudit setuploginSign in with GitHub OAuth or paste API key manually
agentaudit statuswhoamiShow current config, API keys, and personal stats

Global Flags

FlagDescription
--jsonOutput machine-readable JSON to stdout
--quiet / -qSuppress banner and decorative output
--no-colorDisable ANSI colors (also respects NO_COLOR env var)
--model <name>Override LLM model for this run
--no-uploadSkip uploading report to registry
--exportExport audit payload as markdown
--debugShow raw LLM response on parse errors
--help / -hShow help text
-v / --versionShow version

Exit Codes

CodeMeaning
0Clean — no findings detected, or successful lookup
1Findings detected
2Error (clone failed, network error, invalid args)

⚖️ Quick Scan vs Deep Audit

Quick Scan (scan)Deep Audit (audit)
Speed~2 seconds~30 seconds
MethodRegex pattern matchingLLM-powered 3-pass analysis
API key neededNoYes (Anthropic, OpenAI, or OpenRouter)
False positivesHigher (regex limitations)Very low (context-aware)
DetectsCommon patterns (injection, secrets, eval)Complex attack chains, AI-specific threats, obfuscation
Best forQuick triage, CI pipelinesCritical packages, pre-production review

Tip: Use agentaudit scan <url> --deep to run a deep audit via the scan command.


🔌 MCP Server

When running as an MCP server, AgentAudit exposes the following tools to your AI agent:

ToolDescription
audit_packageDeep LLM-powered audit of a repository
check_registryLook up a package in the trust registry
submit_reportUpload audit findings to the registry
discover_serversFind MCP servers in local editor configs

Workflow

User asks agent to install a package
         │
         ▼
Agent calls check_registry(package_name)
         │
    ┌────┴────┐
    │         │
  Found    Not Found
    │         │
    ▼         ▼
 Return    Agent calls audit_package(repo_url)
 score        │
              ▼
         LLM analyzes code (3-pass)
              │
              ▼
         Agent calls submit_report(findings)
              │
              ▼
         Return findings + risk score

🎯 What It Detects

Core Security

Command Injection Credential Theft Data Exfiltration SQL Injection Path Traversal Unsafe Deserialization

AI-Specific

Prompt Injection Jailbreak Agent Impersonation Capability Escalation Context Pollution Hidden Instructions

MCP-Specific

Tool Poisoning Desc Injection Resource Traversal Unpinned npx Broad Permissions

Persistence & Obfuscation

Crontab Mod Shell RC Inject Git Hook Abuse Zero-Width Chars Base64 Exec ANSI Escape


🧠 How the 3-Pass Audit Works

The deep audit (agentaudit audit) uses a structured 3-phase LLM analysis — not a single-shot prompt, but a rigorous multi-pass process:

PhaseNameWhat Happens
1🔍 UNDERSTANDRead all files and build a Package Profile: purpose, category, expected behaviors, trust boundaries. No scanning yet — the goal is to understand what the package should do before looking for what it shouldn't.
2🎯 DETECTEvidence collection against 50+ detection patterns across 8 categories (AI-specific, MCP, persistence, obfuscation, cross-file correlation). Only facts are recorded — no severity judgments yet.
3⚖️ CLASSIFYEvery finding goes through a Mandatory Self-Check (5 questions), Exploitability Assessment, and Confidence Gating. HIGH/CRITICAL findings must survive a Devil's Advocate challenge and include a full Reasoning Chain.

Why 3 passes? Single-pass analysis is the #1 cause of false positives. By separating understanding → detection → classification:

  • Phase 1 prevents flagging core functionality as suspicious (e.g., SQL execution in a database tool)
  • Phase 2 ensures evidence is collected without severity bias
  • Phase 3 catches false positives before they reach the report

This architecture achieved 0% false positives on our 11-package test set, down from 42% in v2.


🔄 CI/CD Integration

AgentAudit is designed for CI pipelines with proper exit codes and JSON output:

# GitHub Actions example
- name: Scan MCP servers
  run: |
    npx agentaudit scan https://github.com/org/mcp-server --json --quiet > results.json
    # Exit code 1 = findings detected → fail the build
# Shell scripting
agentaudit scan https://github.com/owner/repo --json --quiet 2>/dev/null
if [ $? -eq 1 ]; then
  echo "Security findings detected!"
  exit 1
fi

JSON Output Examples

# Scan with JSON output
agentaudit scan https://github.com/owner/repo --json
{
  "slug": "repo",
  "url": "https://github.com/owner/repo",
  "findings": [
    {
      "severity": "high",
      "title": "Command injection risk",
      "file": "src/handler.js",
      "line": 42,
      "snippet": "exec(`git ${userInput}`)"
    }
  ],
  "fileCount": 15,
  "duration": "1.8s"
}
# Registry lookup with JSON
agentaudit lookup fastmcp --json

Coming soon: --fail-on <severity> flag to set minimum severity threshold for non-zero exit (e.g., --fail-on high ignores low/medium findings).


📊 Dashboard & Community

AgentAudit includes a full-screen interactive dashboard and standalone community commands.

Interactive Dashboard

agentaudit dashboard    # or: agentaudit dash

5-tab TUI with keyboard navigation (←→ tabs, ↑↓ scroll, 1-5 jump, q quit):

TabContent
[1] OverviewYour profile (rank, points, audits, severity breakdown) + registry stats
[2] LeaderboardTop contributors with medal rankings and bar charts
[3] BenchmarkLLM model audit performance comparison
[4] ActivityYour recent audits and findings
[5] SearchInteractive package search (type to search, Enter to submit)

Standalone Commands

All community commands work without the dashboard (pipe-friendly, supports --json):

agentaudit leaderboard              # Top contributors
agentaudit leaderboard --tab monthly --json   # Monthly rankings as JSON
agentaudit benchmark                # Model comparison
agentaudit activity                 # Your recent audits & findings
agentaudit search fastmcp           # Search registry by name/ASF-ID
agentaudit search fastmcp --json    # Machine-readable search results

⚙️ Configuration

Credentials

AgentAudit stores credentials in ~/.config/agentaudit/credentials.json (or $XDG_CONFIG_HOME/agentaudit/credentials.json).

Run agentaudit setup to sign in with GitHub or paste an API key, or set via environment:

export AGENTAUDIT_API_KEY=asf_your_key_here

LLM Providers (13 supported)

AgentAudit supports 13 LLM providers for deep audits. Set one API key — the CLI auto-detects it. Use agentaudit model to choose provider + model interactively, or agentaudit status to check your setup.

VariableProviderDefault Model
ANTHROPIC_API_KEYAnthropic (Claude)claude-sonnet-4-20250514
GEMINI_API_KEYGoogle (Gemini)gemini-2.5-flash
OPENAI_API_KEYOpenAI (GPT-4o)gpt-4o
DEEPSEEK_API_KEYDeepSeekdeepseek-chat
MISTRAL_API_KEYMistralmistral-large-latest
GROQ_API_KEYGroqllama-3.3-70b-versatile
XAI_API_KEYxAI (Grok)grok-3
TOGETHER_API_KEYTogether AILlama-3.3-70B-Instruct-Turbo
FIREWORKS_API_KEYFireworks AIllama-v3p3-70b-instruct
CEREBRAS_API_KEYCerebrasllama-3.3-70b
ZAI_API_KEYZhipu AI (GLM)glm-4.7
OPENROUTER_API_KEYOpenRouteranthropic/claude-sonnet-4

Other Environment Variables

VariableDescription
AGENTAUDIT_API_KEYAPI key for registry uploads (or use agentaudit setup)
AGENTAUDIT_MODELOverride LLM model (same as --model flag)
NO_COLORDisable ANSI colors (no-color.org)

Provider priority: Set preferred_provider via agentaudit model, or the CLI picks the first available key. Override per-run with --model <name>.


📦 Requirements

  • Node.js ≥ 18.0.0
  • Git (for cloning repositories during scan/audit)

❓ FAQ

How do I set up AgentAudit?

npm install -g agentaudit
agentaudit setup

Or use without installing: npx agentaudit

Do I need an API key?

  • Quick scan (scan): No API key needed — runs locally with regex
  • Deep audit (audit): Needs an LLM API key (see below)
  • Registry lookup (lookup): No key needed for reading; key needed for uploading reports
  • MCP server: No extra key needed — uses the host editor's LLM

Setting up your LLM key for deep audits

The audit command supports 13 LLM providers. Set one API key and AgentAudit auto-detects it:

# Set any one of these (Anthropic recommended)
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
export GEMINI_API_KEY=...
export DEEPSEEK_API_KEY=...
# ... or any of the 13 supported providers (see Configuration section)

Interactive setup:

agentaudit model     # 2-step menu: pick provider → pick model
agentaudit status    # check which keys are set + current config

Override per-run:

agentaudit audit https://github.com/owner/repo --model gpt-4o

Troubleshooting: If you see API error: Incorrect API key, double-check your key is valid and has credits. Use --debug to see the full API response.

What data is sent externally?

  • Registry lookups: Package name/slug is sent to agentaudit.dev to check for existing audits
  • Report uploads: Audit findings are uploaded to the public registry (requires API key)
  • Deep audits: Source code is sent to Anthropic or OpenAI for LLM analysis
  • Quick scans: Everything stays local — no data leaves your machine

Can I use it offline?

Quick scans (agentaudit scan) work fully offline after cloning. Registry lookups and deep audits require network access.

Can I use it as an MCP server without the CLI?

Yes! npx agentaudit starts the MCP server when invoked by an editor. The CLI and MCP server are the same package — behavior is determined by how it's called.

How does discover know which editors I use?

It checks standard config file locations for Claude Desktop, Cursor, VS Code, and Windsurf. It also checks the current working directory for project-level .cursor/mcp.json and .vscode/mcp.json.


🔗 Related

ProjectDescription
🌐agentaudit.devTrust Registry -- browse packages, findings, leaderboard
🛡️agentaudit-skillAgent Skill -- pre-install security gate for Claude Code, Cursor, Windsurf
agentaudit-github-actionGitHub Action -- CI/CD security scanning
📚agentaudit-cliThis repo -- CLI + MCP server source
🐛Report IssuesBug reports and feature requests

📄 License

AGPL-3.0 — Free for open source use. Commercial license available for proprietary integrations.


Protect your AI stack. Scan before you trust.

Trust Registry · Leaderboard · Report Issues

Reviews

No reviews yet

Sign in to write a review