Skip to content
Back to skills

Skill Security Auditor

ASecurity

Scans an AI agent skill folder for prompt injection, dangerous Python code (eval, shell, exfiltration, credential reads) and supply chain risks (typosquats, unpinned or inline installs). Use when vetting an untrusted skill before install, gating installs in CI, or auditing installed skills.

  • 1,271 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 30, 2026
ai-agentspythonrustgoshellbashexpressawstestinggitapi

Works with

  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add borghei/Claude-Skills --skill skill-security-auditor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill Security Auditor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill Security Auditor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borghei-skill-security-auditor/badge)](https://www.skillsdirectory.com/skills/borghei-skill-security-auditor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: skill-security-auditor
description: >
  Scans an AI agent skill folder for prompt injection, dangerous Python code (eval, shell, exfiltration,
  credential reads) and supply chain risks (typosquats, unpinned or inline installs). Use when
  vetting an untrusted skill before install, gating installs in CI, or auditing installed skills.
license: MIT + Commons Clause
metadata:
  version: 1.1.0
  author: borghei
  category: engineering
  domain: ai-security
  tier: POWERFUL
  updated: 2026-11-08
  frameworks: static-analysis, supply-chain-security
  tags:
    - skill-security
    - prompt-injection
    - supply-chain
    - code-scanning
    - ai-security
---
# 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

- **Code execution risk detection** — command injection (`os.system`, `subprocess shell=True`, backticks), `eval`/`exec`/`compile`, obfuscation (base64/hex/`chr()`), network exfiltration, credential harvesting (`~/.ssh`, `~/.aws`), privilege escalation.
- **Prompt injection detection** — system-prompt overrides, role hijacking, safety bypass, hidden zero-width/HTML-comment instructions, data-extraction and credential-access directives, instructions to conceal actions from the user, excessive-permission requests.
- **Supply chain analysis** — typosquatted Python package names, unpinned versions in `requirements*.txt` and `package.json`, inline `pip`/`npm install`. Pinned versions are not checked against advisories; run `pip-audit`, `npm audit` or OSV-Scanner for CVEs.
- **Manual structure review** (checklist in `references/audit-output-and-workflow.md`, not automated) — out-of-scope paths, hidden or credential files, unexpected binaries, escaping symlinks, oversized payloads.
- **Verdict & reporting** — PASS / WARN / FAIL with severity-categorized findings, remediation, and a strict mode for CI gates.

## When to Use

- Evaluating a skill from an untrusted source before installation
- Pre-install security gate for CI/CD pipelines
- Auditing a skill directory or git repository for malicious code
- Reviewing skills before adding them to a team's approved list
- Post-incident scanning of installed skills

## 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.

- **Target path:** the skill file or directory to scan (the subject of every scanner).
- **Scan dimensions:** code execution / prompt injection / supply chain (selects which of the three scanners run).
- **Strict mode / gate threshold:** whether any HIGH finding forces FAIL (CI gate vs advisory report changes the verdict).

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 | `python3 scripts/code_scanner.py <target> --strict --format json` |
| `prompt_injection_scanner.py` | Scan markdown/text for prompt-injection patterns and hidden directives | `python3 scripts/prompt_injection_scanner.py <target> --strict --format json` |
| `supply_chain_checker.py` | Check imports/requirements for typosquatting, unpinned versions, inline installs | `python3 scripts/supply_chain_checker.py <target> --strict --format json` |

All tools take a `target` (file or directory) and support `--strict` (any HIGH becomes FAIL) and
`--format text|json` (`--json` is a legacy alias).

## Exit codes

| Code | Meaning |
|------|---------|
| `0` | PASS: no CRITICAL or HIGH findings (INFO findings such as unpinned versions may still print) |
| `1` | FAIL (any CRITICAL, or any HIGH with `--strict`) or WARN (HIGH findings without `--strict`): read the flagged lines |
| `2` | Unusable input: target missing, nothing scannable for that tool, only empty files, or a `package.json` that is not valid JSON. One `UNUSABLE:` line 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. Single-file
sound / flawed / malformed samples for each tool are listed in `assets/contract.json`.

```bash
python3 scripts/code_scanner.py assets/flawed_helper.py
```

```text
|  CODE SECURITY SCAN REPORT                            |
|  Files scanned: 1                                     |
|  Verdict: FAIL                                        |
|  CRITICAL: 4  |  HIGH: 0  |  INFO: 2
CRITICAL [CMD-INJECT] assets/flawed_helper.py:9
  Pattern: os.system("cat " + path)
  Fix: Use subprocess.run() with a list of arguments and shell=False
```

## References

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

- **[references/threat-model-and-patterns.md](references/threat-model-and-patterns.md)** — the attack-vector threat model, trust boundaries, full regex pattern sets for code-execution and prompt-injection detection, and known evasion techniques. Read when deciding what to scan for or tuning detection.
- **[references/audit-output-and-workflow.md](references/audit-output-and-workflow.md)** — the report format, verdict criteria (incl. strict mode), CI/CD integration YAML, and the manual audit checklist. Read when producing or interpreting an audit.
- **[references/quality-and-best-practices.md](references/quality-and-best-practices.md)** — static-analysis limitations, common pitfalls, best practices, troubleshooting matrix, and success criteria. Read before shipping or relying on an audit.

## Scope & Limitations

**This skill covers:**
- Static pattern-based detection of dangerous code constructs in Python files (other languages need a manual read)
- Prompt injection scanning across markdown, text, YAML, reST and AsciiDoc files within a skill package
- Dependency checks for `requirements*.txt` and `package.json`, plus inline installs in `.py` and `.sh` files
- A manual checklist for structure risks (symlinks, binaries, hidden files, oversized payloads)

**This skill does NOT cover:**
- Runtime or dynamic analysis — code is never executed during the audit (see `skill-tester` for runtime validation)
- Live CVE database lookups or real-time vulnerability feeds (see `dependency-auditor` for active CVE scanning)
- Infrastructure-level security controls such as network segmentation, container hardening, or cloud IAM policies (see `infrastructure-compliance-auditor` in ra-qm-team)
- Compliance framework certification against ISO 27001, SOC 2, GDPR, or other regulatory standards (see `information-security-manager-iso27001` and `gdpr-dsgvo-expert` in ra-qm-team)

## 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 |

Files in this skill

  • SKILL.md20.2 KB
  • scripts/code_scanner.py15.1 KB
  • scripts/prompt_injection_scanner.py16.7 KB
  • scripts/supply_chain_checker.py14 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.