Skip to main content

Behavioral security scanner for AI agent skills and MCP tools โ€” scan, certify, and govern.

Project description

Aegis Audit ๐Ÿฆž

Behavioral security scanner for AI agent skills, like on OpenClaw, and MCP tools.

The "SSL certificate" for AI agent skills โ€” scan, certify, and govern before you trust.

Aegis answers the question every agent user should ask: "What can this skill actually do, and should I trust it?"

License: AGPL-3.0


Why Aegis?

AI agents install and run skills with broad system access. Today, you're trusting them blindly. Aegis gives you:

  • Deterministic static analysis โ€” AST parsing + Semgrep + 15 specialized scanners. Same code = same report, every time.
  • Scope-resolved capabilities โ€” Not just "accesses the filesystem" but exactly which files, URLs, hosts, and ports.
  • Risk scoring โ€” 0โ€“100 composite score with CWE/OWASP-mapped findings and severity tiers.
  • Cryptographic proof โ€” Ed25519-signed lockfile with Merkle tree for tamper detection.
  • Optional LLM analysis โ€” Bring your own key (Gemini, Claude, OpenAI, Ollama, local).
Feature Basic Safety Summary Aegis Audit
Detection method LLM reads README AST + Semgrep + 15 scanners
Deterministic No Yes
Capabilities High-level categories Scope-resolved (files/URLs/ports)
Vulnerability detection None 700+ patterns, CWE-mapped
Secret scanning None 30+ token patterns
Obfuscation detection None Base64-exec, homoglyphs, stego
Tamper detection None Ed25519-signed Merkle tree
Fix suggestions None Actionable remediation per finding

Quick Start

1. Install

pip install aegis-audit

2. Scan a skill

# Scan the current directory (deterministic, no API key needed)
aegis scan --no-llm

# Scan a specific path
aegis scan ./some-skill --no-llm

Tip: All commands default to . (the current directory) when no path is given. Most users cd into a skill and run aegis scan from there.

3. (Optional) Add LLM analysis

# Interactive setup โ€” choose provider, model, paste API key
aegis setup

# Then scan with LLM enabled (it's on by default when configured)
aegis scan

aegis setup saves your config to ~/.aegis/config.yaml. You can also set an environment variable instead โ€” env vars always take priority over the config file:

export GEMINI_API_KEY=your-key        # or OPENAI_API_KEY, ANTHROPIC_API_KEY
aegis scan

4. Generate a signed lockfile

aegis lock

This runs a full scan and generates aegis.lock โ€” a cryptographically signed snapshot of the skill's security state. Commit it alongside the skill so consumers can verify nothing changed.

5. Verify a lockfile

aegis verify

Checks that the current code matches the signed aegis.lock. If any file was modified, the Merkle root won't match and verification fails.


CLI Reference

Command Description
aegis scan [path] Full security scan with risk scoring
aegis lock [path] Scan + generate signed aegis.lock
aegis verify [path] Verify lockfile against current code
aegis badge [path] Generate shields.io badge markdown
aegis setup Interactive LLM configuration wizard
aegis mcp-serve Start the MCP server (stdio transport)
aegis mcp-config Print MCP config JSON for Cursor / Claude Desktop
aegis version Show the Aegis version

All commands that take [path] default to . (current directory). Common flags: --no-llm (skip LLM), --json (CI output), -v (verbose). Run aegis scan --help (or aegis lock --help, etc.) for full flags.


LLM Setup

Aegis works fully offline with deterministic analysis. LLM analysis is optional โ€” it adds an AI second opinion on intent and risk but is never required.

Option A: Interactive setup (recommended)

aegis setup

This walks you through:

  1. Choose a provider โ€” Gemini, Claude, OpenAI, or a local server (Ollama, LM Studio, llama.cpp, vLLM)
  2. Pick a model โ€” curated list per provider, or enter a custom model ID
  3. Paste your API key โ€” hidden input, tested before saving

Config is saved to ~/.aegis/config.yaml. Run aegis setup again anytime to change it.

Option B: Environment variables

Set one of these and Aegis picks it up automatically:

Variable Provider
GEMINI_API_KEY Google Gemini
OPENAI_API_KEY OpenAI
ANTHROPIC_API_KEY Anthropic Claude

For local servers:

Variable Description
OLLAMA_HOST Ollama server URL (default: http://localhost:11434)
AEGIS_LOCAL_OPENAI_URL Any OpenAI-compatible server URL
AEGIS_LLM_PROVIDER Force a specific provider: openai, gemini, claude, ollama, local_openai

See the full README on GitHub for the complete list of model override variables.


We've established personas for code repositories that run with our deterministic checks, no LLM is required. Get to know our code personas:

Vibe Check Personas

Aegis assigns each scanned skill a persona based on deterministic analysis. The Vibe Check shows one of these:

๐Ÿ”ฅ Cracked Dev
10x engineer energy. Clean code, smart patterns, minimal permissions. The kind of skill you'd want to maintain.

โœ… LGTM
Looks good to me. Permissions match the intent, scopes are sane, nothing weird. Ship it.

๐ŸŒ Trust Me Bro
Polished on the outside, suspicious on the inside. Docs vs code mismatch or unusual permissions. Trust, but verify.

๐Ÿค” You Sure About That?
The intern special. Messy code, missing pieces, docs that overpromise. No malicious intent, but it needs a real review.

๐Ÿ’• Co-Dependent Lover
Tiny logic, huge dependency tree. Loves node_modules. Supply chain risk is real here.

๐Ÿ‘บ Permission Goblin
Wants everything: filesystem, network, secrets, the kitchen sink. Over-scoped and worth a closer look.

๐Ÿ Spaghetti Monster
Unreadable chaos. High complexity, hard to follow. Good luck auditing this.

๐Ÿ The Snake
Warning: This code might look clean, but it isn't. Do not use this skill, it is malicious by design.


Example Output

With LLM and verbose (aegis scan -v):

โ•ญโ”€ Aegis Security Audit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ AEGIS SECURITY AUDIT                                        โ”‚
โ”‚   Target: ./my-skill                                        โ”‚
โ”‚   Files:  8 (3 Python, 1 config, 4 other)                   โ”‚
โ”‚   Mode:   AST + LLM (gemini)                                โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Vibe Check โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   ๐Ÿค”  You Sure About That?                                  โ”‚
โ”‚   The intern special. Messy code, missing pieces,           โ”‚
โ”‚   docs that overpromise. No malicious intent, but it       โ”‚
โ”‚   needs a real review.                                      โ”‚
โ”‚   ####----------------  22/100 - LOW - minor observations   โ”‚
โ”‚   only                                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Trust Analysis โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   [ALERT]  The description claims capabilities that don't   โ”‚
โ”‚   match what the code provides - 5 mismatch(es) found.      โ”‚
โ”‚   [ALERT]  SKILL.md references 13 file(s) that don't exist  โ”‚
โ”‚   in the package.                                           โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

AST-only (no LLM, aegis scan --no-llm):

โ•ญโ”€ Aegis Security Audit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   Mode:   AST-only                                          โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Vibe Check โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   ๐Ÿค”  You Sure About That?                                  โ”‚
โ”‚   ####----------------  22/100 - LOW                         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Scan Complete โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   Report: ./aegis_report.json                                โ”‚
โ”‚   Run aegis lock to generate a signed lockfile.             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

What Gets Scanned

Scanner What It Detects
AST Parser 750+ Python function/method patterns across 15+ categories
Semgrep Rules 80+ regex rules for Python, JavaScript, and secrets
Secret Scanner API keys, tokens, private keys, connection strings (30+ patterns)
Shell Analyzer Pipe-to-shell, reverse shells, inline exec
JS Analyzer XSS, eval, prototype pollution, dynamic imports
Dockerfile Analyzer Privilege escalation, secrets in ENV/ARG, unpinned images
Config Analyzer Dangerous settings in YAML, JSON, TOML, INI
Social Engineering Misleading filenames, Unicode tricks, trust manipulation
Steganography Hidden payloads in images, homoglyph attacks
Shadow Module Detector Stdlib-shadowing files (os.py, sys.py in the skill)
Combo Analyzer Multi-capability attack chains (exfiltration, C2, ransomware)
Taint Analysis Source-to-sink data flows (commands, URLs, SQL, paths)
Complexity Analyzer Cyclomatic complexity warnings for hard-to-audit functions
Skill Meta Analyzer SKILL.md vs. actual code cross-referencing
Persona Classifier Overall trust profile (LGTM, Permission Goblin, etc.)

Use as an MCP Server

Aegis runs as an MCP server for Cursor, Claude Desktop, and any MCP-compatible client. Three tools are exposed: scan_skill, verify_lockfile, and list_capabilities.

Add to Cursor

Add this to your .cursor/mcp.json:

{
  "mcpServers": {
    "aegis": {
      "command": "aegis",
      "args": ["mcp-serve"]
    }
  }
}

Or generate it automatically:

aegis mcp-config

Add to Claude Desktop

Add the same block to your Claude Desktop MCP config. Aegis uses stdio transport โ€” no network server needed.


Use as a Cursor Skill (ClawHub)

Aegis is available as a skill on ClawHub. Install it and your agent will automatically audit skills before enabling them.

See SKILL.md for the full skill specification.


JSON Output for CI

# Full JSON report to stdout
aegis scan --json --no-llm

# Pipe into jq to extract the risk score
aegis scan --json --no-llm | jq '.deterministic.risk_score_static'

# Fail CI if risk > 50
aegis scan --json --no-llm | jq -e '.deterministic.risk_score_static <= 50'

The JSON report contains two payloads:

  • Deterministic โ€” Merkle tree, capabilities, findings, risk score (reproducible, signed)
  • Ephemeral โ€” LLM analysis, risk adjustment (non-deterministic, not signed)

Architecture

aegis scan ./skill
    โ”‚
    โ”œโ”€โ”€ coordinator.py       โ†’ File discovery (git-aware / directory walk)
    โ”œโ”€โ”€ ast_parser.py        โ†’ AST analysis + pessimistic scope extraction
    โ”œโ”€โ”€ secret_scanner.py    โ†’ 30+ secret patterns
    โ”œโ”€โ”€ shell_analyzer.py    โ†’ Dangerous shell patterns
    โ”œโ”€โ”€ js_analyzer.py       โ†’ JS/TS vulnerability patterns
    โ”œโ”€โ”€ config_analyzer.py   โ†’ YAML/JSON/TOML/INI risky settings
    โ”œโ”€โ”€ combo_analyzer.py    โ†’ Multi-capability attack chains
    โ”œโ”€โ”€ taint_analyzer.py    โ†’ Sourceโ†’sink data flow tracking
    โ”œโ”€โ”€ binary_detector.py   โ†’ External binary classification
    โ”œโ”€โ”€ social_eng_scanner   โ†’ Social engineering detection
    โ”œโ”€โ”€ stego_scanner        โ†’ Steganography + homoglyphs
    โ”œโ”€โ”€ hasher.py            โ†’ Lazy Merkle tree
    โ”œโ”€โ”€ signer.py            โ†’ Ed25519 signing
    โ”œโ”€โ”€ rule_engine.py       โ†’ Policy evaluation
    โ””โ”€โ”€ reporter/            โ†’ JSON + Rich console output
         โ”‚
         โ–ผ
    aegis_report.json + aegis.lock

For Skill Developers

Building a skill? See the Skill Developer Best Practices guide for how to make your skills auditable, trustworthy, and easy to verify.

Run Aegis on your own skill before publishing:

cd ./my-skill
aegis scan --no-llm -v

Fix PROHIBITED findings. Document RESTRICTED ones. Ship with an aegis.lock:

aegis lock

License

Aegis is dual-licensed:

  • Open Source: AGPL-3.0 โ€” free to use, modify, and distribute. Network service deployments must release source.
  • Commercial: Proprietary license available for embedding in proprietary products, running without source disclosure, SLAs, and support.

See LICENSING.md for full details. For enterprise inquiries: enterprise@aegis.network.


Contributing

Contributions welcome. By contributing, you agree to the Contributor License Agreement.

cd aegis-core
pip install -e ".[dev]"
pytest

Python 3.11+ required | No network access needed for deterministic scans | Works offline

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aegis_audit-0.1.2.tar.gz (182.8 kB view details)

Uploaded Source

Built Distribution

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

aegis_audit-0.1.2-py3-none-any.whl (213.9 kB view details)

Uploaded Python 3

File details

Details for the file aegis_audit-0.1.2.tar.gz.

File metadata

  • Download URL: aegis_audit-0.1.2.tar.gz
  • Upload date:
  • Size: 182.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aegis_audit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9920f5fc034a5e58bad9468904b9281d8ddb3d0f0b6b9203ddbfee4d3bdc0662
MD5 dc0ea4ce1f9f636bdc87d75f6587e4ba
BLAKE2b-256 454c85725c22e9204302cf6c035535290ba6a1713553282e37177eec69c4518e

See more details on using hashes here.

File details

Details for the file aegis_audit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aegis_audit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 213.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aegis_audit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88fc47451354593aa1dda0d4795f426dfff8f881be5c871db909dce679bc12f1
MD5 865135210b63704ca8a63daab2a6e127
BLAKE2b-256 7b7eb27501bd1256ac98f5eb45d9da683ff9662248a2e084cfbd102f2fc65bba

See more details on using hashes here.

Supported by

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