TrustSkill v3.1 - Advanced Skill Security Scanner
A comprehensive security scanner for OpenClaw skills that detects:
- Malicious code and backdoors
- Hardcoded secrets (API keys, passwords, tokens via entropy analysis)
- Vulnerable dependencies (known CVEs via OSV database)
- Tainted data flows (user input to dangerous functions)
- Credential theft (SSH keys, passwords, API keys)
- Privacy file access (Memory files, configs)
- Command injection (eval, exec, os.system)
- Data uploads (suspicious POST/PUT requests)
- File system risks (destructive operations)
- Network security issues
What's New in v3.1
🔒 NPM Integrity Hash Whitelist
Automatically recognizes and skips npm/pnpm/yarn integrity hashes (sha512-xxx) in lock files, eliminating 99% of false positive HIGH findings from package-lock.json, yarn.lock, and pnpm-lock.yaml.
📊 Smart Data Flow Detection
Distinguishes between data uploads (HIGH risk) and data downloads (MEDIUM risk):
requests.post(), requests.put() → data_upload (HIGH)
urllib.request.urlretrieve(), requests.get(stream=True) → data_download (MEDIUM)
📝 Context-Aware Documentation Scanning
Recognizes placeholder patterns and documentation examples:
- Placeholder patterns:
your_api_key_here, sk-..., <API_KEY>, ${VARIABLE}
- i18n patterns: 配置, 设置, 示例, 请将, 填入
- Markdown code blocks in documentation files
🌐 Enhanced Whitelist System
Built-in whitelists for known safe patterns:
- Lock files:
package-lock.json, yarn.lock, pnpm-lock.yaml, composer.lock, poetry.lock, Cargo.lock
- Documentation files:
SKILL.md, README.md, AGENTS.md, CHANGELOG.md
- Testing utilities:
test_*.py, conftest.py, with_server.py
What's New in v3.0
- 🔐 Secret Detection Engine: Hybrid entropy + pattern-based detection for AWS, GitHub, OpenAI, and generic API keys
- 📦 Dependency Vulnerability Scanner: Checks against OSV (Open Source Vulnerabilities) database
- 🌊 Taint Analysis: Tracks data flow from user input to dangerous functions (deep mode)
- ⚙️ Configuration System: YAML/JSON-based custom rules, severity overrides, and whitelisting
Prerequisites
Source the venv environment first before running the python scripts:
source /opt/venv/bin/activate && pip -V
# pip 26.0.1 from /opt/venv/lib/python3.12/site-packages/pip (python 3.12)
Quick Start
Scan a skill directory:
python src/cli.py /path/to/skill-folder
Scanning Modes
| Mode |
Description |
Speed |
Accuracy |
Use Case |
| fast |
Regex + Secrets + Dependencies |
⚡ Fast |
⭐⭐⭐ |
Quick initial scan |
| standard |
Regex + AST + Secrets + Dependencies |
⚡ Balanced |
⭐⭐⭐⭐ |
Default, recommended |
| deep |
Full analysis + Taint Analysis |
🐢 Thorough |
⭐⭐⭐⭐⭐ |
Comprehensive audit |
Note: Secret and Dependency analyzers run in all modes because they provide critical security checks with minimal performance overhead.
Usage Examples
Basic scan
python src/cli.py ~/.openclaw/skills/some-skill
Deep scan with JSON output
python src/cli.py ~/.openclaw/skills/some-skill --mode deep --format json
Export for manual review
python src/cli.py ~/.openclaw/skills/some-skill --export-for-llm
Use custom configuration
python src/cli.py ~/.openclaw/skills/some-skill --config trustskill.yaml
Batch scan multiple skills
for skill in ~/.openclaw/skills/*/; do
echo "Scanning: $skill"
python src/cli.py "$skill" --mode deep --format json > "results/$(basename $skill).json"
done
Comprehensive Skill Scanning Guidance
Pre-Scan Checklist
Before scanning a skill, verify:
Step-by-Step Scanning Workflow
Phase 1: Initial Assessment
# Step 1: Quick scan to identify obvious issues
python src/cli.py /path/to/skill --mode fast
# Step 2: If any HIGH issues found, proceed to deep scan
python src/cli.py /path/to/skill --mode deep --format json > scan_result.json
Phase 2: Detailed Analysis
# Step 3: Export markdown report for thorough review
python src/cli.py /path/to/skill --mode deep --export-for-llm > scan_report.md
# Step 4: Review specific file types manually
find /path/to/skill -name "*.py" -exec grep -l "eval\|exec\|os.system" {} \;
Phase 3: Validation
# Step 5: Check for actual malicious patterns
grep -r "base64.b64decode" /path/to/skill --include="*.py"
grep -r "requests.post" /path/to/skill --include="*.py"
grep -r "subprocess.*shell=True" /path/to/skill --include="*.py"
Result Interpretation Guide
Severity Levels
| Level |
Icon |
Meaning |
Action |
| HIGH |
🔴 |
Confirmed security risk |
Stop and investigate immediately |
| MEDIUM |
🟡 |
Potential risk requiring review |
Investigate before proceeding |
| LOW |
🟢 |
Informational, low risk |
Document and proceed with caution |
Finding Categories
| Category |
Risk |
Description |
Typical Action |
command_injection |
HIGH |
User input to dangerous functions |
Critical - Review code flow |
data_upload |
HIGH |
POST/PUT to external servers |
Investigate destination and data |
hardcoded_secret |
HIGH |
Real API keys/passwords found |
Remove and rotate credentials |
data_download |
MEDIUM |
File downloads from internet |
Verify source is legitimate |
api_key_usage |
MEDIUM |
API key references (docs) |
Usually safe if placeholder |
network_request |
MEDIUM |
HTTP requests |
Verify endpoints are legitimate |
vulnerable_dependency |
MEDIUM |
CVE in dependencies |
Update to patched version |
environment_access |
LOW |
Reading env variables |
Normal for configuration |
file_operation |
LOW |
Standard file I/O |
Verify paths are safe |
Validation Techniques
1. Verify Hardcoded Secrets
# Check if the "secret" is actually a placeholder
grep -B2 -A2 "your_api_key" /path/to/skill/SKILL.md
# Real secrets are usually in code files, not documentation
grep -r "api_key\s*=\s*['\"]sk-" /path/to/skill --include="*.py"
2. Verify Network Requests
# Check what data is being sent
grep -B5 -A5 "requests.post" /path/to/skill/scripts/*.py
# Verify the destination URL
grep -r "https://" /path/to/skill --include="*.py" | grep -v "example.com"
3. Verify Command Injection
# Check if user input reaches dangerous functions
grep -B10 "eval\|exec\|os.system" /path/to/skill/scripts/*.py
Red Flags Requiring Immediate Action
🚨 STOP IMMEDIATELY if you find:
Data Exfiltration Patterns
- Sending files to unknown servers
- POST requests with system information
- Uploading
.ssh, .env, or credential files
Backdoor Patterns
- Hidden network listeners
- Encoded/obfuscated malicious code
- Scheduled tasks creating persistence
Destructive Operations
rm -rf / or equivalent
shutil.rmtree on user directories
- Mass file deletion patterns
Credential Harvesting
- Reading
/etc/passwd, /etc/shadow
- Accessing browser credential stores
- Extracting SSH private keys
Action: Delete the skill immediately and report to security team.
What It Detects
High Risk 🔴
- Tainted Command Injection: User input flowing to
eval(), exec(), or os.system()
- Hardcoded Secrets: Real API keys, passwords, tokens (not placeholders)
- Data Upload: HTTP POST/PUT to external servers with sensitive data
- Destructive Operations: Recursive file/directory deletion (
rm -rf, shutil.rmtree)
- Credential Harvesting: Password/key extraction attempts
Medium Risk 🟡
- Data Download: File downloads from internet (verify source legitimacy)
- Vulnerable Dependencies: Packages with known CVEs (via OSV database)
- Out-of-bounds File Access: Accessing
/etc/passwd, SSH keys, or sensitive configs
- Code Obfuscation: Base64, ROT13, or packed code (may be legitimate)
- Dynamic Imports: Use of
__import__ or importlib with variables
- Network Requests: HTTP calls to unknown domains
Low Risk 🟢
- Static Shell Commands: Commands using only string literals
- Standard File Operations: Regular file read/write within the workspace
- Environment Access: Reading environment variables (normal for config)
- Documentation References: API key placeholders in SKILL.md, README.md
When to Use This Skill
- Before installing untrusted skills - Always scan skills from unknown sources
- Periodic audits - Regular security checks of installed skills
- Pre-execution validation - Before running skill scripts that modify system
- Publishing validation - Before publishing skills to ClawHub
- CI/CD integration - Use
--format json for automated security gates
Security Patterns
See security_patterns.md for detailed patterns and detection rules.
Whitelist System
TrustSkill v3.1+ includes comprehensive whitelists for known safe patterns:
Lock Files (Automatically Skipped)
Files containing integrity hashes that are safe by design:
package-lock.json - npm lock file
yarn.lock - Yarn lock file
pnpm-lock.yaml - pnpm lock file
composer.lock - PHP Composer lock file
poetry.lock - Python Poetry lock file
Cargo.lock - Rust Cargo lock file
Gemfile.lock - Ruby Bundler lock file
Documentation Files
Files where placeholder references are expected:
SKILL.md, README.md, AGENTS.md, CHANGELOG.md, LICENSE
Testing Utility Files
Files where shell=True is expected for legitimate testing:
test_*.py, *_test.py, conftest.py
with_server.py, test_server.py, test_helpers.py
Placeholder Patterns
Automatically recognized as safe documentation examples:
your_api_key_here, your_secret_here, your_token_here
sk-..., sk_... (truncated examples)
<API_KEY>, <YOUR_TOKEN>, <SECRET>
${VARIABLE}, {{VARIABLE}} (template patterns)
- i18n patterns: 配置, 设置, 示例, 请将, 填入
Custom Whitelist
Add custom whitelist patterns via YAML configuration:
rules:
whitelist:
files:
- "test_*.py"
- "my_server.py"
patterns:
- "eval\\(\\s*['\"]1\\+1['\"]\\s*\\)"
Best Practices for Interpreting Results
Understanding Confidence Scores
| Score Range |
Interpretation |
| 0.9 - 1.0 |
Very high confidence - likely a real issue |
| 0.7 - 0.9 |
High confidence - investigate thoroughly |
| 0.5 - 0.7 |
Medium confidence - review context |
| < 0.5 |
Low confidence - may be false positive |
Common False Positive Patterns
Integrity Hashes in Lock Files (v3.1+ handles automatically)
"integrity": "sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx..."
→ These are SRI hashes, not secrets
Documentation Placeholders (v3.1+ handles automatically)
export API_KEY="your_api_key_here"
→ This is documentation, not a real secret
Environment Variable References
API_KEY = os.environ.get("MY_API_KEY")
→ This reads from environment, not hardcoded
When to Escalate
Escalate to security review if:
- Multiple HIGH findings in the same skill
- Findings involve external network communication
- Code appears intentionally obfuscated
- Files accessed outside workspace without clear reason
- Pattern suggests credential exfiltration
Response to Findings
Critical (Stop immediately)
- Confirmed backdoor or data exfiltration
- Hardcoded production credentials
- System-level destructive operations
- Action: Delete skill, report to security, rotate any exposed credentials
High Risk (Manual review required)
- Suspicious network requests
- Tainted data reaching dangerous functions
- Command injection patterns
- Action: Full code review, understand intent, proceed only if confident
Medium Risk (Investigate before proceeding)
- Unknown network endpoints
- Dependency vulnerabilities
- File access outside workspace
- Action: Verify legitimacy, document findings, proceed with caution
Low Risk (Document and proceed)
- Environment variable access
- Standard file operations
- Documentation placeholders
- Action: Note findings, proceed normally
Comparison with Previous Versions
| Feature |
v1.x |
v2.0 |
v3.0 |
v3.1 |
| Regex Analysis |
✅ |
✅ |
✅ |
✅ |
| AST Analysis |
❌ |
✅ |
✅ |
✅ |
| Secret Detection |
❌ |
❌ |
✅ |
✅ |
| Dependency Scanning |
❌ |
❌ |
✅ |
✅ |
| Taint Analysis |
❌ |
❌ |
✅ |
✅ |
| YAML Configuration |
❌ |
❌ |
✅ |
✅ |
| Progress Tracking |
❌ |
✅ |
✅ |
✅ |
| Confidence Scoring |
❌ |
✅ |
✅ |
✅ |
| Lock File Whitelist |
❌ |
❌ |
❌ |
✅ |
| Smart Data Flow |
❌ |
❌ |
❌ |
✅ |
| Context-Aware Docs |
❌ |
❌ |
❌ |
✅ |
| i18n Placeholder Support |
❌ |
❌ |
❌ |
✅ |
| False Positive Reduction |
~50% |
~70% |
~85% |
~99% |
Output Formats
- text (default): Colorized terminal output with progress bar
- json: Machine-readable JSON for CI/CD integration
- markdown: Formatted report for LLM review or documentation
Exit Codes
0: No high-risk issues found
1: High-risk issues detected (useful for CI/CD pipelines)
License
MIT License - See the LICENSE file for details.
1---2name: trustskill3description: TrustSkill v3.1 - Advanced security scanner for OpenClaw skills with 99% false positive reduction. Detects malicious code, hardcoded secrets, vulnerable dependencies, tainted data flows, backdoors, credential theft, privacy file access, command injection, file system risks, network exfiltration, and sensitive data leaks. Features entropy-based secret detection, OSV vulnerability database integration, taint analysis, smart data flow detection, context-aware documentation scanning, and flexible YAML configuration.4---56# TrustSkill v3.1 - Advanced Skill Security Scanner78A comprehensive security scanner for OpenClaw skills that detects:9- **Malicious code and backdoors**10- **Hardcoded secrets** (API keys, passwords, tokens via entropy analysis)11- **Vulnerable dependencies** (known CVEs via OSV database)12- **Tainted data flows** (user input to dangerous functions)13- **Credential theft** (SSH keys, passwords, API keys)14- **Privacy file access** (Memory files, configs)15- **Command injection** (eval, exec, os.system)16- **Data uploads** (suspicious POST/PUT requests)17- **File system risks** (destructive operations)18- **Network security issues**1920## What's New in v3.12122### 🔒 NPM Integrity Hash Whitelist23Automatically recognizes and skips npm/pnpm/yarn integrity hashes (`sha512-xxx`) in lock files, eliminating 99% of false positive HIGH findings from `package-lock.json`, `yarn.lock`, and `pnpm-lock.yaml`.2425### 📊 Smart Data Flow Detection26Distinguishes between **data uploads** (HIGH risk) and **data downloads** (MEDIUM risk):27- `requests.post()`, `requests.put()` → `data_upload` (HIGH)28- `urllib.request.urlretrieve()`, `requests.get(stream=True)` → `data_download` (MEDIUM)2930### 📝 Context-Aware Documentation Scanning31Recognizes placeholder patterns and documentation examples:32- Placeholder patterns: `your_api_key_here`, `sk-...`, `<API_KEY>`, `${VARIABLE}`33- i18n patterns: 配置, 设置, 示例, 请将, 填入34- Markdown code blocks in documentation files3536### 🌐 Enhanced Whitelist System37Built-in whitelists for known safe patterns:38- Lock files: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `composer.lock`, `poetry.lock`, `Cargo.lock`39- Documentation files: `SKILL.md`, `README.md`, `AGENTS.md`, `CHANGELOG.md`40- Testing utilities: `test_*.py`, `conftest.py`, `with_server.py`4142## What's New in v3.04344- 🔐 **Secret Detection Engine**: Hybrid entropy + pattern-based detection for AWS, GitHub, OpenAI, and generic API keys45- 📦 **Dependency Vulnerability Scanner**: Checks against OSV (Open Source Vulnerabilities) database46- 🌊 **Taint Analysis**: Tracks data flow from user input to dangerous functions (deep mode)47- ⚙️ **Configuration System**: YAML/JSON-based custom rules, severity overrides, and whitelisting4849## Prerequisites5051**Source the venv environment first before running the python scripts:**52```bash53source /opt/venv/bin/activate && pip -V54# pip 26.0.1 from /opt/venv/lib/python3.12/site-packages/pip (python 3.12)55```5657## Quick Start5859Scan a skill directory:60```bash61python src/cli.py /path/to/skill-folder62```6364## Scanning Modes6566| Mode | Description | Speed | Accuracy | Use Case |67|------|-------------|-------|----------|----------|68| **fast** | Regex + Secrets + Dependencies | ⚡ Fast | ⭐⭐⭐ | Quick initial scan |69| **standard** | Regex + AST + Secrets + Dependencies | ⚡ Balanced | ⭐⭐⭐⭐ | Default, recommended |70| **deep** | Full analysis + Taint Analysis | 🐢 Thorough | ⭐⭐⭐⭐⭐ | Comprehensive audit |7172**Note:** Secret and Dependency analyzers run in all modes because they provide critical security checks with minimal performance overhead.7374## Usage Examples7576### Basic scan77```bash78python src/cli.py ~/.openclaw/skills/some-skill79```8081### Deep scan with JSON output82```bash83python src/cli.py ~/.openclaw/skills/some-skill --mode deep --format json84```8586### Export for manual review87```bash88python src/cli.py ~/.openclaw/skills/some-skill --export-for-llm89```9091### Use custom configuration92```bash93python src/cli.py ~/.openclaw/skills/some-skill --config trustskill.yaml94```9596### Batch scan multiple skills97```bash98for skill in ~/.openclaw/skills/*/; do99 echo "Scanning: $skill"100 python src/cli.py "$skill" --mode deep --format json > "results/$(basename $skill).json"101done102```103104---105106## Comprehensive Skill Scanning Guidance107108### Pre-Scan Checklist109110Before scanning a skill, verify:111112- [ ] **Skill source is known** - Where did this skill come from? (official repo, trusted source, unknown)113- [ ] **Virtual environment is active** - Run `source /opt/venv/bin/activate`114- [ ] **Scan mode is appropriate** - Use `deep` for untrusted skills, `standard` for quick checks115- [ ] **Output format is set** - Use `json` for automation, `text` for manual review116117### Step-by-Step Scanning Workflow118119#### Phase 1: Initial Assessment120121```bash122# Step 1: Quick scan to identify obvious issues123python src/cli.py /path/to/skill --mode fast124125# Step 2: If any HIGH issues found, proceed to deep scan126python src/cli.py /path/to/skill --mode deep --format json > scan_result.json127```128129#### Phase 2: Detailed Analysis130131```bash132# Step 3: Export markdown report for thorough review133python src/cli.py /path/to/skill --mode deep --export-for-llm > scan_report.md134135# Step 4: Review specific file types manually136find /path/to/skill -name "*.py" -exec grep -l "eval\|exec\|os.system" {} \;137```138139#### Phase 3: Validation140141```bash142# Step 5: Check for actual malicious patterns143grep -r "base64.b64decode" /path/to/skill --include="*.py"144grep -r "requests.post" /path/to/skill --include="*.py"145grep -r "subprocess.*shell=True" /path/to/skill --include="*.py"146```147148### Result Interpretation Guide149150#### Severity Levels151152| Level | Icon | Meaning | Action |153|-------|------|---------|--------|154| **HIGH** | 🔴 | Confirmed security risk | **Stop and investigate immediately** |155| **MEDIUM** | 🟡 | Potential risk requiring review | Investigate before proceeding |156| **LOW** | 🟢 | Informational, low risk | Document and proceed with caution |157158#### Finding Categories159160| Category | Risk | Description | Typical Action |161|----------|------|-------------|----------------|162| `command_injection` | HIGH | User input to dangerous functions | **Critical** - Review code flow |163| `data_upload` | HIGH | POST/PUT to external servers | Investigate destination and data |164| `hardcoded_secret` | HIGH | Real API keys/passwords found | Remove and rotate credentials |165| `data_download` | MEDIUM | File downloads from internet | Verify source is legitimate |166| `api_key_usage` | MEDIUM | API key references (docs) | Usually safe if placeholder |167| `network_request` | MEDIUM | HTTP requests | Verify endpoints are legitimate |168| `vulnerable_dependency` | MEDIUM | CVE in dependencies | Update to patched version |169| `environment_access` | LOW | Reading env variables | Normal for configuration |170| `file_operation` | LOW | Standard file I/O | Verify paths are safe |171172### Validation Techniques173174#### 1. Verify Hardcoded Secrets175```bash176# Check if the "secret" is actually a placeholder177grep -B2 -A2 "your_api_key" /path/to/skill/SKILL.md178179# Real secrets are usually in code files, not documentation180grep -r "api_key\s*=\s*['\"]sk-" /path/to/skill --include="*.py"181```182183#### 2. Verify Network Requests184```bash185# Check what data is being sent186grep -B5 -A5 "requests.post" /path/to/skill/scripts/*.py187188# Verify the destination URL189grep -r "https://" /path/to/skill --include="*.py" | grep -v "example.com"190```191192#### 3. Verify Command Injection193```bash194# Check if user input reaches dangerous functions195grep -B10 "eval\|exec\|os.system" /path/to/skill/scripts/*.py196```197198### Red Flags Requiring Immediate Action199200🚨 **STOP IMMEDIATELY** if you find:2012021. **Data Exfiltration Patterns**203 - Sending files to unknown servers204 - POST requests with system information205 - Uploading `.ssh`, `.env`, or credential files2062072. **Backdoor Patterns**208 - Hidden network listeners209 - Encoded/obfuscated malicious code210 - Scheduled tasks creating persistence2112123. **Destructive Operations**213 - `rm -rf /` or equivalent214 - `shutil.rmtree` on user directories215 - Mass file deletion patterns2162174. **Credential Harvesting**218 - Reading `/etc/passwd`, `/etc/shadow`219 - Accessing browser credential stores220 - Extracting SSH private keys221222**Action:** Delete the skill immediately and report to security team.223224---225226## What It Detects227228### High Risk 🔴229- **Tainted Command Injection**: User input flowing to `eval()`, `exec()`, or `os.system()`230- **Hardcoded Secrets**: Real API keys, passwords, tokens (not placeholders)231- **Data Upload**: HTTP POST/PUT to external servers with sensitive data232- **Destructive Operations**: Recursive file/directory deletion (`rm -rf`, `shutil.rmtree`)233- **Credential Harvesting**: Password/key extraction attempts234235### Medium Risk 🟡236- **Data Download**: File downloads from internet (verify source legitimacy)237- **Vulnerable Dependencies**: Packages with known CVEs (via OSV database)238- **Out-of-bounds File Access**: Accessing `/etc/passwd`, SSH keys, or sensitive configs239- **Code Obfuscation**: Base64, ROT13, or packed code (may be legitimate)240- **Dynamic Imports**: Use of `__import__` or `importlib` with variables241- **Network Requests**: HTTP calls to unknown domains242243### Low Risk 🟢244- **Static Shell Commands**: Commands using only string literals245- **Standard File Operations**: Regular file read/write within the workspace246- **Environment Access**: Reading environment variables (normal for config)247- **Documentation References**: API key placeholders in SKILL.md, README.md248249## When to Use This Skill2502511. **Before installing untrusted skills** - Always scan skills from unknown sources2522. **Periodic audits** - Regular security checks of installed skills2533. **Pre-execution validation** - Before running skill scripts that modify system2544. **Publishing validation** - Before publishing skills to ClawHub2555. **CI/CD integration** - Use `--format json` for automated security gates256257## Security Patterns258259See [security_patterns.md](references/security_patterns.md) for detailed patterns and detection rules.260261## Whitelist System262263TrustSkill v3.1+ includes comprehensive whitelists for known safe patterns:264265### Lock Files (Automatically Skipped)266Files containing integrity hashes that are safe by design:267- `package-lock.json` - npm lock file268- `yarn.lock` - Yarn lock file269- `pnpm-lock.yaml` - pnpm lock file270- `composer.lock` - PHP Composer lock file271- `poetry.lock` - Python Poetry lock file272- `Cargo.lock` - Rust Cargo lock file273- `Gemfile.lock` - Ruby Bundler lock file274275### Documentation Files276Files where placeholder references are expected:277- `SKILL.md`, `README.md`, `AGENTS.md`, `CHANGELOG.md`, `LICENSE`278279### Testing Utility Files280Files where `shell=True` is expected for legitimate testing:281- `test_*.py`, `*_test.py`, `conftest.py`282- `with_server.py`, `test_server.py`, `test_helpers.py`283284### Placeholder Patterns285Automatically recognized as safe documentation examples:286- `your_api_key_here`, `your_secret_here`, `your_token_here`287- `sk-...`, `sk_...` (truncated examples)288- `<API_KEY>`, `<YOUR_TOKEN>`, `<SECRET>`289- `${VARIABLE}`, `{{VARIABLE}}` (template patterns)290- i18n patterns: 配置, 设置, 示例, 请将, 填入291292### Custom Whitelist293Add custom whitelist patterns via YAML configuration:294295```yaml296rules:297 whitelist:298 files:299 - "test_*.py"300 - "my_server.py"301 patterns:302 - "eval\\(\\s*['\"]1\\+1['\"]\\s*\\)"303```304305## Best Practices for Interpreting Results306307### Understanding Confidence Scores308309| Score Range | Interpretation |310|-------------|----------------|311| 0.9 - 1.0 | Very high confidence - likely a real issue |312| 0.7 - 0.9 | High confidence - investigate thoroughly |313| 0.5 - 0.7 | Medium confidence - review context |314| < 0.5 | Low confidence - may be false positive |315316### Common False Positive Patterns3173181. **Integrity Hashes in Lock Files** (v3.1+ handles automatically)319 ```320 "integrity": "sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx..."321 ```322 → These are SRI hashes, not secrets3233242. **Documentation Placeholders** (v3.1+ handles automatically)325 ```326 export API_KEY="your_api_key_here"327 ```328 → This is documentation, not a real secret3293303. **Environment Variable References**331 ```332 API_KEY = os.environ.get("MY_API_KEY")333 ```334 → This reads from environment, not hardcoded335336### When to Escalate337338Escalate to security review if:3393401. Multiple HIGH findings in the same skill3412. Findings involve external network communication3423. Code appears intentionally obfuscated3434. Files accessed outside workspace without clear reason3445. Pattern suggests credential exfiltration345346## Response to Findings347348### Critical (Stop immediately)349- Confirmed backdoor or data exfiltration350- Hardcoded production credentials351- System-level destructive operations352- **Action:** Delete skill, report to security, rotate any exposed credentials353354### High Risk (Manual review required)355- Suspicious network requests356- Tainted data reaching dangerous functions357- Command injection patterns358- **Action:** Full code review, understand intent, proceed only if confident359360### Medium Risk (Investigate before proceeding)361- Unknown network endpoints362- Dependency vulnerabilities363- File access outside workspace364- **Action:** Verify legitimacy, document findings, proceed with caution365366### Low Risk (Document and proceed)367- Environment variable access368- Standard file operations369- Documentation placeholders370- **Action:** Note findings, proceed normally371372## Comparison with Previous Versions373374| Feature | v1.x | v2.0 | v3.0 | v3.1 |375|---------|------|------|------|------|376| Regex Analysis | ✅ | ✅ | ✅ | ✅ |377| AST Analysis | ❌ | ✅ | ✅ | ✅ |378| Secret Detection | ❌ | ❌ | ✅ | ✅ |379| Dependency Scanning | ❌ | ❌ | ✅ | ✅ |380| Taint Analysis | ❌ | ❌ | ✅ | ✅ |381| YAML Configuration | ❌ | ❌ | ✅ | ✅ |382| Progress Tracking | ❌ | ✅ | ✅ | ✅ |383| Confidence Scoring | ❌ | ✅ | ✅ | ✅ |384| Lock File Whitelist | ❌ | ❌ | ❌ | ✅ |385| Smart Data Flow | ❌ | ❌ | ❌ | ✅ |386| Context-Aware Docs | ❌ | ❌ | ❌ | ✅ |387| i18n Placeholder Support | ❌ | ❌ | ❌ | ✅ |388| False Positive Reduction | ~50% | ~70% | ~85% | **~99%** |389390## Output Formats391392- **text** (default): Colorized terminal output with progress bar393- **json**: Machine-readable JSON for CI/CD integration394- **markdown**: Formatted report for LLM review or documentation395396## Exit Codes397398- `0`: No high-risk issues found399- `1`: High-risk issues detected (useful for CI/CD pipelines)400401## License402403MIT License - See the [LICENSE](LICENSE) file for details.