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?"
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 userscdinto a skill and runaegis scanfrom 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:
- Choose a provider โ Gemini, Claude, OpenAI, or a local server (Ollama, LM Studio, llama.cpp, vLLM)
- Pick a model โ curated list per provider, or enter a custom model ID
- 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9920f5fc034a5e58bad9468904b9281d8ddb3d0f0b6b9203ddbfee4d3bdc0662
|
|
| MD5 |
dc0ea4ce1f9f636bdc87d75f6587e4ba
|
|
| BLAKE2b-256 |
454c85725c22e9204302cf6c035535290ba6a1713553282e37177eec69c4518e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88fc47451354593aa1dda0d4795f426dfff8f881be5c871db909dce679bc12f1
|
|
| MD5 |
865135210b63704ca8a63daab2a6e127
|
|
| BLAKE2b-256 |
7b7eb27501bd1256ac98f5eb45d9da683ff9662248a2e084cfbd102f2fc65bba
|