agentsec is a security auditing CLI for AI agent skills. It scans every skill installed in a project against the OWASP Agentic Skills Top 10 and reports vulnerabilities, misconfigurations, and governance gaps.
Use agentsec when the user asks to:
The fastest path to a result — no install, no flags:
bash
npx agentsec
This scans every default skills directory on the machine — grouped by platform — plus any ./skills folder in the current project (up to two levels deep), and audits each installed skill against the OWASP Agentic Skills Top 10. Always try this first.
agentsec is agent-platform agnostic — every platform listed below ships skills in the agentskills.io SKILL.md format and is auto-discovered.
PlatformPaths scannedClaude Code~/.claude/skills, ./.claude/skills, ~/.claude/plugins/*/skills/*, ~/.claude/commands, ./.claude/commandsOpenClaw / ClawHub~/.openclaw/workspace/skills, ~/.openclaw/workspace-*/skills (profiles via OPENCLAW_PROFILE), ~/.openclaw/skillsCodex / skills.sh~/.agents/skills, ./.agents/skills, ../.agents/skills, /etc/codex/skillsHermes~/.hermes/skills, ~/.hermes/skills/* (bundled categories), ./.hermes/skillsOther (generic)Any skills/ directory found within the current project, up to two levels deep
Every workflow starts from one of four commands. Run them with npx agentsec — no install needed.
bash
# Full audit (scan + policy evaluation). Default command.
npx agentsec
# Scan only (no policy evaluation)
npx agentsec scan
# Generate a report from a previously saved audit JSON
npx agentsec report audit.json
# Manage and inspect policy presets
npx agentsec policy list
npx agentsec needs no install. For repeated use, install globally:
bash
# bun (recommended)
bun add -g agentsec
# npm
npm install -g agentsec
# pnpm
pnpm add -g agentsec
# yarn
yarn global add agentsec
Then drop the npx prefix:
bash
agentsec
agentsec scan --path ./my-skills
All flags work with any command.
FlagShortValuesDefaultPurpose--format``-f``text, json, sarif, html``textOutput format--output``-opathstdoutWrite report to file--policy``-ppreset name or pathdefaultApply a policy preset--platform``openclaw, claude, codex, hermesautoNarrow to one agent platform--pathpathautoCustom skill directory to scan--profile``default, web3, strict``defaultRule profile. default auto-detects Web3 skills; web3 forces the annex on every skill--verbose``-voffShow detailed findings--no-coloroffDisable colored output--help``-hShow help--version``-VPrint version
bash
npx agentsec --verbose
bash
npx agentsec scan --path ./my-skills
bash
npx agentsec --platform claude
npx agentsec --platform codex
npx agentsec --platform hermes
npx agentsec --platform openclaw
bash
npx agentsec --policy strict --format json --output audit.json
bash
npx agentsec --format html --output report.html
bash
npx agentsec --format sarif --output report.sarif
bash
npx agentsec policy list
bash
npx agentsec policy show strict
bash
npx agentsec policy validate ./my-policy.json
bash
npx agentsec report audit.json --format html --output report.html
NameUse CasedefaultBalanced policy. Blocks critical findings.strictEnterprise-grade. Blocks high and critical findings, enforces tests.permissiveLenient. Only blocks critical CVEs. Good for development.owasp-agent-top-10Built directly from the OWASP Agentic Skills Top 10.
agentsec auto-loads .agentsecrc, .agentsecrc.json, or agentsec.config.json from the current directory (or any parent):
json
{
"format": "text",
"output": null,
"policy": "strict",
"verbose": false
}
CLI flags always override config file values. Omit "platform" and "path" to keep the default auto-discovery behavior — agentsec will scan every known platform's default locations.
Every audit checks all ten risk categories:
IDRiskAST01Malicious SkillsAST02Supply Chain CompromiseAST03Over-Privileged SkillsAST04Insecure MetadataAST05Untrusted External InstructionsAST06Weak IsolationAST07Update DriftAST08Poor ScanningAST09No GovernanceAST10Cross-Platform Reuse
Web3-touching skills are detected automatically and audited against twelve additional rules — no flag required. A skill is detected as Web3 when its manifest declares a web3: block, when its source imports a Web3 client library ( viem, ethers, web3, wagmi, @solana/web3.js, @coinbase/onchainkit, @privy-io, @biconomy, @zerodev), when it references a Web3 RPC method ( eth_*, wallet_*, personal_sign, signTypedData), or when it ships a .sol file. Detected skills are tagged [Web3] in the output:
text
✔ scoped-trader v1.4.0 [Web3] C (62)
✔ helpful-summarizer v1.2.0 A (95)
--profile web3 is still available — it forces the annex onto every skill regardless of detection (useful for cross-team CI consistency):
bash
npx agentsec audit --profile web3 --path ./my-skills
IDRiskAST-W01Unbounded Signing AuthorityAST-W02Implicit Permit / Permit2 Signature CaptureAST-W03Delegation Hijack via EIP-7702AST-W04Blind / Opaque Signing SurfaceAST-W05RPC Endpoint Substitution & Mempool LeakageAST-W06Unverified Contract Call TargetsAST-W07Cross-Chain / Bridge Action ReplayAST-W08MCP Chain-Tool Drift / Capability SmugglingAST-W09Session-Key / Permission-Caveat ErosionAST-W10Slippage / Oracle Manipulation by Agent LoopAST-W11Key Material in Agent Memory / LogsAST-W12No On-Chain Action Audit / Kill-Switch
Skills can declare a web3 block in their manifest (chains, signers, policy caps, session-key scopes, MCP server pinning, audit sink, kill-switch) so the annex can verify scoping without flagging well-bounded skills. See docs/plans/ast10-web3-annex-rules.md for full per-rule detection signals.
Default output is compact: each skill shows its grade and score, followed by a one-line finding summary and a PASS/WARN/FAIL status.
text
✔ Found 6 skills
✔ fetch-data v1.0.0 D (42)
✔ deploy-helper v2.3.0 C (68)
✔ code-review v1.1.0 A (95)
6 skills scanned • avg score 78 • 4 certified
Findings: 2 critical, 1 high, 2 medium
⚠ WARN 3 high/critical finding(s) detected
Use --verbose for score breakdowns, rule IDs, file/line locations, and remediation for each finding.
0 — audit passed the active policy1 — policy violation or fatal errorUse the exit code directly to gate CI pipelines — no special flag required:
bash
npx agentsec --policy strict || exit 1
npx agentsec — no install, no flags. Iterate from there.--verbose whenever you need to act on specific findings.--format json into jq or a custom script for programmatic handling.strict is the most common preset for production repositories.