Scan and secure your AI agent configurations with a simple command-line tool.
✅ Scan Agent Configs - Detect security issues in AGENTS.md, CLAUDE.md, soul.md, .cursorrules, aider.conf ✅ Security Rating - Get 0-100 security scores for your configs ✅ Multiple Formats - Export reports as JSON, YAML, TOML, or Markdown ✅ Local + Cloud Analysis - Fast local scanning + optional cloud-based deep analysis ✅ Template Generator - Create secure agent configs from templates ✅ Beautiful CLI - Colorful, informative output with progress indicators
npm install -g @afterdarksystems/adllmsecbrew install afterdarksystems/tap/adllmsecgit clone https://github.com/afterdarksystems/llmsecurity-cli
cd llmsecurity-cli/cli
npm install
npm linkadllmsec scan CLAUDE.mdadllmsec scan .
# Automatically finds and scans all agent config filesadllmsec scan . --format json --out report.jsonadllmsec rate .cursorrulesadllmsec create claude --out my-agent.mdadllmsec scan <file|directory> [options]Options:
-f, --format <format>- Output format:console,json,yaml,toml,md(default:console)-o, --out <filename>- Output filename for exports--no-cloud- Disable cloud-based analysis (local only)
Examples:
# Scan current directory (console output)
adllmsec scan .
# Scan specific file
adllmsec scan AGENTS.md
# Export to JSON
adllmsec scan . -f json -o security-report.json
# Export to Markdown
adllmsec scan . -f md -o SECURITY.md
# Export to YAML
adllmsec scan .cursorrules -f yaml -o rules-scan.yaml
# Local-only scan (no API calls)
adllmsec scan . --no-cloudGet a quick security rating (0-100) for a config file:
adllmsec rate <file>Example:
adllmsec rate soul.md
📊 Security Rating for soul.md
Score: 85/100
Risk Level: LOW
Risks Found: 2Generate a new agent configuration from a template:
adllmsec create <type> [options]Types:
claude- Claude Code agent configurationcursor- Cursor IDE rules fileaider- Aider AI assistant configuration
Options:
-o, --out <filename>- Output filename
Examples:
# Create Claude config
adllmsec create claude
# Create Cursor rules with custom name
adllmsec create cursor -o .my-cursor-rules
# Create Aider config
adllmsec create aider -o aider.confSet up API key and preferences:
adllmsec configureThe CLI automatically detects and scans these file types:
| File | Type | Description |
|---|---|---|
AGENTS.md |
Multi-Agent System | Agent definitions and configurations |
CLAUDE.md |
Claude Code | Claude Code agent settings |
soul.md |
Soul AI | Soul AI agent configuration |
user.md |
User Profile | User preferences and context |
.cursorrules |
Cursor IDE | Cursor IDE behavior rules |
aider.conf |
Aider AI | Aider assistant configuration |
.aider.conf.yml |
Aider AI | Aider YAML configuration |
agents.json |
Generic | JSON agent definitions |
system.md |
System Prompt | System-level prompts |
The CLI performs these security checks:
- OpenAI API keys (
sk-...) - GitHub tokens (
ghp_...) - Slack tokens (
xoxb-...) - Google API keys (
AIza...) - Bearer tokens
- Hardcoded passwords
- "Ignore previous instructions" patterns
- System role override attempts
- ChatML/Llama injection markers
- Jailbreak techniques
- Code execution flags
- File write permissions
- Network access enabled
- Unrestricted capabilities
- Social Security Numbers
- Email addresses
- Credit card numbers
- Personal identifiable information
Beautiful, colorful output with:
- File-by-file analysis
- Risk severity indicators (color-coded)
- Security score (0-100)
- Line-by-line recommendations
- Summary statistics
{
"timestamp": "2026-02-21T12:00:00.000Z",
"version": "1.0.0",
"results": [
{
"file": "CLAUDE.md",
"type": "Claude Code Configuration",
"score": 95,
"riskLevel": "safe",
"risks": [],
"recommendations": [
"✓ No security issues detected"
]
}
]
}timestamp: '2026-02-21T12:00:00.000Z'
version: 1.0.0
results:
- file: CLAUDE.md
type: Claude Code Configuration
score: 95
riskLevel: safe
risks: []
recommendations:
- ✓ No security issues detected[scan]
timestamp = "2026-02-21T12:00:00.000Z"
version = "1.0.0"
[[results]]
file = "CLAUDE.md"
type = "Claude Code Configuration"
score = 95
riskLevel = "safe"# LLM Security Scan Report
**Date:** 2/21/2026, 12:00:00 PM
**Version:** 1.0.0
## Summary
- **Files Scanned:** 1
- **Total Risks:** 0
## Results
### CLAUDE.md
- **Type:** Claude Code Configuration
- **Score:** 95/100 (safe)
- **Size:** 512 bytes
**Recommendations:**
- ✓ No security issues detectedLLMSEC_API_KEY
Your LLM Security API key (get from https://llmsecurity.dev/dashboard)
export LLMSEC_API_KEY=lsec_abc12345_dGhpcyBpcyBhIHNlY3JldA==LLMSEC_API_URL
API endpoint (default: https://llmsecurity.dev/api/v1)
export LLMSEC_API_URL=https://llmsecurity.dev/api/v1Create ~/.llmsec/config.json:
{
"api_key": "lsec_abc12345_...",
"api_url": "https://llmsecurity.dev/api/v1",
"default_format": "console",
"cloud_analysis": true
}$ adllmsec scan /path/to/project
╔═══════════════════════════════════════════════════════╗
║ adllmsec - After Dark LLM Security ║
║ AI Agent Config Scanner ║
║ v1.0.0 ║
╚═══════════════════════════════════════════════════════╝
✔ Found 3 config file(s). Analyzing...
✔ Scanned 3 file(s)
════════════════════════════════════════════════════════
SCAN RESULTS
════════════════════════════════════════════════════════
📄 CLAUDE.md
Type: Claude Code Configuration
Score: 95/100 (SAFE)
Size: 512 bytes, 24 lines
💡 RECOMMENDATIONS:
✓ No security issues detected
• Review agent permissions and capabilities
• Implement least privilege principle
📄 .cursorrules
Type: Cursor IDE Rules
Score: 75/100 (LOW)
Size: 1024 bytes, 48 lines
⚠ RISKS FOUND:
[MEDIUM] Detected Ignore Instructions pattern
Line 12: Review and sanitize user-provided content in prompts
💡 RECOMMENDATIONS:
• Use environment variables for sensitive configuration
• Limit code execution permissions
📄 user.md
Type: User Profile
Score: 85/100 (LOW)
Size: 256 bytes, 15 lines
💡 RECOMMENDATIONS:
✓ No security issues detected
────────────────────────────────────────────────────────
SUMMARY
────────────────────────────────────────────────────────
Files Scanned: 3
Total Risks: 1
Average Score: 85/100
────────────────────────────────────────────────────────$ adllmsec scan . -f json -o security-scan.json
╔═══════════════════════════════════════════════════════╗
║ adllmsec - After Dark LLM Security ║
║ AI Agent Config Scanner ║
║ v1.0.0 ║
╚═══════════════════════════════════════════════════════╝
✔ Scanned 3 file(s)
✓ Report saved to security-scan.json$ adllmsec create claude -o my-agent.md
✓ Created my-agent.md
Edit this file to customize your agent configuration.
Run 'adllmsec scan my-agent.md' to check for security issues.
$ adllmsec scan my-agent.md
📄 my-agent.md
Type: Claude Code Configuration
Score: 100/100 (SAFE)
Size: 423 bytes, 20 lines
💡 RECOMMENDATIONS:
✓ No security issues detectedGitHub Actions:
name: LLM Security Scan
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install adllmsec
run: npm install -g @afterdarksystems/adllmsec
- name: Scan agent configs
run: adllmsec scan . -f json -o security-report.json
env:
LLMSEC_API_KEY: ${{ secrets.LLMSEC_API_KEY }}
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: security-report
path: security-report.json
- name: Fail on critical issues
run: |
score=$(jq '.results[].score | select(. < 70)' security-report.json)
if [ ! -z "$score" ]; then
echo "Security score below threshold!"
exit 1
fi.git/hooks/pre-commit:
#!/bin/bash
# Scan agent configs before commit
adllmsec scan . -f json -o /tmp/llmsec-scan.json
# Check for critical risks
critical=$(jq '.results[].risks[] | select(.severity == "critical")' /tmp/llmsec-scan.json)
if [ ! -z "$critical" ]; then
echo "❌ Critical security issues found!"
echo "Run 'adllmsec scan .' for details"
exit 1
fi
echo "✅ Security scan passed"# Verify API key is set
echo $LLMSEC_API_KEY
# Test with explicit key
LLMSEC_API_KEY=your-key adllmsec scan .
# Or use --no-cloud for local-only scanning
adllmsec scan . --no-cloud# Check supported files
adllmsec scan . --verbose
# Scan specific file
adllmsec scan path/to/specific/file.md# Ensure output directory exists
mkdir -p reports
adllmsec scan . -f json -o reports/scan.json
# Check write permissions
ls -la reports/We welcome contributions! See CONTRIBUTING.md
MIT License - see LICENSE
- Documentation: https://llmsecurity.dev/developers
- Issues: https://github.com/afterdarksystems/llmsecurity-cli/issues
- Email: support@llmsecurity.dev
- Discord: https://discord.gg/llmsecurity
- Initial release
- Support for AGENTS.md, CLAUDE.md, soul.md, .cursorrules, aider.conf
- Local + cloud analysis
- JSON, YAML, TOML, Markdown export
- Template generator
- Security rating command
Made with ❤️ by After Dark Systems