ICU CLI
A command-line AI supply chain firewall. Scan files and packages for prompt injection, data exfiltration, obfuscation, and other malicious patterns targeting AI development tools.
Quick Start
pip install icuicu scan ./suspicious-package/icu initicu watch ./srcFeatures
37 Detection Rules
Prompt injection, data exfiltration, obfuscation, suspicious commands, and network threats
Tiered Analysis
Fast hash lookup, heuristic matching, and deep analysis with entropy and deobfuscation
Watch Mode
Real-time file monitoring that scans changes as you work
Git Hooks
Pre-commit integration to block malicious code before it enters your repo
Policy Engine
Custom allow/block/warn rules per project with tool-specific overrides
Reputation DB
SQLite-backed hash tracking with known-good and known-bad lists
MCP Server
Expose scanning tools to AI assistants via Model Context Protocol
Multiple Formats
Output as table, JSON, or SARIF for CI/CD integration
Command Reference
icu scanScan files or directories for malicious patterns. Uses a tiered pipeline: hash reputation lookup, heuristic pattern matching, and deep analysis with entropy measurement and deobfuscation.
Usage
icu scan <file-or-directory>Options
--depth [fast|deep|auto]Scan depth — auto escalates if suspicious (default: auto)--format [table|json|sarif]Output format (default: table)--max-size BYTESMax file size to scan (default: 1 MB)--exclude PATTERNGlob pattern to exclude (repeatable)--workers NMax worker threads for parallel scanning--policy FILEPolicy YAML file to evaluate results against--no-dbDisable reputation database lookupExamples
$ icu scan ./server.py$ icu scan ./project/ --depth deep --format json$ icu scan ./src --exclude '*.test.py' --exclude 'vendor/*'
Exit codes: 0 = clean, 1 = medium risk, 2 = high/critical risk
icu watchMonitor a directory in real-time. Scans files as they change and prints results only when findings are detected. Ctrl+C to stop.
Usage
icu watch <directory>Options
--depth [fast|deep|auto]Scan depth (default: auto)--policy FILEPolicy YAML file to evaluate against--max-size BYTESMax file size (default: 1 MB)--exclude PATTERNGlob pattern to exclude (repeatable)--no-dbDisable reputation databaseExamples
$ icu watch ./src$ icu watch ./project --depth fast --exclude '*.log'
icu hookManage git pre-commit hooks. When installed, ICU automatically scans staged files before each commit and blocks commits that contain high-risk findings.
Usage
icu hook install | uninstallExamples
$ icu hook install$ icu hook uninstall
icu initBootstrap a project with a default policy file and pre-commit hook in one step.
Usage
icu init [options]Options
--no-hookSkip git pre-commit hook installation--policy-path FILEOutput path for policy file (default: .icu-policy.yml)Examples
$ icu init$ icu init --no-hook --policy-path ./custom-policy.yml
icu rulesList and filter the 37 built-in detection rules across 5 threat categories.
Usage
icu rules [options]Options
--category NAMEFilter by category--severity LEVELFilter by severity (info, warning, danger, critical)--search PATTERNRegex search against rule ID and descriptionExamples
$ icu rules$ icu rules --category prompt_injection --severity critical$ icu rules --search 'ssh'
icu policyManage security policies. Define custom allow/block/warn rules per project with severity overrides by tool.
Usage
icu policy init | check | testExamples
$ icu policy init$ icu policy check$ icu policy test ./src --tool claude --format json
icu lookupLook up a file or SHA256 hash in the reputation database. Shows signature info and scan history.
Usage
icu lookup <file-or-hash>Options
--format [table|json]Output format (default: table)--db-path PATHPath to reputation databaseExamples
$ icu lookup suspicious-file.py$ icu lookup abc123def456...
icu reputationManage the threat signature reputation database. Add custom signatures, import/export YAML, and view statistics.
Usage
icu reputation stats | list | add | remove | import | exportExamples
$ icu reputation stats$ icu reputation list --category prompt_injection$ icu reputation add --name 'custom_rule' --category suspicious_commands --pattern 'exec\(' --severity critical$ icu reputation export --format yaml > signatures.yml$ icu reputation import signatures.yml
Configuration
ICU loads configuration with the following precedence (highest to lowest):
Command-line arguments always take priority
ICU_DEPTH, ICU_MAX_SIZE, ICU_NO_DB, ICU_POLICY
.icu.yml or .icu.yaml in the project directory
~/.icu/config.yml for user-wide defaults
depth: auto
max_file_size: 2097152
exclude:
- "*.log"
- "vendor/*"
- "node_modules/*"
no_db: false*.log
vendor/*
build/*
test_data/*
node_modules/*Pre-commit Framework
ICU can also be used as a pre-commit hook in any project:
repos:
- repo: https://github.com/LiamCYD/icu
rev: v0.1.0
hooks:
- id: icu-scan