Skill security auditor

From borghei/Claude-Skills · View interactive version

Skill security auditor is an AI agent skill from the GitHub repository borghei/Claude-Skills. Security audit and vulnerability scanning for AI agent skills before install. Detects prompt injection, dangerous code, exfiltration, credential harvesting, and supply chain risks. Use when evaluating untrusted skills or gating installs.

How to use this skill

Skill file

Skill Security Auditor

Scan and audit AI agent skills for security risks before installation. Performs static analysis on Python files for dangerous patterns, scans markdown, text and YAML for prompt injection, and checks dependency manifests. Produces a PASS / WARN / FAIL verdict with findings by severity and remediation guidance.

What a verdict means. The scanners match regular expressions line by line. They catch the common, unobfuscated forms of each attack and are easy to evade (string building, encoding, indirection through helpers). PASS means "nothing obvious was found", not "safe". For any skill from an untrusted source, read the scripts yourself after a PASS, and treat WARN as "read these lines before installing".

Core Capabilities

When to Use

Clarify First

Before the audit, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Tools

| Tool | Purpose | Command |

|------|---------|---------|

| code_scanner.py | Scan Python scripts for eval/exec, subprocess, network exfiltration, credential harvesting, obfuscation, unsafe imports | python scripts/code_scanner.py <target> --strict --json |

| prompt_injection_scanner.py | Scan markdown/text for prompt-injection patterns and hidden directives | python scripts/prompt_injection_scanner.py <target> --strict --json |

| supply_chain_checker.py | Check imports/requirements for typosquatting, unpinned versions, inline installs | python scripts/supply_chain_checker.py <target> --strict --json |

All tools take a target (file or directory), and support --strict (any HIGH → FAIL) and --json.

Exit codes: 0 PASS or WARN, 1 FAIL (any CRITICAL, or any HIGH with --strict), 2 target

does not exist. A directory with nothing scannable exits 0 with a note on stderr.

Samples: assets/sample_malicious_skill/ (hidden override comment, credential read with a

clause asking the assistant to hide it, os.system concatenation, ~/.ssh exfiltration, a typosquatted

reqeusts pin) fails all three scanners; assets/sample_benign_skill/ passes all three.

python scripts/code_scanner.py assets/sample_malicious_skill              # exit 1
python scripts/prompt_injection_scanner.py assets/sample_malicious_skill  # exit 1
python scripts/supply_chain_checker.py assets/sample_benign_skill         # exit 0

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

Scope & Limitations

This skill covers:

This skill does NOT cover:

Integration Points

| Skill | Integration | Data Flow |

|-------|-------------|-----------|

| dependency-auditor | Feed audit findings into live CVE scanning for flagged dependencies | Security audit report → dependency-auditor for real-time vulnerability lookup |

| ci-cd-pipeline-builder | Embed the audit workflow as a required check in generated CI/CD pipelines | Pipeline template ← audit job YAML from this skill's CI/CD section |

| skill-tester | Run dynamic runtime tests on skills that pass static analysis | PASS verdict from this skill → skill-tester for behavioral validation |

| infrastructure-compliance-auditor | Extend auditing scope from skill-level to infrastructure-level security controls | Skill audit findings → infrastructure auditor for environment-wide posture review |

| env-secrets-manager | Cross-reference credential harvesting findings with secrets management policy | Credential-access flags from audit → env-secrets-manager for policy verification |

| pr-review-expert | Surface audit findings as inline PR review comments on flagged lines | Audit report line references → PR review annotations for developer visibility |

Anti-Patterns

Treating PASS as Safe

Mistake: Installing an untrusted skill because all three scanners returned PASS.

Why it happens: A green verdict reads like a clearance.

Instead: The scanners are regex tripwires. Read every script in an untrusted skill, look for string-built commands, encoded blobs and network calls, and only then install.

Running the Target's Code to Audit It

Mistake: Executing a suspicious skill's scripts (or its test runner) to "see what it does".

Why it happens: Dynamic testing feels more thorough.

Instead: Audit statically first. Run code only in a disposable sandbox with no credentials and no network, and only after the static pass is clean.

Equating Pinned With Patched

Mistake: Accepting a dependency list because every version is pinned.

Why it happens: The checker's unpinned warnings disappear.

Instead: Pinning makes builds reproducible, not safe. Run the ecosystem's advisory scanner on the pinned set.

Files

| File | Purpose |

|------|---------|

| scripts/code_scanner.py | Python code patterns: command injection, eval/exec, obfuscation, exfiltration, credential harvesting |

| scripts/prompt_injection_scanner.py | Prompt-injection patterns in markdown, text and YAML |

| scripts/supply_chain_checker.py | Typosquats, unpinned versions, inline installs |

| assets/sample_malicious_skill/ | Hostile fixture (all scanners exit 1) |

| assets/sample_benign_skill/ | Benign fixture (all scanners exit 0) |

| references/*.md | Threat model and patterns, report format and CI wiring, limitations and checklists |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.