项目 / NVIDIA/SkillSpector
扫描 AI agent 技能包的安全风险:注入、恶意模式、数据泄露。
本站整理,非 GitHub 官方 description。
官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。
以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。
安装 SkillSpector 前需先创建并激活虚拟环境,所有 make 目标假定该环境已激活,可用 uv 或 pip 安装。
SkillSpector 支持扫描 Git 仓库、URL、zip 等多种输入,内置 71 种漏洞模式,采用静态加可选 LLM 的两阶段分析,并输出风险评分与 SARIF 等多种报告格式。
来自 GitHub 仓库 README / 主页介绍正文,正文较长,已截断:保留前 20000 字符(原始 73,814 字节),完整内容见 GitHub 仓库。
# SkillSpector **Security scanner for AI agent skills.** Detect vulnerabilities, malicious patterns, and security risks before installing agent skills. [](https://www.python.org/downloads/) [](https://www.apache.org/licenses/LICENSE-2.0) ## Overview AI agent skills (used by Claude Code, Codex CLI, Gemini CLI, etc.) execute with implicit trust and minimal vetting. In the 31,132-skill analyzed subset of the research dataset, **26.1% of skills contain vulnerabilities** and **5.2% show likely malicious intent**. SkillSpector helps you answer: **"Is this skill safe to install?"** SkillSpector is part of the [NVIDIA Verified Skills pipeline](https://docs.nvidia.com/skills/), which scans, evaluates, and signs agent skills before publication. Skills that pass are published to the [NVIDIA skills catalog](https://github.com/NVIDIA/skills). ## Documentation - **[Scan agent skills before installation](https://docs.nvidia.com/skills/scanning-agent-skills)** — Hosted guide: when to scan, how to read a report, and how to gate installs. - **[Development guide](docs/DEVELOPMENT.md)** — Architecture, package layout, and how to extend the analyzer pipeline. - **[Security policy](SECURITY.md)** — Report suspected vulnerabilities privately to NVIDIA PSIRT. - **[Analysis resource bounds](docs/ANALYSIS_RESOURCE_BOUNDS.md)** — Fail-closed bundle, parser, nested-artifact, ledger, and finding ceilings. - **[Pi extension](docs/PI_EXTENSION.md)** — Install SkillSpector as a Pi tool for scanning skills from inside agent sessions. - **[OpenCode extension](docs/OPENCODE_EXTENSION.md)** — Install SkillSpector as an OpenCode tool and `/skillspector` command for scanning skills from inside agent sessions. - **[LLM analyzer base guide](docs/LLM_ANALYZER_BASE_GUIDE.md)** — How to build LLM-powered analyzer nodes on top of `LLMAnalyzerBase`. - **[Dependency source redirection](docs/DEPENDENCY_SOURCE_REDIRECTION.md)** — How SC10 findings flag a skill that changes where its packages are fetched from. - **[Live vulnerability lookups (SC4)](docs/SC4-osv-live-vulnerability-lookups.md)** — How SC4 checks dependencies against OSV.dev. - **[Eval dataset scanning](docs/EVAL_DATASETS.md)** — Which eval dataset files the static pattern analyzers skip. - **[MCP least-privilege analysis (LP1–LP4)](docs/B.3.1-mcp-least-privilege.md)** and **[MCP tool-poisoning detection (TP1–TP4)](docs/B.3.2-mcp-tool-poisoning.md)** — Design notes for the MCP analyzers. ## Features - **Multi-format input**: Scan Git repos, URLs, zip files, directories, or single files - **71 vulnerability patterns** across 17 categories: prompt injection, data exfiltration, privilege escalation, supply chain, excessive agency, output handling, system prompt leakage, memory poisoning, tool misuse, rogue agent, anti-refusal, trigger abuse, dangerous code (AST), taint tracking, YARA signatures, MCP least privilege, and MCP tool poisoning - **Two-stage analysis**: Fast static analysis + optional LLM semantic evaluation - **Live vulnerability lookups**: SC4 queries [OSV.dev](https://osv.dev) for real-time CVE data with automatic offline fallback - **Multiple output formats**: Terminal, JSON, Markdown, and SARIF reports - **Risk scoring**: 0-100 score with severity labels and clear recommendations - **Baseline / false-positive suppression**: Accept known findings via a glob-rule or fingerprint baseline so re-scans surface only *new* issues ([docs](docs/SUPPRESSION.md)) ## Quick Start ### Installation > **Open-source software notice:** This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use. Use **Python 3.12 or 3.13** for installation with prebuilt YARA wheels on supported platforms. The examples below select 3.13 explicitly; see the [Python installation notes](#python-installation-notes) for newer interpreters. For source installs, create and activate a virtual environment first (all `make` targets assume the venv is active). Use **uv** or **pip**; the Makefile uses `uv` if available, otherwise `pip`. Once a release is available on [PyPI](https://pypi.org/project/skillspector/), install or upgrade SkillSpector from a Python virtual environment: ```bash python -m pip install --upgrade skillspector # To include the optional MCP server: python -m pip install --upgrade 'skillspector[mcp]' ``` Verify the installation with `skillspector --version`. The GitHub installation below works ahead of the first PyPI release and for users following development. **Quick install with uv (CLI-only):** ```bash uv tool install --python 3.13 git+https://github.com/NVIDIA/skillspector.git # Update later: uv tool update skillspector ``` If you plan to run `skillspector mcp`, install the MCP extra at install time: ```bash uv tool install --python 3.13 'skillspector[mcp] @ git+https://github.com/NVIDIA/skillspector.git' ``` **From source:** ```bash # Clone the repository git clone https://github.com/NVIDIA/skillspector.git cd skillspector # Create and activate virtual environment uv venv --python 3.13 .venv && source .venv/bin/activate # or: python3.13 -m venv .venv && source .venv/bin/activate # Install for production use make install ``` To contribute, follow the [Development setup](#setup) for a supported Python interpreter and development dependencies. ### Python installation notes The package declares Python `>=3.12,<3.16` in [pyproject.toml](pyproject.toml). That range does not guarantee prebuilt wheels for every dependency and platform. [yara-python 4.5.4 on PyPI](https://pypi.org/project/yara-python/4.5.4/#files) provides CPython 3.12/3.13 wheels, but no CPython 3.14/3.15 wheels. Installing it on those newer interpreters requires a native source build with a C toolchain and Python development headers. Such builds can fail with OpenSSL 4 headers; [issue #1008](https://github.com/NVIDIA/SkillSpector/issues/1008) tracks that installation problem and upstream wheel availability. If installation fails while compiling YARA, select Python 3.12 or 3.13 explicitly using the commands above. For a new CLI-only installation with `pipx`, first install Python 3.13 and make `python3.13` available on PATH, then run: ```bash pipx install --python python3.13 git+https://github.com/NVIDIA/skillspector.git ``` The upstream [wheel-build update](https://github.com/VirusTotal/yara-python/pull/281) is separate from publishing a new release to PyPI. Check the published files before choosing a newer interpreter; a source build may still be required. ### Docker (no Python required) Run SkillSpector without installing Python by building it locally from the included [Dockerfile](Dockerfile). The image is based on the Docker Official Python `3.12-slim-bookworm` image. **Build the image:** ```bash make docker-build # or: docker build -t skillspector . ``` **Scan a local directory** by mounting your current directory into `/scan`, the container's working directory: ```bash docker run --rm -v "$PWD:/scan" skillspector scan ./my-skill/ --no-llm ``` **Scan with LLM analysis** by passing credentials with a local `.env` file: ```bash cat > .env <<'EOF' SKILLSPECTOR_PROVIDER=anthropic ANTHROPIC_API_KEY=sk-ant-... EOF ``` ```bash docker run --rm \ -v "$PWD:/scan" \ --env-file .env \ skillspector scan ./my-skill/ ``` Or pass credentials directly from your shell environment: ```bash docker run --rm \ -v "$PWD:/scan" \ -e SKILLSPECTOR_PROVIDER=anthropic \ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \ skillspector scan ./my-skill/ ``` **Write a report to the host filesystem** by writing to the mounted directory: ```bash docker run --rm --user "$(id -u):$(id -g)" \ -v "$PWD:/scan" \ skillspector scan ./my-skill/ --no-llm --format json --output report.json ``` **Optional alias** for repeated static scans: ```bash alias skillspector-docker='docker run --rm -v "$PWD:/scan" skillspector' skillspector-docker scan ./my-skill/ --no-llm ``` ### Basic Usage ```bash # Scan a local skill directory skillspector scan ./my-skill/ # Scan a single SKILL.md file skillspector scan ./SKILL.md # Scan a Git repository skillspector scan https://github.com/user/my-skill # Scan a zip file skillspector scan ./my-skill.zip ``` #### Size limits SkillSpector enforces two independent caps on remote and archive inputs to bound the impact of oversized downloads and zip bombs: - **Per-ingest cap**: `INGEST_MAX_BYTES` (100 MiB) — applied to streamed URL downloads, total uncompressed size of zip archives, and post-clone disk usage of Git repos. - **Zip member cap**: `INGEST_MAX_ZIP_MEMBERS` (10,000) — caps the number of entries in a single zip. Note that the per-file 1 MB analysis cap (`MAX_FILE_BYTES`) is a separate, downstream limit: it bounds what individual analyzers will read out of an already-ingested directory. The ingest caps above bound how much content can land on disk in the first place. A breach of either ingest cap fails closed with an `IngestLimitExceededError`. ### Output Formats ```bash # Terminal output (default) - pretty formatted skillspector scan ./my-skill/ # JSON output - machine readable skillspector scan ./my-skill/ --format json --output report.json # Markdown output - for documentation skillspector scan ./my-skill/ --format markdown --output report.md # SARIF output - for CI/CD integration and IDE tooling skillspector scan ./my-skill/ --format sarif --output report.sarif ``` ### Recursive Collection Scanning Use `--recursive` to scan a local collection's immediate child directories as independent skills. A child can contain `SKILL.md`, `skill.md`, or a supported AISOP/AISP bundle, such as `.aisop/workflow.aisop.json`. If the scan root itself contains `SKILL.md` or `skill.md`, SkillSpector scans that root as one skill. To scan children independently, point the command at a collection root without a Markdown skill manifest. Recursive output combines the child results in one report. The default aggregate limit is **32 skills**. To raise or lower it: ```bash skillspector scan ./my-skills/ --recursive --max-skills 100 --no-llm --format json ``` `--max-skills` requires a local recursive collection and a positive integer; `0` does not mean unlimited. Discovery, byte, finding-record, time and report-size budgets still apply, so increasing the count does not guarantee complete coverage. When the count limit is reached, the CLI names the limit and suggests adjusting it or scanning sub-skills separately. The aggregate report records the omission count and reason, and coverage stays incomplete. Use `--fail-on-incomplete` in CI to fail on incomplete coverage. ### Batch Scanning Scan entire directories of skills in parallel from `contrib/batch_scan/`: ```bash python -m contrib.batch_scan.batch_scan ./my-skills/ --no-llm python -m contrib.batch_scan.batch_scan ./my-skills/ --workers 20 -f json -o report.json python -m contrib.batch_scan.batch_scan ./tests/fixtures/ -f terminal --workers 20 ``` Supports multilingual detection (zh/ja/ko) and terminal/JSON/Markdown output. For LLM scans with higher concurrency, configure multiple API keys following [`.env.example`](contrib/batch_scan/.env.example) — the pool improves throughput and resilience, provided the keys don't share an account-level rate limit. See the [contrib guide](contrib/batch_scan/docs/) for details. > **Note on LLM support:** The default configuration targets DeepSeek as the > cheapest public option. DeepSeek-Chat is > [expected to sunset](https://api-docs.deepseek.com/), and the contributor > does not have hardware to test against local models. The batch scanner was > originally tested with OpenAI-compatible endpoints — DeepSeek's lack of > structured-output support required manual JSON-parsing patches. If you can > contribute a more universal backend (Ollama, vLLM, or a different provider), > PRs are very welcome. ### Comparing MCP Registry snapshots A named scan fetches only that server's published versions from the official registry, then selects entries marked as latest. If none are marked as latest, all matching versions are assessed. The server name remains the report source: ```bash skillspector scan 'ac.inference.sh/mcp' --mcp-registry --format json --output current.json ``` Use `https://registry.modelcontextprotocol.io/v0.1/servers` as the input to scan the full catalog. Named lookups also use this stable API. The exact legacy URL `https://registry.modelcontextprotocol.io/v0/servers` remains supported. Other URLs, including URLs with queries or fragments, are rejected. Local registry captures are supported as UTF-8 JSON, with or without a leading UTF-8 byte-order mark (BOM). The same encoding is accepted for saved Registry reports used with `--mcp-registry-compare`. Start with raw registry payload captures (`registry-before.json` and `registry-after.json`). Save a scan report as `previous.json`, then compare a later scan against that generated local report: ```bash skillspector scan registry-before.json --mcp-registry --format json --output previous.json skillspector scan registry-after.json --mcp-registry --format json \ --mcp-registry-compare previous.json --output compared.json ``` The optional `comparison` object lists added and removed server identities, changed normalized fields with their previous and current values, and an `unchanged_count`. Identity is the server name and version, so a new version appears as an addition and the old version as a removal if it is absent from the new scan. Acquisition source and scan timestamp are excluded from comparison. `unmodeled_changes` lists same-identity records whose raw-record hash changed while normalized fields match; these are not counted as unchanged. This can indicate a change to fields outside the snapshot model, or array reordering in the raw record. Package and remote ordering alone is not a normalized field change. Entries in `changed` may also contain changes outside the snapshot model; inspect the raw record to see those changes. Compare reports with the same selection scope: a server absent from the current input is reported as removed, which does not prove it was removed from a registry. The comparison file must be a local report produced by this registry mode with valid normalized snapshots. Malformed, oversized or duplicate server identities are rejected. This option requires `--mcp-registry` and is separate from the finding-suppression `--baseline`: it never suppresses findings or changes risk scores, and it does not fetch or execute listed server endpoints. Registry mode rejects skill-only controls such as `--use-shipped-baseline`, `--transitive`, `--transitive-depth`, `--transitive-allow-prefix`, and `--transitive-deny-prefix` with exit code 2, including an explicitly supplied default depth (`--transitive-depth 1`). Omit these options for registry scans. ### Suppressing False Positives (baseline) Suppress known/accepted findings so the risk score reflects only un-triaged issues and re-scans surface only *new* findings. See the [suppression guide](docs/SUPPRESSION.md) for the full reference. ```bash # Accept all current findings into a baseline (run once), then commit it. skillspector baseline ./my-skill/ -o .skillspector-baseline.yaml # Scan against the baseline — only NEW findings are reported and scored. skillspector scan ./my-skill/ --baseline .skillspector-baseline.yaml # Review what was suppressed (still excluded from the score). skillspector scan ./my-skill/ --baseline .skillspector-baseline.yaml --show-suppressed ``` A baseline can also use drift-tolerant glob rules (by rule id, file path, or message) — see [`.skillspector-baseline.example.yaml`](.skillspector-baseline.example.yaml). Exact fingerprint baselines are evidence-bound: changing the scanned source or SkillSpector version keeps the finding active until it is reviewed again. When a selected baseline or baseline output is stored inside the skill directory, SkillSpector excludes that exact file from content analysis so its suppression text cannot create findings or enter regenerated fingerprints; sibling files remain in normal scan scope. ### Explicit scan scope For a local directory containing one `SKILL.md` or `skill.md`, repeat `--exclude` to omit selected files before content analysis: ```bash skillspector scan ./my-skill --exclude 'tests/*' --exclude 'fixtures/*.json' ``` Patterns are case-sensitive globs matched against the entire relative POSIX path; `*` also matches `/`. Quote patterns so your shell does not expand them. This is an explicit caller option, not an author-controlled ignore file. Patterns matching either manifest name (`SKILL.md` or `skill.md`) are rejected, as are recursive, multi-skill, transitive, registry, and non-directory inputs. No-match patterns are still recorded in the report. Files already outside the scan inventory, such as policy-excluded dependencies, retain their existing policy handling and are not counted as caller exclusions. Explicitly excluded inventory files remain in the coverage denominator as entirely uninspected. The report lists the applied patterns, excluded count and individual skipped paths; any matched exclusion makes coverage partial and prevents a `SAFE` recommendation. Use `--fail-on-incomplete` when partial scope should fail CI. These exclusions do not suppress findings in included files or override existing safety limits. ### LLM Analysis For the best results, configure an OpenAI-compatible LLM endpoint for semantic analysis. Pick a provider with `SKILLSPECTOR_PROVIDER`; hosted providers ship bundled default models, while CLI providers fall back to the local runtime's default model unless `SKILLSPECTOR_MODEL` is set. SkillSpector also works against local OpenAI-compatible servers (Ollama, vLLM, llama.cpp) and managed inference gateways. | Provider (`SKILLSPECTOR_PROVIDER`) | Credential env var | Endpoint | Default model | | ---------- | ---- | ---- | ---- | | `openai` | `OPENAI_API_KEY` (+ optional `OPENAI_BASE_URL`) | api.openai.com (or any OpenAI-compatible URL) | `gpt-5.4` | | `anthropic` | `ANTHROPIC_API_KEY` | api.anthropic.com | `claude-opus-4-6` (`meta_analyzer`: `claude-sonnet-4-6`) | | `anthropic_proxy` | `ANTHROPIC_PROXY_API_KEY` + `ANTHROPIC_PROXY_ENDPOINT_URL` | Any Vertex-style raw-predict proxy | `claude-sonnet-4-6` | | `minimax` | `MINIMAX_API_KEY` (+ optional `MINIMAX_REGION`) | Global or China regional endpoint | `MiniMax-M3.1-Flash` | | `bedrock` | `AWS_PROFILE` (optional) + `AWS_REGION` — SigV4 via boto3 | AWS Bedrock Runtime | `us.anthropic.claude-sonnet-4-6` | | `nv_build` | `NVIDIA_INFERENCE_KEY` | build.nvidia.com | `z-ai/glm-5.3-flash` | | `gemini` | `GOOGLE_CLOUD_PROJECT` (+ optional `GOOGLE_CLOUD_LOCATION`) via ADC | Google Cloud OpenAI-compatible Gemini endpoint | `gemini-3.8-flash` | | `ollama` | _(none)_ | `OLLAMA_BASE_URL` (default `http://localhost:11434/v1`) | `llama3.1:8b` | | `azure_openai` | `AZURE_OPENAI_API_KEY` + `AZURE_OPENAI_ENDPOINT` | Azure OpenAI Service | `gpt-4o` (deployment defaults to the model label) | | `openai_compatible` | `SKILLSPECTOR_COMPAT_API_KEY` + `SKILLSPECTOR_COMPAT_BASE_URL` | Any OpenAI-compatible endpoint | `llama-3.1-70b-versatile` | | `claude_cli` | _(none — uses local CLI auth)_ | local `claude` binary | local Claude runtime fallback, or `SKILLSPECTOR_MODEL` | | `codex_cli` | Disabled | Registered for compatibility; its read-only sandbox permits host-file reads | Use an HTTP API provider or another supported CLI provider | | `gemini_cli` | _(none — uses local CLI auth)_ | local `gemini` binary | local Gemini runtime fallback, or `SKILLSPECTOR_MODEL` | | `opencode_cli` | _(none — uses local CLI auth)_ | local `opencode` (verified 1.18.31–1.18.35, 1.19.0–1.19.4) binary | local OpenCode runtime fallback, or