Scanning on managed hosts

Scan skills, MCP servers and plugins on a managed Windows, Linux or macOS host, learn where the gateway cannot read user folders, and release assets.

On a managed host the gateway runs as a service that cannot read user folders. Skills, MCP servers and plugins inside them are judged at the hook or scanned from a copy, not by the install watcher. This page covers all three operating systems; the scanners themselves are in Skill scanner and MCP scanner.

WindowsLinuxmacOS
Folders the gateway cannot readEnrolled users' profile rootsHome folders, /root, /tmp, /var/tmp, /run/user/Users, /var/root (a folder in /tmp is scanned)
Assets in user foldersJudged at the hook (below)Connector skill folders are not watched; eligible project folders and explicit watcher folders can beSame as Linux
MCP servers in user foldersScanned and admitted (below)See MCP scannerSee MCP scanner
Administrator scan& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' scan ... from an elevated promptsudo /opt/defenseclaw/bin/defenseclaw-gateway scan ...sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway scan ...

Scan a copy as an administrator

An administrator scans a folder or remote MCP server with the gateway's own scanners, policy and judge. Copy the folder out of the user's home first and scan the copy. Standard accounts cannot run managed scans, and variables such as SKILL_SCANNER_LLM_MODEL in your shell are ignored.

The gateway reads the folder as LocalSystem and refuses one inside a user profile (HTTP 403). The refusal prints the Copy-Item and scan commands for the folder.

Elevated Administrator prompt
$Cli = 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe'
& $Cli scan skill 'C:\DefenseClawReview\my-skill'
& $Cli scan mcp https://mcp.example.com/mcp
& $Cli scan plugin 'C:\DefenseClawReview\my-plugin'

The scan rows of a skill or plugin in an enrolled user's folder name that user (user.id, defenseclaw.user.name), and the judge model when the judge ran.

Only an administrator can read the managed gateway's token, so run the scan with sudo. Copy the folder to one every account can read, such as /opt/defenseclaw-scan.

sudo /opt/defenseclaw/bin/defenseclaw-gateway scan skill /opt/defenseclaw-scan/my-skill
sudo /opt/defenseclaw/bin/defenseclaw-gateway scan plugin /opt/defenseclaw-scan/my-plugin
sudo /opt/defenseclaw/bin/defenseclaw-gateway scan mcp https://mcp.example.com/mcp

Only an administrator can read the managed gateway's token, so run the scan with sudo. Copy the folder to one every account can read, such as /opt/defenseclaw-scan.

sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway scan skill /opt/defenseclaw-scan/my-skill
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway scan plugin /opt/defenseclaw-scan/my-plugin
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway scan mcp https://mcp.example.com/mcp

On Linux and macOS a refused scan exits 3 and says Nothing was scanned. A deployment installed from the payload archive has no scanner runtime: install the package to scan.

Assets in Windows profiles

The LocalSystem gateway skips enrolled users' profile roots, so assets there get no install scan and are never quarantined. Instead the hook judges them from their content. Turn it on in the admin config:

Admin config
asset_policy:
  enabled: true
  mode: action
  skill:
    runtime_detection:
      enabled: true
  plugin:
    runtime_detection:
      enabled: true

MCP runtime detection already defaults to on. Nothing changes while asset_policy.enabled is false or the mode is observe.

What the hook reads

  • The skill folder the request selects, for Claude Code, Codex and Copilot CLI, under each agent's skill roots (for Copilot CLI including .agents\skills, COPILOT_HOME and COPILOT_SKILLS_DIRS).
  • The Claude Code plugin it belongs to, including a plugin from a local marketplace folder and the tools of its bundled server.
  • It reads as the user and follows links as the agent does.

A relative COPILOT_SKILLS_DIRS entry is read below the folder Copilot was started in. The hook reads that folder from the Copilot process and uses it as the only root. When it cannot, it takes the event folder or the outermost repository (or home) above it.

What is refused

CaseReason code
Text with an instruction that overrides the agent's role or instructions, a fake system or delimiter block, base64-hidden instructions or tag characters, rated HIGH or CRITICAL by the in-process prompt-injection detectorprofile-asset-verdict
A skill or plugin the hook found but could not read in full: a file past 64 KiB, more than 64 files, a link that leads nowhere readable, text that is not UTF-8profile-asset-unscanned
A plugin the registry gives no folder for (missing, unreadable, or past the 4 MiB the hook reads)profile-asset-unscanned
A tool of a plugin's bundled server that no plugin content names as its ownerprofile-asset-unscanned
A skill under a project skill folder reached through a link outside the caller's profile, or writable by another userUnverified root (any mode)
A skill whose SKILL.md is a link to a file outside the caller's profile or below a folder another user can write, or a hard linkUnverified root (any mode)

A verdict is refused whatever the guardrail mode is, so a skill created while the gateway was stopped is judged the first time it is used. Verdicts are cached by content digest. Ordinary skills and plugins are not refused, and hooks refuse denied names regardless.

When one tool name could belong to several installed plugins, the hook judges the text of each candidate, up to 64 KiB per file and 96 KiB of escaped text. Only a single candidate past those caps is marked truncated and refused.

Limits:

  • The text is the hook's claim and the detector is the in-process one. The skill scanner and CodeGuard do not run on profile assets.
  • Windows status and verify do not warn when a default or registry rule goes unenforced; the gateway log is the only signal.
  • An unverified project skill root is logged, counted in /health as project_skill_roots_unverified and shown as a project_skill_root_unverified warning. A skill under it is refused until a fresh caller inspection verifies the root.
  • Keep shared skills outside profiles.

Install admission on Windows

Install admission applies to skill, plugin and MCP server roots outside profiles that the gateway watches. When every skill and plugin folder is in a profile, the watcher starts with none: its audit row reads watcher ready: dirs=0 and & 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw-gateway.exe' status --json reports it degraded with profile_roots_skipped: true. That is expected.

To admit a shared folder, set gateway.watcher.enabled: true and gateway.watcher.skill.enabled: true (or gateway.watcher.plugin.enabled: true), add take_action: true to enforce the verdict, and list a folder outside profiles in gateway.watcher.skill.dirs (or gateway.watcher.plugin.dirs).

Setting or caseBehavior
admission.<type>.actions: blockBlocks the asset and leaves its folder in place (file_action=none)
admission.<type>.actions: quarantineCopies the asset to C:\ProgramData\Cisco\DefenseClaw\runtime\quarantine (<type-dir>\<connector>\<name>, or a per-source slot when the name is taken), verifies the copy, then removes the source
Failed skill or plugin scanBlocks and disables the asset
MCP scan that did not finishscanners.mcp_scanner.unverified_server: warn (balanced) keeps the server with a warning and an audit record; block refuses and disables it. A scanner refusal of an unsafe definition still blocks
Quarantine that cannot finishThe asset stays blocked in place. The gateway retries after 2 minutes, then 4, up to every 30 minutes; status and verify warn asset_not_scanned or asset_not_quarantined
take_action: falseA rejected asset is only recorded and stays usable. Once take_action is on again, asset_rejected_not_enforced warns
admission.mcp.scan_on_install: falseNew MCP servers are admitted without a scan (reason=scan-disabled)
Loopback, private, link-local or multicast MCP URLNever scanned, so an HTTP or SSE server there is blocked (install-scan-error). Stdio servers are unaffected. Pin a trusted one by name and URL (below)
Stdio launcherScanned only when its npx or uvx is installed for all users in a folder only administrators can change (for example C:\Program Files\nodejs). A launcher in a profile fails (MCPStdioLaunchError ... untrusted Windows path)
Claude Code plugin from a local marketplaceRuns from its folder and is not watched. A matching asset_policy.plugin.denied rule still makes the hook refuse it with ASSET-POLICY reason_code=admin-deny source=admin-deny asset_type=plugin asset_name=<plugin>. MCP servers a plugin bundles are admitted with it; asset_policy.mcp rules name them plugin:<plugin>:<server>
Admin config: admit a reviewed loopback MCP server
asset_policy:
  mcp:
    allowed:
      - name: notes
        url: http://127.0.0.1:28561/mcp
        reason: reviewed internal server

Watcher rows for roots outside profiles carry no per-user attribution.

MCP servers in user profiles

On Windows, an enrolled user's Claude Code, Kiro and Codex MCP servers get an install scan and an admission decision like any other server: Claude Code user and local scope and a project's .mcp.json, Kiro user scope, Codex user scope. The scanner runs in the gateway service, so the user cannot change its verdict.

How the servers are found

The hook enumerator reads .claude.json, each project's .mcp.json, .kiro\settings\mcp.json and the Codex user config.toml. It publishes their servers to the gateway every 30 seconds and before each MCP tool call.

ProblemResult
A state file cannot be read or parsedThe user's MCP tool calls are refused; status warns claude_state_unreadable, kiro_mcp_unreadable or codex_mcp_unreadable
A project's .mcp.json the user cannot openThat project is skipped; other projects are unaffected
No session token for the userThe state is reported unreadable and no inventory is published for that user

Codex reads one user config.toml: the one under CODEX_HOME when it is set for the account, otherwise .codex\config.toml. The enumerator publishes only that file. A CODEX_HOME set only for one session is not seen, and the gateway refuses a call to a server from that file (mcp-source-unpublished).

How a user's server runs for its scan

Only the server's own process runs as the user:

  • The hook enumerator starts it with the user's session token through the Secondary Logon service (seclogon). If seclogon is disabled, set it back to Manual.
  • It starts only the definition it published, and only while the gateway scans it.
  • Only npx or uvx with a package argument and no code-running flag, installed for all users under Program Files. One in the profile, or an earlier same-named file on PATH, is refused.
  • The working directory must be on a local fixed drive, inside the project or the user's own profile, with no link or junction on the way.
  • It runs hidden, in session 0, in a job that ends every process after at most five minutes. A server that needs the interactive desktop or clipboard fails its scan and stays blocked.

A user who is not signed in has no session token. Their servers stay blocked until they sign in, and are scanned again within about 30 seconds.

A definition refused for its own launcher stays blocked until the definition, the scanner or the admission settings change, or an allow rule admits it. Any other failed scan is retried after 2 minutes, doubling to 30. An administrator unblock stays until the definition changes.

Codex project servers

A Codex project .codex\config.toml takes precedence over the user file only for a project the user config trusts (trust_level = "trusted"; the entry nearest the project decides). Its servers are not published and get no install scan. The gateway refuses a call to one when:

  • it would override a published server of the same name,
  • asset policy is in action mode with MCP runtime detection on, or
  • its definition is too long for the hook to send and an asset_policy.mcp.denied rule that pins an endpoint may match it.

Otherwise it runs as before. The hook sends a digest of the whole definition (URL, command, every argument and the environment), so a definition that differs from the scanned one is never taken for it. MCP servers of other connectors in a profile are not published and get no install scan.

Release a blocked or quarantined skill

Standard users cannot release an asset, and skill enable and skill restore are not available. After review, add an allow rule to asset_policy in the admin config, pinned to its watched folder outside profiles, or without source_path_contains for every matching copy. This example assumes C:\ApprovedSkills\<account> is listed in gateway.watcher.skill.dirs:

Admin config
asset_policy:
  skill:
    allowed:
      - name: reviewed-skill
        reason: reviewed by security
        source_path_contains: ["C:\\ApprovedSkills\\<account>\\reviewed-skill"]

Replace <account> with the folder you list for that user and reviewed-skill with the skill's folder name.

  • A blocked skill still in its folder is released at the next rescan (watch.rescan_interval_min, 60 by default), or at once when it is copied into the watched folder again (install-allowed reason=allow-listed).
  • A quarantined skill keeps its copy under runtime\quarantine\skills. After you add the rule, copy the folder back into the watched folder from an elevated prompt. To purge copies, delete their folders under runtime\quarantine.
  • For a Claude Code plugin from a marketplace use asset_policy.plugin. An allow rule needs plugin@marketplace (the name claude plugin list shows); a deny rule also matches the bare name.
  • To lift a hook refusal of a profile skill denied by name, change its asset_policy.skill.denied rule.