Admission and the block/allow list
Learn how DefenseClaw decides whether a skill, MCP server or plugin may be installed and run, with the admission block and the asset_policy lists.
Admission decides whether a skill, MCP server or plugin may be installed and run. It acts when an asset is installed or appears, and the agent hooks also refuse a blocked asset when the agent uses it. The content of each tool call is judged by the guardrail, not here.
config.yaml holds both parts: admission: maps a scan severity to an action, and asset_policy: holds the block and allow lists. An admission preset (defenseclaw policy activate) sets the admission: actions for you (Presets and packs). To change the lists day to day, go to Change the lists.
How a verdict is reached
| Verdict | When | What happens |
|---|---|---|
blocked | A denied rule in asset_policy matches. | The install is refused before any scan. The watcher quarantines a skill or plugin that appeared anyway. Tool calls to a blocked MCP server are refused. |
allowed | An allowed rule matches; a first-party entry matches while allow_list_bypass_scan is true; there is no scan result and scan_on_install is false; or the finding's action is allow. | Nothing is enforced. |
scan | Nothing decided yet and scan_on_install is true. | The asset is scanned, then checked again with the result. |
clean | The scan found nothing. | Nothing is enforced. |
warning | The scan found something and the action is warn. | An install warning is recorded. The asset stays. |
rejected | The action blocks, or the scanner failed. | The action's install, file and runtime parts apply. A scanner that errors or exits non-zero rejects the asset with install block, quarantine and runtime disable: admission fails closed. |
Precedence, first match wins:
asset_policydenied:blocked. It beats every allow, including the first-party list.asset_policyallowed:allowed, no scan.admissionfirst_party_allow_list, whileallow_list_bypass_scanis true:allowed, no scan.- No scan result:
allowedwithscan_on_install: false,scanwithscan_on_install: true. - The scan result: the action for the worst severity, or the scanner-specific action when
scanner_overrideshas one.
Where it runs: the gateway's install watcher checks an asset when it appears in a watched folder, and the defenseclaw install and scan commands run the same check. gateway.watcher.skill.take_action (and the plugin and mcp keys, true by default) controls only the post-scan severity actions. With it false, those verdicts are recorded without their block, quarantine or disable, but an explicit asset_policy denied match and a scanner failure still fail closed: the watcher blocks the install and quarantines skill or plugin files.
Do not use take_action: false as an observe-only mode. When you turn it back on, the watcher restarts and its first rescan applies the actions to each asset rejected while it was off; the watcher-block row ends with rejected while take_action was off, enforced once it was turned on. This needs the periodic rescan (watch.rescan_enabled, on by default). Until then a managed computer's status and verify warn with asset_rejected_not_enforced.
MCP servers
A verdict is for a server's definition, not only its name. When the command, arguments, folder or environment change under the same name, admission starts for the new definition at the first tool call, or within 30 seconds. A rejected definition stays blocked; one changed back to a definition that scans clean has DefenseClaw's own block lifted. A block an administrator set stays.
Admission decides on tool calls, not process starts. Claude Code starts a project's servers as soon as the user approves its .mcp.json, as the user and before the scan. While the scan is pending:
| Hook tier | Pending or unavailable scan | Failed or rejected scan |
|---|---|---|
Per-user default or permissive | The call runs with a warning naming the server. The audit records allow and would_block=true. | A finding blocks the server. A server that could not be scanned runs with a warning that names the cause and the next step. |
Per-user strict, or managed standalone | The call is blocked with a retry time. | The call is blocked. |
The admission block
admission: has one block per asset type (skill, mcp, plugin) and a defaults block. A field you leave out of a type falls back to defaults, then to the built-in value. There is no admission.tool: nothing installs a tool, so tools have name lists only.
admission:
defaults:
scan_on_install: true
allow_list_bypass_scan: true
skill:
actions:
critical: quarantine
high: quarantine
medium: warn
low: allow
info: allow
scanner_overrides:
skill-scanner:
medium: block
first_party_allow_list:
- name: acme-review
source_path_contains: [".acme/skills/acme-review"]
reason: first-party Acme skill
mcp:
actions:
high: block
medium:
install: none
file: none
runtime: disable
plugin:
allow_list_bypass_scan: falseProp
Type
An admin config may hold at most 4 MiB of source text and 65,536 parsed YAML nodes (repeated asset_policy entries included), nested at most 32 deep. Split or simplify large lists before you apply them.
Actions
| Shorthand | install | file | runtime | Verdict |
|---|---|---|---|---|
block | block | none | disable | rejected |
quarantine | block | quarantine | disable | rejected |
warn | none | none | enable | warning |
allow | none | none | enable | allowed |
Use a triple only when no shorthand fits: install is block, allow or none; file is none or quarantine; runtime is disable or enable. Any block, quarantine or disable part makes the verdict rejected. A severity that no layer covers fails closed, as a block. An MCP server has no files to move, so for MCP block and quarantine both mean: refuse its tool calls.
A rejected verdict is always a refusal. skill install and plugin install scan the new copy in a private staging folder first, so a refused copy never replaces what is installed, even with --force. When you change the actions, the watcher's next rescan decides installed assets again, so tightening a severity refuses an unchanged asset that was admitted with a warning.
What applies if you set nothing
Each severity resolves on its own, first match wins: admission.<type>.actions, then (skills only) the scanner gate, then admission.defaults.actions, then the built-in action.
| Severity | Skill (default gate) | MCP server | Plugin |
|---|---|---|---|
critical | quarantine | quarantine | quarantine |
high | quarantine | warn | quarantine |
medium | warn | warn | warn |
low | allow | warn | warn |
info | allow | warn | warn |
MCP findings below CRITICAL are recorded and warn without disabling the server. To refuse HIGH findings, set admission.mcp.actions.high: quarantine. The built-in first-party entries are codeguard for skills and defenseclaw for plugins (First-party assets).
The scanner gate
A skill's actions derive from the skill scanner's gate unless admission.skill.actions sets them. A finding at or above scanners.skill_scanner.fail_on_severity (default HIGH) quarantines, one from scanners.skill_scanner.review_queue_min (default MEDIUM) up to the gate warns, and anything lower is allowed.
defenseclaw config set scanners.skill_scanner.fail_on_severity CRITICAL
defenseclaw config set scanners.skill_scanner.review_queue_min LOW
defenseclaw config get admission.skill.actions --effective(source: derived:scanners.skill_scanner)
critical: quarantine
high: warn
info: allow
low: warn
medium: warnA severity you set under admission.skill.actions wins for that severity only; the rest keep deriving from the gate. The (source: ...) line goes to stderr and names the highest layer that set any severity: builtin, derived:scanners.skill_scanner, config:admission.<type>.actions or config:admission.defaults.actions.
The gate shadows admission.defaults for skills
Only skills have a scanner gate, and it sits between admission.skill and admission.defaults. So admission.defaults.actions never changes a skill's actions: set admission.skill.actions for that. MCP servers and plugins follow admission.defaults.actions.
Scanner overrides
scanner_overrides changes the action for one scanner's findings. The key is the scanner that produced the result, not an asset type. This blocks a skill whose worst skill-scanner finding is MEDIUM and leaves other scanners alone:
defenseclaw config set admission.skill.scanner_overrides.skill-scanner.medium blockFirst-party assets
A first-party entry matches when the asset's name equals name and its path contains a source_path_contains value as whole path components, ignoring case and slash direction:
| Asset path | Marker .acme/skills/acme-review | Verdict |
|---|---|---|
/home/alice/.acme/skills/acme-review | matches | allowed, scan skipped |
/home/alice/.acme/skills/acme-review-evil | no: a different last component | scan |
/home/alice/.acme-evil/skills/acme-review | no: a different first component | scan |
/Users/alice/.ACME/Skills/acme-review/SKILL.md | matches (case does not matter) | allowed, scan skipped |
defenseclaw config set admission.skill.first_party_allow_list --json '[{"name":"acme-review","source_path_contains":[".acme/skills/acme-review"],"reason":"first-party Acme skill"}]'The names and paths above are examples. Replace the skill name and path with your reviewed asset before copying the command.
- The list you set replaces the built-in one for that type, so list
codeguardagain to keep it trusted.--json '[]'trusts nothing;allow_list_bypass_scan: falsekeeps the entries but scans every asset. codeguardanddefenseclawnever match by name and location alone.codeguardskips the scan only for an exact copy of the shipped skill (a SHA-256 digest of its files).defenseclawskips nothing by itself: the gateway recognizes its own plugin by its bytes before admission.reasonis a note for people and is not evaluated.
Check what applies
On a per-user install:
defenseclaw config get admission.skill --effective
defenseclaw-gateway policy evaluate --target-type skill --target-name risky-skill
defenseclaw-gateway policy evaluate --target-type skill --target-name new-skill --severity HIGH --findings 3{
"verdict": "rejected",
"reason": "max severity HIGH triggers block per policy",
"file_action": "quarantine",
"install_action": "block",
"runtime_action": "block"
}policy evaluate dry-runs one asset; --severity and --findings simulate a scan. runtime_action uses block or allow for the config's disable or enable. The dry run has no connector and uses the path /dry-run, so connector-scoped rules and path-pinned allows do not match. defenseclaw-gateway policy show prints the whole compiled policy. To check a managed device, see Managed devices.
The block/allow list
asset_policy is the only block list and the only allow list. Each of skill, mcp, plugin and tool has denied and allowed rules:
asset_policy:
skill:
denied:
- name: risky-skill
reason: unvetted vendor skill
allowed:
- name: vetted-skill
reason: reviewed by security
source_path_contains: ["/opt/acme/skills/vetted-skill"]
mcp:
denied:
- name: evil-mcp
connector: claudecode
reason: exfiltrates data
- url: https://mcp.example.net/v1
reason: unknown vendor
tool:
denied:
- name: delete_file
connector: claudecode
reason: destructive
allowed:
- name: read_file
reason: vettedProp
Type
A rule needs at least one field to match anything. There are no wildcards or regular expressions, because this list gates code and tool execution.
Which rule wins
- A rule scoped to the asset's connector is checked before an unscoped one, so a connector-scoped allow overrides a global deny for that connector.
- At the same scope,
deniedis checked beforeallowed. - The first matching rule decides.
Path pins
source_path_contains ties a rule to one copy on disk.
| Rule | How the pin matches | No path presented |
|---|---|---|
allowed | As whole path components: /opt/acme/skills/vetted-skill never covers /opt/acme/skills/vetted-skill-v2. | Never matches. |
denied | As a case-insensitive substring of the path. | Matches nothing. |
The CLI writes a pin when you allow an installed skill or plugin, and never on a block, so a block follows the name wherever the asset is installed.
Claude Code's Skill call names the skill and carries no path. DefenseClaw finds the folders in the connector's skill folders that provide that name and judges each copy at its own path: if several copies exist, a matching deny on any copy blocks the call, and a pin to a copy the caller does not have matches nothing. This per-copy check is for Linux and macOS. On managed Windows the gateway runs as LocalSystem and cannot see a skill under a user profile, so write the deny by skill name there.
enabled and mode
The explicit lists always apply, whatever asset_policy.enabled (default false) and asset_policy.mode (default observe) say. Those two keys govern only the other rules: a default: deny for a type, registry_required and runtime detection. With mode: observe such a rule records that it would block; with mode: action it blocks (Registries).
asset_policy.<type>.runtime_detection applies those rules at the agent hook. With runtime_detection.enabled: false (the default for skills and plugins) a hook still refuses a skill, plugin command or MCP server on the denied list; only the default, registry and approval rules are skipped. MCP runtime detection defaults to true, so MCP default and registry rules apply at the hook once asset policy is enabled. Set asset_policy.mcp.runtime_detection.enabled: false to limit the MCP hook to the denied list too.
An MCP install scan can also record a runtime disable. That scan verdict still refuses MCP calls when asset_policy.mcp.runtime_detection.enabled is false: turning runtime detection off does not clear a rejected install verdict.
| Where the asset is | Who applies default, registry and approval rules |
|---|---|
| Per-user installs; managed Windows roots outside profiles | The install watcher. |
| Managed Windows profiles | Only the hooks: set asset_policy.enabled: true, runtime_detection.enabled: true and asset_policy.mode: action. |
| Managed Linux and macOS connector folders | Only the hooks, with the same settings. ensure, status and verify emit asset_policy_not_enforced when runtime detection is off and no watcher folder admits that type. |
Windows status and verify do not emit asset_policy_not_enforced; the gateway log is the only warning there.
Where a denied skill is refused
| Agent action | Refused by |
|---|---|
Claude Code Skill call or slash command, including a plugin's bundled copy (<plugin>:<name>) | The hook. |
Codex $name selection, also by the name its SKILL.md declares | The hook. |
A tool call that reaches into a denied skill's folder (a .../skills/<name>/... path in a command, file path or working folder) | The Claude Code and Codex hooks. Codex asked in plain words reads SKILL.md with a shell command, so this is what stops it. |
A Claude Code plugin's skills, commands (/<plugin>:<skill>), agents and MCP tools (mcp__plugin_<plugin>_<server>__<tool>) | The hook, when asset_policy.plugin denies the plugin. A rule written as plugin@marketplace refuses that plugin from any marketplace. |
Two things stay out of reach of a hook: the skill's name and description, which Codex lists to the model before any hook runs, and a command that builds the path at run time (a variable, a glob, a cd then a relative path). Take a denied skill off the device to remove it from that index.
The folder rule covers the denied list only. A skill kept out only by default: deny or registry_required is refused at the Skill call and the $name selection, but not when Codex reads its SKILL.md in plain words. To keep it from running in Codex, add it to asset_policy.skill.denied.
For watched roots (per-user installs and managed Windows roots outside profiles), a config change that adds a denied entry makes the watcher check installed skills, plugins and MCP servers at once. A match is refused (a skill or plugin is quarantined) with an install-rejected audit row. An MCP server is matched on its definition too, so a command or url rule added later rejects one already installed. Managed Windows profile assets and managed Linux/macOS connector assets are refused only by the hooks; remove them with your device management tool.
Tool lists
asset_policy.tool rules have a name, an optional connector and a reason. Tool names match case-sensitively. For a call from connector C the order is: denied for C, allowed for C, denied for any connector, allowed for any connector, then the normal guardrail checks. An allow skips the rule, pattern and judge checks, but a tool that writes files still goes through CodeGuard.
| Connector | Names the hook reports on managed Windows |
|---|---|
| Claude Code | Bash (shell), Read (file reads), Skill (skills) |
| Codex | Bash; apply_patch only on a build that edits files with its own patch tool |
Codex has no Read or Skill tool name. Write these exact names, including capitals: name: bash for Codex never matches, and nothing warns you. Check the tool_name of a real call in the audit log, and after you add a rule, run one call it should stop.
Change the lists
| Writer | Use it for |
|---|---|
defenseclaw skill, mcp, plugin, tool with block, allow, unblock | The everyday way. |
defenseclaw config set asset_policy... | URL or command rules, path pins, bulk edits. |
REST POST and DELETE /enforce/block, POST /enforce/allow | Scripts (Gateway API). |
Editing config.yaml by hand | Works: the gateway applies a valid change within seconds and rejects an invalid one. |
Every writer goes through the one config writer. The change applies on the next decision, with no restart. With the gateway stopped, the commands still write config.yaml and warn that no audit event was recorded. On a managed device they are refused (Managed devices).
Block by name
defenseclaw skill block risky-skill --reason "unvetted vendor skill"
defenseclaw mcp block evil-mcp --connector claudecode --reason "exfiltrates data"
defenseclaw tool block delete_file --connector claudecode --reason "destructive"[skill] Blocked 'risky-skill' (every connector).
[mcp] Blocked 'evil-mcp' (claudecode).
Note: 'evil-mcp' is not configured on claudecode. Configured MCP servers: none.
The block applies if a server with this name or URL is added later.
[tool] 'delete_file' added to block list (connector 'claudecode')Without --connector, a rule covers every connector. A block does not touch an asset that is already running: use disable or quarantine.
Allow a reviewed asset
defenseclaw skill allow ok-skill --reason reviewed
defenseclaw tool allow read_file --reason "vetted"skill allowandplugin allowon an installed copy scope the rule to its connector and pin it to its path; on a quarantined copy they pin it to the restore path. They also remove the name from the block list. With no copy, the command says the rule matches the name only.mcp allowpins the rule to the server'surl, or itscommandandargs_prefix, from the connector's MCP config. For a server that is not configured, pass the definition you reviewed:defenseclaw mcp allow context7 --command npx --args '["-y", "@upstash/context7-mcp"]'.tool allowwithout--connectornames each connector it covers.
Edit the lists for anything else
defenseclaw config set asset_policy.mcp.denied --json '[{"url":"https://mcp.example.net/v1","reason":"unknown vendor"}]'Check it worked
defenseclaw tool list
defenseclaw config get asset_policy.skill
defenseclaw-gateway policy evaluate --target-type skill --target-name risky-skillThe dry run prints "verdict": "blocked" for a blocked name. tool list prints one table per connector, where UPDATED shows - for an entry until it is changed.
Undo
defenseclaw skill unblock risky-skillunblock removes the block or allow rule and clears its runtime state, so the scan verdict decides again on the next check. It never restores files: use defenseclaw skill restore <name>.
Over REST, a state-changing call needs the gateway token, the X-DefenseClaw-Client header and a JSON body:
curl -s -X POST http://127.0.0.1:18970/enforce/block \
-H "Authorization: Bearer $DEFENSECLAW_GATEWAY_TOKEN" \
-H "X-DefenseClaw-Client: cli" \
-H "Content-Type: application/json" \
-d '{"target_type":"skill","target_name":"curl-skill","reason":"blocked from a script"}'To block plugins by scan severity at install, see Block risky plugins at install.
Managed devices
On a managed standalone device the admin config is the only source. Every writer refuses, the attempt is audited, and the CLI exits with code 3:
This device is managed: the asset_policy block and allow lists are set in the admin config (MDM or management plane)defenseclaw config set refuses the same way, and REST answers 403 with managed_device. Put the same asset_policy rules in the admin config (Enterprise). Reading the lists (GET /enforce/blocked and /enforce/allowed) works everywhere.
To check the managed policy, use the installed gateway as an administrator. A standard account is refused when it reads the managed policy. The managed Windows CLI has no config get.
sudo /opt/defenseclaw/bin/defenseclaw-gateway policy evaluate --target-type skill --target-name risky-skill
sudo /opt/defenseclaw/bin/defenseclaw-gateway policy showThe installed defenseclaw launcher accepts only the managed commands.
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway policy evaluate --target-type skill --target-name risky-skill
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway policy showIn an elevated PowerShell prompt:
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' policy evaluate --target-type skill --target-name risky-skill
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' policy showManaged Windows
Users and groups
Admission and the block/allow lists belong to the device. A rule can be scoped to a connector, but not to a user or a group. Profiles target users and groups with guardrail settings (mode, levels, human approval, rule pack), not admission (User and group profiles).
What stays runtime state
Some results are records of what happened on one machine, not intent. They stay in the actions table of audit.db and are never read as policy:
- quarantine and restore of a skill's or plugin's files (
quarantine,restore) - runtime disable and enable (
disable,enable) - the install block a scan verdict records (its reason starts with
auto-block,post-scan:or similar)
This journal is not part of the effective policy digest. unblock clears its install block for the name. On a managed device, which has no enable or restore, an allowed rule in the admin config clears a skill's or plugin's install block and runtime disable at the next admission or rescan (Release a blocked or quarantined skill). On managed Windows, a row whose user cannot be told keeps refusing that MCP server name for every user.
Related
Registries
Subscribe DefenseClaw to public or internal skill and MCP catalogs. Entries are fetched and scanned, and clean ones are promoted into asset_policy.
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.