Skill and MCP scanning

Scanner settings

Change the settings the skill scanner and MCP scanner share: the LLM judge, a local judge, how config reaches a scan, and the pinned scanner versions.

The skill scanner and the MCP scanner are set up the same way. This page holds what they share. Each scanner's own keys are on its page: Skill scanner and MCP scanner.

Change a setting

Every scanner setting lives in config.yaml, under scanners.skill_scanner or scanners.mcp_scanner. You can change it three ways:

WayUse it for
defenseclaw config set <key> <value>One key, validated and applied at once.
defenseclaw setup skill-scanner or setup mcp-scannerA guided wizard; add --non-interactive and flags in scripts.
An edit to config.yamlSeveral keys at once.

All three go through the same validator. A change that does not validate is refused and the file is left as it was.

No scanner key needs a gateway restart. The gateway builds a new policy generation, swaps it in and restarts only its install watcher, so the next scan and the rescan of installed assets use the new settings. config set prints a restart hint only for keys that need one. If a hand edit does not validate, the old generation keeps running and defenseclaw doctor reports the failed reload.

The judge

Both scanners use an LLM judge to read an asset the way an agent would. The rules alone miss most malicious assets, so set one up.

defenseclaw setup llm
defenseclaw keys set DEFENSECLAW_LLM_KEY

With judge_source: inherit (the default), the judge is DefenseClaw's top-level llm: block: provider, model, key and base URL. The guardrail judge and the plugin scanner use the same block. The recommended model is anthropic/claude-sonnet-5-5. Unified LLM key has the key resolution order.

Give one scanner its own judge

Fill the scanner's llm block and switch the source. Replace skill_scanner with mcp_scanner for the MCP scanner. judge_source and llm are checked together, so unset judge_source first:

defenseclaw config unset scanners.skill_scanner.judge_source
defenseclaw config set scanners.skill_scanner.llm.provider anthropic
defenseclaw config set scanners.skill_scanner.llm.model claude-sonnet-5-5
defenseclaw config set scanners.skill_scanner.llm.api_key_env ACME_SKILL_JUDGE_KEY
defenseclaw config set scanners.skill_scanner.judge_source override
~/.defenseclaw/config.yaml (excerpt)
scanners:
  skill_scanner:
    judge_source: override
    llm:
      provider: anthropic
      model: claude-sonnet-5-5
      api_key_env: ACME_SKILL_JUDGE_KEY

Fields you leave empty in the scanner's llm block fall back to the top-level block. To go back to the shared judge, unset judge_source, then llm, in that order.

The validator refuses two combinations:

  • inherit with a filled llm block.
  • override without llm.model.

A refused change names the key and the rule, for example config.yaml was not changed: scanners.skill_scanner.llm.model: judge_source: override needs a model. Correct the value, then run again.

A local judge

To keep the judge on your network, serve an OpenAI-compatible model with vLLM and use the vllm provider with its base URL. Pass disable_any_whitespace: the judge answers in JSON, and without it vLLM can pad the answer with whitespace up to the token limit, and the analysis is lost.

vllm serve /models/acme-judge-8b --served-model-name acme-judge-8b \
  --structured-outputs-config '{"backend": "xgrammar", "disable_any_whitespace": true}'

defenseclaw setup llm --provider vllm --model acme-judge-8b \
  --base-url http://127.0.0.1:8000/v1 --non-interactive

When the provider is vllm, the scanner wizards print the serve line for you.

With no judge

Until a judge works, each scanner still runs its static rules, so an asset is not left unscanned. Treat that as a gap to close, not a setup.

ScannerWithout a judge
Skill scannerRuns the static rules with the same quiet policy. defenseclaw doctor and the wizard warn.
MCP scannerAutomatic analyzer selection runs YARA alone. A scan prints LLM analyzer skipped when a model is set but its key is missing, and nothing when no model is set.

How the settings reach the scanner

Everything a scan does comes from config.yaml. Your shell and the files of the asset being scanned do not change which settings a scan uses.

  • The environment is built from config. Scans clear any inherited SKILL_SCANNER_*, MCP_SCANNER_*, AI_DEFENSE_*, VIRUSTOTAL_* and ENABLE_*_ANALYZER variable. The gateway passes a short allowlist (PATH, home and temp folders, locale, proxy and CA settings, and the AWS, Azure and Google credential chains keyless judges sign with), plus the judge values derived from config. Where config and your shell both set a value, config wins.
  • .skill_scannerrc is not read. An rc file in a skill folder changes nothing.
  • DefenseClaw applies the gate itself. It never passes --fail-on-severity to the skill scanner; it reads the JSON findings and applies the gate.
  • A failed scan fails closed. Any non-zero scanner exit is a scan_error that carries the scanner's stderr. The skill scanner exits 2 when the judge, behavioral or meta analyzer cannot start (a missing key, an unreachable model, a bad option). The install watcher blocks an asset whose scan errors, and the CLI exits non-zero.

A skill judge that does not answer fails the scan

When the judge starts but its calls fail (an outage, blocked egress, a model error), the skill scanner reports an INFO LLM_ANALYSIS_FAILED finding and DefenseClaw treats the scan as failed. The watcher blocks the skill (scanner failure (fail-closed): ... the LLM judge did not run), and defenseclaw doctor warns about the outage for a day. Once the judge answers again, defenseclaw skill restore <name> brings the skill back and scans it again. To scan with the static rules on purpose, pass --no-use-llm to skill scan.

Scanner processes are supervised

The gateway starts every external scanner under a process-tree supervisor:

OSSupervisor
LinuxA child-subreaper custodian.
macOSA supervisor that follows each process with kqueue.
WindowsA kill-on-close Job Object.

A scanner may start helpers: skill-scanner starts its CEL helper on every scan, and a local stdio MCP server or a subprocess-based judge also runs. The supervisor ends the scanner and its descendants when the scan ends, is canceled, or the gateway exits or is killed. If it cannot set up cleanup, the scan fails closed with a scan error. Direct CLI scans run in the CLI process, not under the gateway.

Limits:

  • On Linux, if a scanner SIGKILLs its child-subreaper custodian, a detached child can keep running even though the scan fails closed. After such a failure, find and stop leftover scanner processes.
  • macOS has one known limit: a child that forks, starts a new session and exits between two reads of the process table (about 100 ms apart) can hand its own child to launchd before the gateway sees it. If that child keeps a descriptor it inherited, the scan fails closed; if it closes every descriptor, it is not found and keeps running.
  • Processes a scanner asks launchd or a system service to start (for example with open or launchctl on macOS) are not its descendants.

Versions and platforms

DefenseClaw pins both scanners. defenseclaw doctor compares the installed package with the pin, warns on a mismatch and gives the repair command.

PackagePinnedNeeds
cisco-ai-skill-scanner2.3.2Python 3.11 to 3.14
cisco-ai-mcp-scanner4.8.7Python 3.11.4 or newer

DefenseClaw needs Python 3.11 to 3.13 (the package refuses Python 3.10). A runtime on Python 3.11.0 to 3.11.3 has no MCP scanning. The installers ship Python 3.12 or 3.13, which include both scanners.

cisco-ai-skill-scanner 2.3.2 ships platform wheels only, each with a native helper. There are wheels for macOS 13 or newer (Apple silicon and Intel), Linux with glibc (x86_64 and aarch64) and Windows x64. There is none for Windows on ARM or musl-based Linux, and DefenseClaw does not ship for either.

Do not upgrade a scanner or LiteLLM by hand.

If a scanner is missing or damaged

Both scanners are runtime dependencies that every supported install includes. A missing one means the install is damaged.

  1. Do not patch the managed virtual environment with pip.
  2. Run the supported install or repair path. Every install and upgrade compares the installed packages with their wheels and downloads a damaged one again.
  3. Run defenseclaw doctor. The Scanner: mcp-scanner row shows the installed version, and fails with the import error when the scanner does not import.

Source contributors synchronize the checkout's locked environment with uv sync. When a scanner SDK is missing, a scan prints a short dependency error and exits; it does not crash the gateway.

See also