Skip to content
Cisco AI Defense logo
CiscoAI Security

CLI Reference — Skill Scanner

CLI Reference

Skill Scanner provides three entry points: skill-scanner (main CLI), skill-scanner-api (REST API server), and skill-scanner-pre-commit (pre-commit hook).


Commands

CommandDescription
(no command)Launch interactive scan wizard
scanScan a single skill directory
scan-allScan multiple skills in a directory
scan-repoClone a public GitHub repository and recursively scan its skills
generate-policyGenerate a scan policy YAML from a preset
configure-policyInteractive TUI for editing policy
list-analyzersShow available analyzers and their activation flags
validate-rulesValidate rule signatures

skill-scanner scan

Scan a single skill directory.

skill-scanner scan /path/to/skill [OPTIONS]

Analyzer Flags

FlagDescription
--use-behavioralEnable behavioral analyzer (AST dataflow analysis)
--use-llmEnable LLM analyzer (requires API key)
--llm-providerLLM shortcut: anthropic, openai, or openai-compatible
--llm-consensus-runs NRun LLM analysis N times; keep majority-agreed findings
--llm-max-tokens NOverride the LLM response-token budget (default: 8192)
--use-virustotalEnable VirusTotal binary scanner
--use-aidefenseEnable Cisco AI Defense analyzer
--use-osvQuery OSV.dev for advisories affecting exactly pinned Python dependencies; no API key required
--use-triggerEnable trigger specificity analyzer
--enable-metaEnable meta-analyzer for false positive filtering
--adjudicateDemote-only LLM review of deterministic HIGH/CRITICAL literal-regex false positives

Output Flags

FlagDescription
--formatOutput format; repeat to produce multiple reports in one run
--output PATHDefault report path
--output-json, --output-sarif, --output-markdown, --output-html, --output-tablePer-format output paths
--detailedInclude full finding details (markdown format)
--render-markdown / --no-render-markdownOverride terminal Markdown rendering

Policy and Rules

FlagDescription
--policyPreset name (strict, balanced, permissive) or path to custom YAML
--custom-rules PATHUse custom YARA rules from directory
--rule-packs PACK...Enable packs such as atr and promptguard; use --rule-packs list to inspect packs
--taxonomy PATHOverride the Cisco AI taxonomy JSON/YAML
--threat-mapping PATHOverride the threat mapping JSON
--fail-on-severity LEVELExit with error if findings at or above LEVEL exist

Behavior Flags

FlagDescription
--lenientTolerate malformed skills instead of failing
--skill-file NAMEUse a custom metadata filename instead of SKILL.md

Examples

# Core analyzers only (default)
skill-scanner scan ./my-skill

# Full analysis with all engines
skill-scanner scan ./my-skill --use-behavioral --use-llm --use-osv --use-aidefense --enable-meta

# Review deterministic HIGH/CRITICAL matches before LLM enrichment
skill-scanner scan ./my-skill --adjudicate

# LLM consensus mode for high-confidence results
skill-scanner scan ./my-skill --use-llm --llm-consensus-runs 3 --enable-meta

# Generate interactive HTML report
skill-scanner scan ./my-skill --use-llm --enable-meta --format html --output report.html

# Produce JSON and SARIF in one scan
skill-scanner scan ./my-skill --format json --format sarif \
  --output-json results.json --output-sarif results.sarif

# CI/CD: fail on high-severity findings
skill-scanner scan ./my-skill --fail-on-severity high --format sarif --output results.sarif

# Scan a non-standard skill format (e.g., Claude Code commands)
skill-scanner scan .claude/commands/deploy --lenient

skill-scanner scan-all

Scan multiple skills in a directory.

skill-scanner scan-all /path/to/skills [OPTIONS]

Supports all flags from scan, plus:

FlagDescription
--recursiveRecursively discover skills in subdirectories
--check-overlapDetect coordinated attacks across skills

Examples

# Scan all skills recursively
skill-scanner scan-all ./skills --recursive --format table

# Cross-skill analysis
skill-scanner scan-all ./skills --recursive --check-overlap

# CI/CD gate with SARIF output
skill-scanner scan-all ./skills --recursive --format sarif --output results.sarif --fail-on-severity high

skill-scanner scan-repo

Clone a public GitHub repository into a temporary directory and recursively discover and scan skills. The temporary clone is removed when scanning finishes.

skill-scanner scan-repo owner/repo
skill-scanner scan-repo https://github.com/owner/repo --use-osv --check-overlap

scan-repo supports the shared analyzer, policy, rule-pack, output, and CI-gating flags. Recursive discovery is on by default; pass --no-recursive to disable it.


skill-scanner generate-policy

Generate a scan policy YAML from a built-in preset for customization.

skill-scanner generate-policy [OPTIONS]
FlagDescription
-o, --output PATHOutput file path
--preset NAMEBase preset: strict, balanced, permissive
skill-scanner generate-policy -o my_policy.yaml --preset strict

skill-scanner configure-policy

Interactive terminal UI for building or editing a custom scan policy.

skill-scanner configure-policy [OPTIONS]
FlagDescription
-i, --input PATHExisting policy YAML to edit
-o, --output PATHOutput file path
skill-scanner configure-policy -i my_policy.yaml -o my_policy.yaml

skill-scanner list-analyzers

Show all available analyzers with their activation requirements.

skill-scanner list-analyzers

skill-scanner validate-rules

Validate rule signatures for correctness.

skill-scanner validate-rules [OPTIONS]
FlagDescription
--rules-file PATHPath to custom rules to validate
# Validate built-in rules
skill-scanner validate-rules

# Validate custom rules
skill-scanner validate-rules --rules-file /path/to/custom

skill-scanner-api

Start the REST API server.

skill-scanner-api [OPTIONS]
FlagDescriptionDefault
--hostBind addresslocalhost
--portPort number8000
--reloadEnable auto-reload for developmentOff
skill-scanner-api --host 127.0.0.1 --port 9000

See API Reference for endpoint documentation.


skill-scanner-pre-commit

Manage the pre-commit hook.

skill-scanner-pre-commit --install  # Install the built-in Git hook
skill-scanner-pre-commit --scan-all # Scan all configured skills

By default, the hook maps changed files to their nearest parent SKILL.md and scans each affected skill once. In CI, pre-commit supplies changed paths between two revisions:

pre-commit run skill-scanner --from-ref "$BASE_SHA" --to-ref "$HEAD_SHA"

Configure direct-hook behavior via .skill_scannerrc, .skill_scannerrc.json, or skill_scanner.json:

OptionDefaultDescription
severity_threshold"high"Block commits at this severity or above
skills_path".claude/skills"Base path for skills under the repo root
fail_fasttrueStop on first skill exceeding threshold
use_behavioralfalseEnable behavioral analyzer
use_triggertrueEnable trigger specificity analyzer
policyPreset name or path to custom policy YAML

Exit Codes

CodeMeaning
0Scan completed, no findings above threshold
1Findings at or above the --fail-on-severity threshold detected
2Error during scan (invalid path, configuration error, etc.)