agentshield
CLAUDE.md1.3k starsChanged 7 months agoMITView on GitHub
Security auditor for AI agent configurations (Claude Code, MCP servers, hooks, agents). Grades: A (>=90), B (>=75), C (>=60), D (>=40), F (<40) Tests in tests/ mirror src/ structure. Use makeFinding(), makeSettings(), etc. helper factories. Run specific suite: npx vitest run tests/rules/mcp.test.ts
Trending
Less talk lately.about the whole repository
Who's talking about affaan-m/agentshield
- @jelloeater.bsky.social“affaan-m/agentshield: AI agent security scanner. Detect vulnerabilities in agent configurations, MCP …”Bluesky · Sep 1, 2026 · 2 likes
- sudosubin/agents.nix“agent-skills.github.affaan-m.agentshield: v1.6.0 → refs/tags/v1.6.0”GitHub · Oct 3, 2026
- sudosubin/agents.nix“agent-skills.github.affaan-m.agentshield: init at 1.6.0”GitHub · Sep 25, 2026
- MinoruSoga/AnimalEkarte“chore(deps): bump affaan-m/agentshield from 1.3.0 to 1.6.0”GitHub · Sep 14, 2026
- thunderkds/personal-agentic-claude“Security for the agents”GitHub · Sep 7, 2026
The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 16
Talked about on GitHub and Bluesky (16 times).
On GitHub · 15
- Oct 3, 2026agent-skills.github.affaan-m.agentshield: v1.6.0 → refs/tags/v1.6.0 — sudosubin/agents.nix0 reactions
- Sep 25, 2026agent-skills.github.affaan-m.agentshield: init at 1.6.0 — sudosubin/agents.nix0 reactions
- Sep 14, 2026chore(deps): bump affaan-m/agentshield from 1.3.0 to 1.6.0 — MinoruSoga/AnimalEkarte0 reactions · 2 comments
- Sep 7, 2026Security for the agents — thunderkds/personal-agentic-claude0 reactions
- Jul 18, 2026docs: refresh AX runner permission references — Sungho-pk42ac/agentguard0 reactions
10 more on GitHub
- Jul 18, 2026docs: refresh AX agent runner permission references — Sungho-pk42ac/agentguard0 reactions
- Jul 3, 2026docs: clarify Agentshield reference boundary — Sungho-pk42ac/agentguard0 reactions
- Jun 30, 2026Add AX Rollout external reference comparison for judge positioning — Sungho-pk42ac/agentguard0 reactions
- Jun 29, 2026chore(deps): bump affaan-m/agentshield from 1.3.0 to 1.4.0 — MinoruSoga/AnimalEkarte0 reactions · 4 comments
- Jun 22, 2026Backlog: agent-config / MCP / hook auditing (from AgentShield) — plugin-ingest vs kit-native checks — sandstream/kit0 reactions
- Jun 22, 2026chore(deps): bump affaan-m/agentshield from 1.3.0 to 1.4.0 — MinoruSoga/AnimalEkarte0 reactions · 2 comments
- Jun 14, 2026chore(deps): bump affaan-m/agentshield from 1.3.0 to 1.4.0 — MinoruSoga/AnimalEkarte0 reactions · 2 comments
- Apr 24, 2026feat: add /atv-security and /cso security skills — All-The-Vibes/ATV-StarterKit0 reactions
- Apr 5, 2026feat: add full CI pipeline for .github repo — petry-projects/.github0 reactions · 3 comments
- Mar 24, 2026[exploration] Integrate AgentShield — patricklafrance/plantz-claude-v20 reactions
On Bluesky · 1
- Sep 1, 2026affaan-m/agentshield: AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions.… — @jelloeater.bsky.social2 likes and reposts · 2 replies
In this repository3 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- agentshieldSkill
- agentshieldSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
Immutability: All arrays typed as ReadonlyArray, all interfaces use readonly fields.
- Very specific: line 53
No RegExp .prototype methods: Use String.matchAll() via findAllMatches() helper to avoid security hook conflicts.
- Very specific: line 82
Run specific suite: npx vitest run tests/rules/mcp.test.ts
- Very specific: line 87
No mutation, no any, no console.log in src
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AgentShield
Security auditor for AI agent configurations (Claude Code, MCP servers, hooks, agents).
Build & Test
npm run build # tsc + tsup → dist/
npm test # vitest (912 tests)
npm run dev # tsx watch modeArchitecture
src/
index.ts # CLI entry (commander)
types.ts # Core types + Zod schemas
scanner/
discovery.ts # File discovery (CLAUDE.md, settings.json, mcp.json, agents/, etc.)
index.ts # Orchestrates discovery → rules → sorted findings
rules/
index.ts # Barrel export of all rule modules
secrets.ts # 10 rules — API keys, tokens, passwords, env exposure, webhooks, private keys, base64, internal IPs
permissions.ts # 10 rules — allow/deny analysis, dangerous flags, destructive git, mutable tools, sensitive paths, network access
hooks.ts # 34 rules — injection, exfiltration, persistence, container escape, clipboard, log tampering, reverse shells
mcp.ts # 23 rules — risky servers, env override, npx supply chain, auto-approve, timeout, bind-all, CORS
agents.ts # 25 rules — tool restrictions, prompt injection, reflection attacks, output manipulation, social engineering
reporter/
score.ts # Scoring engine (severity deductions, grade A-F, category breakdown)
terminal.ts # Colored terminal output
json.ts # JSON + Markdown report formats
index.ts # Format dispatcher
opus/
prompts.ts # System prompts for Attacker/Defender/Auditor
pipeline.ts # Claude Opus three-agent adversarial pipeline
render.ts # Opus analysis terminal + markdown rendering
index.ts # Pipeline entry point
miniclaw/
types.ts # Core types (immutable, readonly)
sandbox.ts # Sandbox lifecycle + path validation
router.ts # Prompt sanitization + output filtering
tools.ts # Whitelist-based tool authorization
server.ts # HTTP server with rate limiting + CORS
dashboard.tsx # React dashboard component
index.ts # Entry point + startMiniClaw()Key Patterns
- Rules: Each rule module exports
ReadonlyArray<Rule>. EachRulehascheck(file: ConfigFile): ReadonlyArray<Finding>. - Immutability: All arrays typed as
ReadonlyArray, all interfaces usereadonlyfields. - No RegExp .prototype methods: Use
String.matchAll()viafindAllMatches()helper to avoid security hook conflicts. - False positive prevention:
parsePermissionLists()JSON-parses settings to check only the allow array. Negation-aware context checking downgrades prohibitive mentions toinfo.
Severity Scoring
| Severity | Deduction | Example |
| critical | -25 | Hardcoded API key, Bash(*) |
| high | -15 | Shell MCP server, no deny list |
| medium | -5 | Unrestricted curl, missing denials |
| low | -2 | No model specified in agent |
| info | 0 | Missing description, good practice |
Grades: A (>=90), B (>=75), C (>=60), D (>=40), F (<40)
CLI
agentshield scan [path] # Static analysis
agentshield scan --opus # + Claude Opus adversarial pipeline
agentshield scan --format json|md # Output format
agentshield scan --fix # Show auto-fix suggestions
agentshield miniclaw start # Launch MiniClaw secure agent server
agentshield miniclaw start --port N # Custom portTesting
Tests in tests/ mirror src/ structure. Use makeFinding(), makeSettings(), etc. helper factories.
Run specific suite: npx vitest run tests/rules/mcp.test.ts
Conventions
- TypeScript strict mode, ESM modules
- No mutation, no
any, noconsole.login src - Zod for config validation at boundaries
- Conventional commits: feat/fix/test/refactor/docs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

