Machine policy
How the standalone profile protects each AI agent on Windows, Linux and macOS, which machine-wide policy files it writes, which settings each OS honors, and how to inspect, export and verify the result.
Some agents read a machine-wide policy file that standard users cannot change. For those agents, the standalone profile uses that file instead of each user's own config. On managed Windows, configured Claude Code, Codex and Cursor machine hooks stay installed before the first enrollment and after the last enrolled user is removed. Even with zero enrolled users, their hooks refuse an unenrolled account. The other agents are protected per user: the guardian writes DefenseClaw's hook into each enrolled user's agent config and repairs it. Terms are in Concepts.
Only agents you select in the config are protected; see Choose the agents to protect. DefenseClaw's entries are derived from the config (guardrail.connectors and enterprise.machine_policy) and never read back as policy. The next ensure, repair or reconcile rewrites a changed entry, and verify reports the drift until then. Change the config, not the vendor file.
You may maintain your own settings in vendor policy files. After an administrator
or MDM changes one, run reconcile or ensure as root. While a managed hook's
current vendor policy differs from the digest in the trusted runtime descriptor,
the hook keeps sending every call to the gateway, which inspects it under the
managed policy, and raises a HIGH runtime alert
(enterprise_managed_policy_view_unverified, source managed_hook).
status and verify report machine_policy_incomplete until a verified view
is pinned. reconcile re-pins a view that the root-side verifier accepts, names
the connector in changes, and never pins a view that dropped DefenseClaw's
hooks. Vendor policy paths do not automatically trigger it.
On macOS, Codex and Claude Code hooks check the shared policy and only the
invoking account's managed preference. The root lifecycle pins each
per-account preference by its SHA-256 in the protected runtime descriptor; a
byte-identical rewrite keeps the pin. A hook raises the alert when its own
preference is unreadable, missing, changed or new. Another account's preference
does not affect it. An account entry that cannot be pinned (a folder in place
of the plist, an oversize file, a symlinked or invalidly named account folder,
or more accounts than the descriptor holds) is reported by status and
verify for that account only; install, ensure and the other accounts are
not affected.
Routes by connector
What each route does during a gateway outage is in the gateway outage table.
| Connector | Route |
|---|---|
| Codex, Claude Code | Machine policy, with the vendor lock |
| Cursor, GitHub Copilot CLI | Machine policy, with the foreign-hook guard |
| OpenCode | Machine policy through the managed OpenCode plugin, with the foreign-hook guard |
| Amp, Devin, Hermes, Antigravity, Kiro | Per user. Amp and Devin get the foreign-hook guard on every OS; Hermes gets it on Linux and macOS. Windows Amp keeps its guard session record locally, and its plugin blocks gateway outages. |
| OpenClaw, ZeptoClaw | Not managed: they need the guardrail proxy, which a managed host does not run (route unsupported) |
- Vendor lock. A setting in the agent's machine policy that stops user and project hooks from running. Only Codex and Claude Code have one.
- Foreign-hook guard. For agents without a lock, DefenseClaw removes or blocks hooks it has not approved.
- OpenCode stays on the per-user plugin route while the managed plugin is missing or untrusted, its
ownershipisoff, or OpenCode's managed config does not name the plugin. - Copilot and OpenCode on Windows. The hook registration comes from the machine policy. The guardian writes only each enrolled user's protected DefenseClaw runtime, never the user's Copilot or OpenCode config.
Routes by connector by OS
| Connector | Linux and macOS | Windows |
|---|---|---|
Codex (codex) | Machine policy, with the vendor lock | Machine policy, with the vendor lock always on |
Claude Code (claudecode) | Machine policy, with the vendor lock | Machine policy, with the vendor lock; see Windows differences |
Cursor (cursor) | Machine policy, with the foreign-hook guard | Same |
GitHub Copilot CLI (copilot) | Machine policy, with the foreign-hook guard | Same |
OpenCode (opencode) | Machine policy through the managed OpenCode plugin, with the foreign-hook guard | Same |
Amp (amp) | Per user, with the gateway-backed foreign-hook guard | Per user (in-agent plugin), with a local foreign-hook session record; the plugin itself blocks gateway outages |
Devin (devin) | Per user, with the foreign-hook guard; builds before 3.9.19 that still run Cascade are not covered | Per user (hook binary), with the guard; Cascade as on Linux and macOS |
Hermes (hermes) | Per user, with the foreign-hook guard | Per user (hook binary) |
Antigravity (antigravity) | Per user | Per user (hook binary) |
Kiro (kiro) | Per user: the user's global ~/.kiro/hooks/defenseclaw.json plus the CLI 2.x defenseclaw agent | Per user: %USERPROFILE%\.kiro\hooks\defenseclaw.json plus the CLI 2.x defenseclaw agent, through the hook binary |
OpenClaw (openclaw), ZeptoClaw (zeptoclaw) | Not managed: they need the guardrail proxy, which a managed host does not run, so the enumerator skips them (route unsupported) | Not managed |
Hook commands by route
The machine-policy registrations run the administrator-owned hook binary. On Linux and macOS the command is '<bin>/defenseclaw-hook' hook --connector <name> --enterprise-managed, where <bin> is /opt/defenseclaw/bin (Linux) or /opt/cisco/defenseclaw/bin (macOS). On Windows the binary is C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw-hook.exe, and Cursor runs it through a protected PowerShell adapter next to its hooks.json.
Per-user registrations differ by OS. On Windows every one runs the same hook binary, or an in-agent plugin that calls the gateway (Amp). On Linux and macOS, Devin's entry in ~/.config/devin/config.json runs the same administrator-owned command and the foreign-hook guard. Its hooks default to closed. With foreign_hooks: remove (the default), a guarded call under the administrator's hook_fail_mode: open during a classified gateway outage requires fresh, trusted records of both the agent process and its session; a missing, blocked or stale record blocks (Foreign-hook guard). Foreign-hook and integrity refusals always block (Fail modes). Antigravity, Hermes and Kiro run a hook script the guardian writes into the user's ~/.defenseclaw/hooks (for example hermes-hook.sh), which sends the event to the gateway over the hook socket; the guardian verifies and repairs it. Amp and the per-user OpenCode plugin call the gateway from inside the agent and run defenseclaw-hook for the foreign-hook check.
Machine policy files
| Connector | File |
|---|---|
| Codex | /etc/codex/requirements.toml |
| Claude Code | /etc/claude-code/managed-settings.d/90-defenseclaw.json |
| Cursor | /etc/cursor/hooks.json |
| Copilot | /etc/github-copilot/policy.d/90-defenseclaw.json |
| OpenCode | /etc/opencode/opencode.json |
Devin Desktop Cascade (devincascade, withdraws an earlier release's refusal only) | /etc/devin/hooks.json |
| Connector | File |
|---|---|
| Codex | /etc/codex/requirements.toml |
| Claude Code | /Library/Application Support/ClaudeCode/managed-settings.d/90-defenseclaw.json |
| Cursor | /Library/Application Support/Cursor/hooks.json |
| Copilot | /etc/github-copilot/policy.d/90-defenseclaw.json |
| OpenCode | /Library/Application Support/opencode/opencode.json |
Devin Desktop Cascade (devincascade, withdraws an earlier release's refusal only) | /Library/Application Support/Devin/hooks.json |
| Connector | File |
|---|---|
| Codex | %ProgramData%\OpenAI\Codex\requirements.toml |
| Claude Code | C:\Program Files\ClaudeCode\managed-settings.d\90-defenseclaw.json |
| Cursor | %ProgramData%\Cursor\hooks.json |
| Copilot | %ProgramData%\GitHub\Copilot\policy.d\90-defenseclaw.json |
| OpenCode | %ProgramData%\opencode\opencode.json |
Devin Desktop Cascade (devincascade, withdraws an earlier release's refusal only) | %ProgramData%\Devin\hooks.json |
On Linux and macOS, only root may write the folders that hold these files. verify and status report a folder above them that another account can write (group or other write in the mode, or a POSIX or macOS ACL entry that grants write), and the connector does not count as covered. ensure, repair and the guardian remove those ACL entries and the write bits; read-only entries stay.
For OpenCode, DefenseClaw uses an existing opencode.jsonc instead of opencode.json, as long as it holds no comments. DefenseClaw publishes no Cascade refusal: the pre-rename Cascade hooks file is imported by the Devin CLI as Devin Local hooks, and no evidence shows that a Devin build running Cascade reads the Devin hooks file. ensure removes the refusal releases 1.0.5 to 1.0.8 wrote into either file, and builds before 3.9.19 are reported as not covered; see Cascade on older builds. devincascade is not a connector of its own: it enrolls no user.
Who writes machine policy
| OS | Codex | Claude Code, Cursor | Copilot, OpenCode, Devin Desktop Cascade |
|---|---|---|---|
| Linux and macOS | The lifecycle (ensure, install, upgrade, repair) | The lifecycle | The lifecycle |
| Windows | The lifecycle at install, upgrade and repair; the guardian repairs it | The guardian, with Windows-specific code | The guardian, with the machine-policy engine that Linux and macOS use |
On every OS the guardian keeps each enrolled user's DefenseClaw runtime in step with the policy, and verify reports any drift. On Linux and macOS the guardian never writes machine policy itself: when DefenseClaw's Claude Code drop-in is edited or deleted it logs a tamper and starts the lifecycle's config-apply job, whose ensure puts the drop-in back within seconds.
On Windows, Codex's requirements.toml stays installed for every enabled Codex deployment, including one with zero enrolled users. The lifecycle writes it at install, upgrade or repair, and the guardian repairs it. If %ProgramData%\OpenAI\Codex, or the OpenAI folder above it, is deleted, the standalone guardian recreates it on its next pass with the protection Setup gives it, and logs that it did. A link on that path is not followed or changed: the guardian names the link once, with the cmd /c rmdir command that removes it, and keeps refusing until it is gone. status reports a Codex install it could not enroll and names missing policy; treat that warning as a protection failure and stop Codex use until repair succeeds.
On Windows, Claude Code's C:\Program Files\ClaudeCode\managed-settings.d\90-defenseclaw.json stays installed for every enabled Claude Code deployment, including one with zero enrolled users. Its protected state records enrolled SIDs; removing the last SID leaves the hook policy enforcing. A missing drop-in is drift: Claude Code then runs without DefenseClaw hooks. enterprise windows status may still show the generic unenrolled-user refusal text; status does not name a missing Claude Code machine policy and cannot establish protection. enterprise policy verify fails on a missing machine hook. Stop Claude Code use, repair the machine policy, and resume only after enterprise policy verify passes.
On Windows, the guardian keeps Cursor's hooks.json and protected PowerShell adapter installed whenever Cursor is configured, including before the first enrollment and after the last enrollment is removed. The empty enrollment is guarded: Cursor refuses every account's tool calls until that account is enrolled. The enumerator recognizes Cursor Desktop or the Cursor Agent CLI at a version with a verified hook contract. enterprise windows status names each Cursor install it could not enroll (hook_contract_unverified for an Agent CLI build DefenseClaw has not reviewed). policy show and policy verify report a missing machine hook as policy drift; the guardian repairs it. Stop Cursor use until repair succeeds.
Managed OpenCode plugin
The standalone payload ships a managed OpenCode plugin at <InstallRoot>/share/opencode/index.js: /opt/defenseclaw/share/opencode/index.js on Linux, /opt/cisco/defenseclaw/share/opencode/index.js on macOS, C:\Program Files\Cisco\DefenseClaw\share\opencode\index.js on Windows. The Linux and macOS lifecycle installs it with the deployment's files; on Windows the guardian writes it. DefenseClaw adds its directory to the plugins list, or the compatible plugin list, of OpenCode's managed config, so it runs in every user's OpenCode and users cannot edit or delete it.
- The plugin is the same file on every host and holds no credential. Each event runs the administrator-owned
defenseclaw-hookbeside it, which reaches the gateway the same way the other machine-policy hooks do and applies the foreign-plugin guard. - With the default fail mode
closedit blocks a tool call when the hook binary cannot run, answers with an error, or the gateway is unreachable. With the administrator'shook_fail_mode: open, a stopped gateway service depends onforeign_hooks. Withremove(the default),openapplies only on Linux and macOS, to an agent process with a current clean-session note, and every other call blocks. Withreportorallowit always applies. A restarting gateway, or one that gives no answer in time, blocks the call in every mode. See the gateway outage table. After uninstall it allows calls again. - OpenCode uses this route only while the file is administrator-owned (root on Linux and macOS; Administrators, LocalSystem or TrustedInstaller on Windows), no other user can change it, and OpenCode's managed config names it. Otherwise DefenseClaw keeps the per-user plugin and
policy showsays why. The payload installs the file even withownership: "off"; that alone does not change the route. verifyandpolicy showreport a plugin whose content differs from the installed release.ensure(Linux and macOS) or the next guardian pass (Windows) restores it.- On Windows, OpenCode opens every module with the write-attributes right, so the plugin grants that right to Users. A standard account can then set a reparse point on the plugin and stop OpenCode loading it. The guardian watches the plugin's folder, restores it within about a second, and logs a tamper in
hook-guardian.log. After 12 restores in a minute it slows to one every 5 seconds. A read-only or hidden attribute does not stop the load, so the guardian leaves those alone. - A per-user DefenseClaw plugin left from the per-user route counts as a foreign plugin once the managed plugin is in place; the guardian removes it with
foreign_hooks: remove(the default). - On Linux and macOS an unenrolled user's OpenCode calls are inspected (
unenrolled_users: inspect). On Windows each enrolled user gets a protected per-user runtime for OpenCode, and calls from a user without an OpenCode enrollment are blocked.
What DefenseClaw writes on Linux and macOS
- Its own entries only. Claude Code and Copilot: DefenseClaw owns the whole
90-defenseclaw.jsondrop-in. An edit inside it is put back by the nextensureorrepair, and uninstall removes the file. Put your own settings in another drop-in. Codex: two marked blocks inrequirements.tomlplus single marked lines inside your own tables (for examplehooks = true # defenseclaw-managedin an existing[features]table); every line of your own is kept as written, with its comments, blank lines and order; the blank lines inside DefenseClaw's two blocks are DefenseClaw's. On Windows the file is parsed and written back whole (Windows differences). Cursor: one entry per event merged intohooks.json, every other key kept. OpenCode: one entry, the managed plugin's path, added to thepluginlist. - Ownership records and preimages are kept in the
machine-policydirectory under the lifecycle directory (/var/lib/defenseclaw-enterpriseon Linux,/opt/cisco/defenseclaw/lifecycleon macOS). Uninstall removes exactly what DefenseClaw added, keeps edits you made later, and does not bring back content you deleted. - Root-owned files that users can read (
0644). Copilot ignores a policy file that is not root-owned or that group or others can write. - Removal of policy it no longer publishes. When you remove a connector's name from both
guardrail.connectorsandenterprise.machine_policy.connectors, or set itsownershipto"off", the nextensureremoves DefenseClaw's entries for it and says so: DefenseClaw no longer inspects that agent on the computer.guardrail.connectors.claudecode.enabled: falsealso removes Claude Code machine policy and hooks. For other connectors, check the machine-policy ownership map.
If a Codex requirements.toml defines features or hooks as dotted keys or inline tables, DefenseClaw cannot merge without rewriting your content and reports a conflict. Rewrite them as [features] and [hooks] tables, or set ownership: verify_only and add the entries yourself. policy export --connector codex fails the same way.
Windows differences
On Windows, Codex, Claude Code and Cursor policy is written with Windows-specific code. The machine-policy engine used on Linux and macOS writes only the Copilot drop-in, OpenCode's managed config and plugin, and the foreign-hook guard summary.
-
Claude Code. The drop-in
C:\Program Files\ClaudeCode\managed-settings.d\90-defenseclaw.jsoncarries DefenseClaw's hooks and, with the defaultmanaged_hooks_only: enforce, setsallowManagedHooksOnly: true, so user and project Claude Code hooks do not run.preserveleaves the lock out and turns the foreign-hook guard on for Claude Code. Amanaged-settings.dfile that sorts after90-defenseclaw.jsonand setsallowManagedHooksOnlytofalseturns the lock off;enterprise policy verifyandenterprise windows verifyreport that file. -
Claude Code registry policy. While
HKLM\SOFTWARE\Policies\ClaudeCode\Settingsholds a non-empty value, DefenseClaw does not publish its Claude Code drop-in and reports an error for each Claude Code target. DefenseClaw does not merge with that value. Keep it empty on hosts where DefenseClaw manages Claude Code. Setup install, ensure, upgrade and repair check this before they change anything: with the value set and Claude Code enabled in the config they stop at once withclaude_registry_policy, name the value and change nothing. Delete the value and run Setup again, or setguardrail.connectors.claudecode.enabled: falseif the registry policy must stay. -
Codex. DefenseClaw parses
requirements.tomland writes it back whole, so comments and key order are not kept. It always setsallow_managed_hooks_only = trueand[features] hooks = true; if your file sets either tofalse, the transaction fails. -
Settings.
ownershipandhigher_precedence_sourcesdo not change how Codex, Claude Code or Cursor policy is written.enterprise policy verifychecks their configured machine hooks even withownership: "off"and zero enrolled users.managed_hooks_onlychanges only the Claude Code lock, and decides whether the foreign-hook guard covers Codex and Claude Code.ownershipapplies to Copilot and OpenCode, andconnectors.claudecode.ownershipalso applies to the version floor drop-in, but not to90-defenseclaw.json. -
Vendor folders under
%ProgramData%. Standard users may create folders there. A vendor folder a standard user created first gets DefenseClaw's owner and protected DACL.On a standalone deployment three cases differ. DefenseClaw tells them apart from its administrator-only ownership records (
<lifecycle folder>\machine-policy\<connector>.json):- A folder DefenseClaw created is its own, and its access list is put back. A folder that also holds a DefenseClaw-named file is refused and named instead, as for every managed folder.
- A vendor folder DefenseClaw did not create that holds no file DefenseClaw recorded is taken over as described here.
- A vendor folder DefenseClaw did not create that holds a file DefenseClaw recorded is not taken over on sight. An example is a
C:\ProgramData\Devinthe vendor made, holding DefenseClaw'shooks.json.
In that last case the recorded file keeps its own administrator-only access list. The folder is left as it is while no standard user can delete or replace that file there and the vendor reads only that file name there. Devin reads only
hooks.json, in both of its folders, so the inherited "Users may add files" entry of%ProgramData%does no harm there.The folder stops protecting the file when a standard user gains delete-child, change-permissions or ownership. If the vendor loads more than one file from the folder, it also stops protecting it when a standard user can add a file: GitHub Copilot loads every
*.jsoninpolicy.d, and OpenCode prefers anopencode.jsoncover DefenseClaw'sopencode.json. The next reconcile (the guardian pass, Setup/ensure,/repair,/upgradeor/reconcile) then puts the folder back to DefenseClaw's owner and protected access list in one safe transaction, and says so once.The transaction opens the folder and every file DefenseClaw recorded in it and keeps them open until it is done. It puts the access list back only if all of this holds:
- No other program has the folder open with delete access, or a recorded file open with write or delete access or without sharing read access.
- Each recorded file is a regular file with one link, only administrators can change it, and it still has the bytes DefenseClaw recorded.
- For a vendor that loads every file in the folder, nothing else is in the folder.
A file a standard user adds between these checks and the new access list is moved aside right after it. A file an administrator adds then stays, and the folder is refused by name. A handle that another program opened before the transaction only to change the access list or the owner is not seen by these checks. The next guardian pass sees what that handle changes and puts the folder back again or refuses it.
Setup lists the change in its result. The gateway writes a HIGH
connector-hook-repairedaudit row with the connector, the folder, the access list before and after, and who did it (Setup or the hook guardian).If a check fails, nothing is changed. Something holds the folder or a file open, a file has a second link, a file was changed, renamed or removed, or the folder holds a file DefenseClaw did not write. Then:
- Setup
/ensure,/repair,/upgradeand/reconcilestop with1603before any service stops. - The guardian pass reports the refusal and does not finish clean.
- Setup and the guardian write a HIGH
managed_vendor_folder_not_protectedalert. Setup /verifyandenterprise policy verifyreport the connector not covered.- One message names the folder, what blocked the transaction and the fix.
The fix also removes inherited entries such as ProgramData's "Users may add files". From an elevated prompt run, in order:
icacls "<folder>" /setowner "*S-1-5-32-544"icacls "<folder>" /inheritance:r /grant:r "*S-1-5-18:(OI)(CI)F" "*S-1-5-32-544:(OI)(CI)F" "*S-1-5-32-545:(OI)(CI)RX"icacls "<folder>" /remove:gfor any other account that the message names and that can change the folder. An account that only reads stays.- Setup
/ensure
A policy file DefenseClaw has no record of is judged the same way. A purge that keeps a file another account can change leaves the next install in this state: the folder holds no recorded file, so it is taken over, but DefenseClaw cannot read the file, merge into it or move it aside. This covers OpenCode's
opencode.jsonandopencode.jsonc, any Copilot*.jsoninpolicy.dother than DefenseClaw's own drop-in, and a link or other entry that is not a regular file. Setup/statuswarns,/verifyfails, and/ensure,/repair,/upgradeand/reconcilestop with1603before anything changes. The message names the file, says that DefenseClaw has no record of writing it and why another account can change it, and gives one fix that works whatever the cause (an inherited or explicit entry, several accounts, no access list at all). From an elevated PowerShell prompt run, in order:icacls '<file>' /setowner '*S-1-5-32-544'icacls '<file>' /reseticacls '<file>' /inheritance:r /grant:r '*S-1-5-18:F' '*S-1-5-32-544:F' '*S-1-5-32-545:RX'
The paths are single-quoted PowerShell literals, so a
$or a backtick in a file name does not expand. For a link or other entry, the fix isRename-Item -LiteralPath '<entry>' -NewName '<name>.moved-aside'. It fails when that name already exists;Move-Itemwould move the entry into a folder or junction planted there. Check the file, then run Setup/ensure. The guardian pass writes the same HIGHmanaged_vendor_folder_not_protectedalert once for the file and does not finish clean while it stands. A file a standard account owns is moved aside by the next reconcile, so it blocks nothing, but Setup reports it as not covered until it has been (underownership: verify_onlynothing moves it, and the message gives the fix above). An empty folder passes, and so does a file only administrators can change./statusand/verifyalso carry every other reasonenterprise policy verifycalls a connector uncovered, for each connector on the machine policy route (Codex, Claude Code, Cursor, Copilot, OpenCode): a conflict such as an administrator's*.jsonthat is not valid JSON, an error, a source of higher precedence, or no DefenseClaw hook entry published. They appear under the codemachine_policy_not_coveredand makecoverage_completefalse. Both commands ask the same function, so Setup never reports coverage thatenterprise policy verifydenies. These reasons do not stop/ensure, which repairs what it can.Removing that connector does not fail on such a folder and does not take it over. The uninstall removes DefenseClaw's entries only from a file that only administrators can change, and keeps their own changes. It leaves any file another account can change as it is, drops DefenseClaw's record, and names the folder and the fix in a warning. For a file it leaves, the warning also says that DefenseClaw's hook entries now name binaries the uninstall removed. Delete the entries whose command names DefenseClaw's hook.
The same holds for a recorded file in a folder that does protect it. An uninstall no longer fails on a file another account can change. It leaves the file byte for byte, drops the record and warns once. The warning names the account and the access-list fix, says what the agent does with a hook whose program is gone (the call fails, and depending on the agent it can be blocked until the entries are removed), and says how to remove the entries.
A file, junction, symbolic link or folder a standard user left at a vendor path or at DefenseClaw's drop-in name is removed (a link, never its target) or moved aside to a hidden
.<name>.defenseclaw-displaced-<time>-<id>name, and the folder is created in its place. A*.jsona standard user left in Copilot'spolicy.dis moved aside the same way. Install, reconcile and uninstall all do this. Objects owned by Administrators, LocalSystem or TrustedInstaller are never removed; DefenseClaw reports them. -
policy showchecks Claude Code with the same rules as on Linux and macOS, including the lock underenforce.
Locks on Linux and macOS
With managed_hooks_only: enforce (the default):
- Codex.
requirements.tomlgetsallow_managed_hooks_only = true. DefenseClaw also pins[features] hooks = true, so a user's own config cannot turn managed hooks off. - Claude Code. The drop-in sets
allowManagedHooksOnly: true, so user and project hooks do not run. A user'sdisableAllHooksdoes not turn managed hooks off. - Your own values win. If your policy sets a lock to
false(for exampleallow_managed_hooks_only = falseinrequirements.toml, orallowManagedHooksOnly: falsein a Claude Codemanaged-settings.dfile that sorts after90-defenseclaw.json), DefenseClaw does not rewrite it. It reports a conflict and the connector counts as not covered. The same applies to a manageddisableAllHooks: trueor apolicyHelperfor Claude Code, and tohooks.statein Codex requirements.
With the lock on, hooks your developers need run only if you deploy them through machine policy. Set managed_hooks_only: preserve for a connector to leave its lock off; the foreign-hook guard then covers it.
Claude Cowork
Claude Cowork runs its agent loop on the device, as the signed-in user, with the Claude Code engine that Claude Desktop bundles. That engine reads Claude Code machine policy, so DefenseClaw's Claude Code drop-in (90-defenseclaw.json, see Machine policy files) is meant to cover Cowork as well. There is nothing to configure for Cowork itself.
What was measured, on macOS with Claude Desktop 4.4212.0: test hooks placed in Claude Code managed settings, including a managed-settings.d drop-in, ran in Cowork turns, and a deny from them stopped the tool. In the 1.0.8 tests on managed macOS and Windows, with Claude Desktop 4.16336.0 (engine 2.1.317) using third-party inference through Amazon Bedrock, Cowork's hook calls reached the DefenseClaw gateway with surface cowork, and an administrator deny rule blocked mcp__workspace__bash. A read of a .env file was not blocked: its contents reached the model, which chose not to repeat the key (DefenseClaw did not withhold it), and on macOS DefenseClaw recorded the secret after the read. To prevent such a read, deny the path at PreToolUse: see Secrets in tool results. On Windows, an account that has only Claude Desktop is enrolled. On managed macOS, with the gateway service stopped, Cowork prompts were blocked with enterprise_managed_gateway_not_running. Those tests did not cover whether Cowork's built-in hook that keeps file tools inside the connected folders still runs under enforce. On Linux, the managed drop-in and per-user setup were verified, but Cowork itself was not run: Claude Desktop for Linux is a beta, and Cowork on Linux is not certified.
Customers' own Cowork plugin hooks. managed_hooks_only for claudecode decides whether they run. Measured on managed macOS with Claude Desktop 4.16336.0: under enforce an organization plugin's hooks did not run, under preserve they did, and DefenseClaw's own hooks ran under both. Windows has not been measured yet.
enforce(the default) setsallowManagedHooksOnly: true. Anthropic documents that Claude Code then runs only the hooks in managed settings, in Cowork as in the terminal, so hooks in Cowork plugins do not run: plugins your users upload, marketplace plugins and organization plugins (org-plugins/). The other parts of those plugins (skills, commands, MCP servers) are not affected. Claude Desktop 4.16336.0 installs an organization plugin only when its.claude-plugin/plugin.jsonsets"installationPreference": "required"; otherwise the plugin is only listed as available.preserveleaves the lock out, so those plugin hooks run too, and a plugin hook can change a tool call's input after DefenseClaw inspected it. The foreign-hook guard does not read Cowork plugins, so it does not stop those hooks either.
To let your users' Cowork plugin hooks run, set preserve for Claude Code only, then apply the config (ensure on Linux and macOS, Setup /ensure on Windows):
enterprise:
machine_policy:
connectors:
claudecode:
managed_hooks_only: preserveThe engine build. Claude Desktop keeps that engine in the user's own data folder, under claude-code/<version>/. Each deployment has its own folder, and DefenseClaw looks in all of them:
| OS | Signed in to Claude | Third-party inference (Bedrock, Vertex AI, Foundry) |
|---|---|---|
| macOS | ~/Library/Application Support/Claude | ~/Library/Application Support/Claude-3p |
| Windows | %APPDATA%\Claude, or for the Microsoft Store (MSIX) app %LOCALAPPDATA%\Claude-Data\claude_<id> | %LOCALAPPDATA%\Claude-3p |
| Linux | ~/.config/Claude | ~/.config/Claude-3p |
DefenseClaw trusts the engine by its code signature, not by its folder: on macOS a valid Developer ID signature of Anthropic (team Q6L2SF6YDW, identifier com.anthropic.claude-code), on Windows a valid Authenticode signature by Anthropic, PBC (or Anthropic PBC) on a claude.exe whose file version is the folder's version. The engine's version then selects the hook contract, as for the Claude Code CLI. In each data folder DefenseClaw takes the newest build that verifies, so a newer unsigned or half-downloaded build does not hide a signed one. Each data folder counts on its own, and the user's row follows the oldest admitted engine, so its hooks work for both deployments. A build whose signature does not verify is reported with the reason: surface_unverified in the unprotected agents, and managed_launch_uninspected while it runs. Linux builds carry no vendor signature. A Linux build counts only when its version folder holds an executable claude; it is always reported as unsigned (status shows unsigned) and as unidentified while it runs, so verify fails while one runs. Its version still selects the hook contract, as before. On Windows, when more Claude-Data\claude_<id> folders exist than DefenseClaw reads (four), the one of the installed MSIX package is read first, and the scan reports the app inventory as incomplete.
Status. status and verify print a cowork line and a cowork JSON member: whether DefenseClaw's side is configured (claudecode enabled, its machine policy hooks in place, and the Claude Desktop surface not refused by enterprise.enrollment.unverified_versions: refuse), the lock, the Cowork events the gateway saw since it started, and, for each enrolled account, its last Cowork event or never. The line says how many hook calls reported themselves as Cowork since the gateway started and when the last one came, or that none has yet. The last Cowork event is the last hook call that reported itself as Cowork: the hook names its surface (caller-reported attribution, which any local process can send), so it is not proof that the DefenseClaw hook ran in Cowork. accounts_truncated says more accounts exist than are listed. Run as root (Linux, macOS) or as an elevated administrator (Windows), the block also lists, for every account enrollment includes, its Claude Desktop data folders (1p and 3p), the newest Claude Code engine build in each, and that build's trust: trusted (macOS: the code signature verifies as Anthropic's Claude Code and its Info.plist names the folder's version, and codesign runs as the account; Windows: a claude.exe in the build has an Authenticode signature by Anthropic whose signed file version is the folder's), untrusted, unsigned (every Linux build) or not_found (JSON claude_desktop), for example cowork alice: Claude Desktop 3p (...), engine 2.1.317 trusted. It is read from disk when status runs, so no Cowork session has to be open, and the engine is never run. On Windows a status run as LocalSystem (an MDM run) reads each account's folders as that account, so an account with no signed-in session is listed as not checked. On Linux and macOS Claude Code is a machine-policy connector, so these accounts have no enrollment row and enrollment.targets does not count them. Account names are in this administrator view only and are not in the forward schema; the forward schema keeps only the counts. The TUI shows only the gateway's Cowork event count on the Claude Code connector.
Copilot in VS Code
Two keys, valid only under connectors.copilot, control VS Code's Copilot harnesses:
enterprise:
machine_policy:
connectors:
copilot:
harness_preference: sdk # or unmanaged
local_harness: govern # or retireharness_preference: sdk(default) enablesChatEditorPreferCopilotHarness, so new editor chats use the SDK harness, which reads Copilot'spolicy.d. Withunmanaged, DefenseClaw does not set that policy.local_harness: govern(default) places a per-user Local hook file,~/.copilot/hooks/defenseclaw-vscode.json. Withmanaged_hooks_only: enforceit also places a per-user plugin, which it enables in Copilot's managed settings.- The Local harness lock. On Linux, DefenseClaw also sets
allowManagedHooksOnlyin/etc/github-copilot/managed-settings.json, but only once every enrolled user has the plugin and every VS Code found is 1.139.x. local_harness: retireplaces neither file and setssandbox.enabledin Copilot's managed settings.
See GitHub Copilot in VS Code.
Ownership modes
enterprise:
machine_policy:
default:
ownership: merge # write and repair DefenseClaw's entries
connectors:
codex:
ownership: verify_only # your MDM writes the file; DefenseClaw only checks it
cursor:
ownership: "off" # leave this agent's machine policy aloneownership | What DefenseClaw does |
|---|---|
merge (default) | Writes its entries and repairs them |
verify_only | Only checks the file. When its entries are missing, it reports missing_defenseclaw_hooks and the export command to use. |
off | On Linux and macOS, leaves the machine policy alone. Codex, Claude Code, Cursor and Copilot then have no DefenseClaw hooks, and policy show lists them as ownership off: machine policy not managed; OpenCode keeps its per-user plugin. On Windows, configured Claude Code, Codex and Cursor machine hooks remain installed and are verified even with zero enrolled users. The setting applies to Copilot, OpenCode and the Claude Code version floor there. |
Quote "off" so YAML 1.1 tools do not read a bare off as the boolean false. Use verify_only when an MDM already writes a policy file on Linux or macOS: export DefenseClaw's entries (below) and add them to the MDM's template. On Windows, the lifecycle writes the configured Claude Code, Codex and Cursor machine hooks regardless of ownership, and enterprise policy verify checks them even before the first user enrolls and after the last is removed.
Claude Code version floor
DefenseClaw sets Claude Code's managed requiredMinimumVersion to 2.1.154, the lowest version it has a verified hook contract for. Today that floor stops no Claude Code build: Claude Code reads the setting only from 2.1.163, and every build below 2.1.154 is older than that, so it ignores the floor and starts. To keep older builds off a host, use application control (see Vendor limits, tracked in #920). A floor of 2.1.163 or later, such as one you set yourself, does stop builds from 2.1.163 that are below it.
DefenseClaw's value is in its own drop-in, 00-defenseclaw-version-floor.json, next to 90-defenseclaw.json.
On standalone Windows the floor follows the machine-wide hook drop-in. When every enrolled account runs Claude Code 2.1.219 or later, 90-defenseclaw.json uses the claudecode-hooks-v2 contract, which adds the DirectoryAdded event, and the floor rises to 2.1.219; enterprise policy show and verify name the reason. Claude Code 2.1.163 to 2.1.218 then refuses to start until it is updated. Claude Code 2.1.154 to 2.1.162 predates requiredMinimumVersion, so it still starts and shows a Settings Warning that DirectoryAdded is an unknown hook event and was skipped. The rest of the file stays in effect, so DefenseClaw's hooks still block and audit; choose Continue and update that copy of Claude Code.
enterprise:
machine_policy:
connectors:
claudecode:
version_floor: enforce # enforce (default), report or "off"version_floor is set only under connectors.claudecode. Naming claudecode there makes the Linux and macOS lifecycle publish DefenseClaw's Claude Code machine policy.
version_floor | What DefenseClaw does |
|---|---|
enforce (default) | Writes the floor drop-in while no other source sets requiredMinimumVersion to a version, and removes it once one does |
report | Writes nothing; policy show reports that older builds can start |
off | Writes nothing and does not manage the setting |
- Your value wins. When
managed-settings.json, another drop-in,HKLM\SOFTWARE\Policies\ClaudeCode\Settingsor the macOS managed preferences setrequiredMinimumVersionto a version, DefenseClaw leaves that file alone and withdraws its own drop-in, even when the value is below 2.1.154.policy shownames the source. On Windows the guardian withdraws the drop-in on its next cycle. On Linux and macOS the withdrawal happens at the next lifecycle run that applies changes (ensure,reconcileorrepair). Until then, a value inmanaged-settings.jsonor in a drop-in that sorts before00-defenseclaw-version-floor.jsonis overridden by DefenseClaw's drop-in;policy showandpolicy verifyreport that, and underownership: mergeverifyreports drift. - A file at the drop-in's name is yours unless DefenseClaw wrote it. The file counts as DefenseClaw's only while its ownership record names it and its hash matches. Any other file there (for example the
version-floorexport you deploy yourself) is never rewritten or removed, andpolicy showreports its value as the administrator's. If that file sets no version,policy verifyfails underenforceuntil you add the key or remove the file. - A value that is not a version does not count. Claude Code ignores it. In a file that merges before DefenseClaw's drop-in, DefenseClaw keeps its drop-in, whose later value applies. In one that merges after it, no floor applies and
policy verifyfails until you fix the value. - When it applies. The drop-in is written only in the standalone profile, while
claudecodeis enabled underguardrail.connectorsor named underenterprise.machine_policy.connectors, withownership: merge. To stop it, remove the name from both maps or setenabled: falseorownership: "off". A Windows config that namesclaudecodewrites the floor even when no Claude Code user is enrolled. Linux and macOS write it at install and at every lifecycle run that applies changes; on Windows the guardian writes it every cycle. Uninstall removes it. - Ownership.
mergewrites and repairs it.verify_onlyneither writes nor removes it: deploypolicy export --connector claudecode --format version-flooryourself.offremoves DefenseClaw's floor. - Coverage. With
version_floor: enforceandownership: merge, a floor that is missing or cannot apply is a conflict:policy showlists Claude Code as not covered andpolicy verifyexits 1. The hook drop-in stays in place and hook calls are still inspected. On Linux and macOS, when DefenseClaw's own drop-in is missing,statusandverifyalso warn withclaude_version_floor_missing, and the nextensurewrites it back. - Higher-precedence sources. Claude Code builds older than 2.1.242 ignore
"managedSourcesBehavior": "merge"and read only the higher-precedence source (HKLM\SOFTWARE\Policies\ClaudeCode\Settings, the macOS managed preferences) while one is in force. The floor in the managed settings files does not reach them, even when that source carries DefenseClaw's hooks. Add"requiredMinimumVersion": "2.1.154"to that source. Until thenpolicy showmarks the floornot appliedandpolicy verifyfails (a warning withhigher_precedence_sources: warn). - Limits. The check runs when a session starts; running sessions go on. Builds before 2.1.163 ignore the setting, and builds that do not read
managed-settings.dignore the drop-in altogether.
Higher-precedence sources
Some policy sources outrank the files DefenseClaw writes.
| Connector | Source | OS | Accepted when |
|---|---|---|---|
| Claude Code | com.anthropic.claudecode managed preferences in /Library/Managed Preferences | macOS | It contains DefenseClaw's hooks, or sets "managedSourcesBehavior": "merge" (Claude Code 2.1.242 or later). With version_floor: enforce, a merge profile must also set "requiredMinimumVersion" to the floor policy verify names. The --format plist export embeds the hooks and the floor instead. |
| Claude Code | Server-managed settings from the claude.ai console | All | Not visible on the machine; prove the result with --live |
| Claude Code | HKLM\SOFTWARE\Policies\ClaudeCode\Settings | Windows | Never; see Windows differences |
| Codex | com.openai.codex managed preferences (requirements_toml_base64) in /Library/Managed Preferences | macOS | It contains DefenseClaw's managed hooks. Export them with --format plist. |
| Codex | Cloud-managed requirements | All | Not visible on the machine; prove the result with --live |
higher_precedence_sources decides what happens when a visible source does not include DefenseClaw's hooks. Visible sources exist on macOS and on Windows (the Claude Code HKLM Settings value). On Windows the setting changes only what policy show and verify report: the lifecycle never publishes the Claude Code drop-in while that value is set.
fail(default). The source is recorded as a conflict and the connector counts as not covered.ensureandstatusreport the warningmachine_policy_incomplete, which names the source, withsecurity_complete: false./opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise macos verifyexits 1. Enrollment continues.warn. The source is reported as a note, and the connector can still count as covered.
Inspect, export and verify
These commands read the managed config and machine policy; they never write it. Run them as root (Linux and macOS) or from an elevated PowerShell 7 session (Windows). They find the managed config themselves.
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise policy show
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise policy show --user alice --project /home/alice/repo
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise policy export --connector codex --format toml
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise policy verify --json
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise policy verify --live --user alice --connector codex --agent-binary /usr/local/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codexsudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise policy show
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise policy export --connector codex --format plist
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise policy export --connector claudecode --format plist& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise policy show
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise policy export --connector copilotshowlists, per connector: the route, whether it is covered, the lock and effective lock, the foreign-hook mode, DefenseClaw-owned and foreign entries, files, conflicts and notes.--connectorlimits it to one connector.--useralso scans that user's own agent config for foreign hooks, and--project(with--user) scans a repository.--jsonprints JSON.exportprints DefenseClaw's entries for one connector, to deploy through your own policy tool.--connectoris required. Without--format, you get the connector's native file.
--connector | --format |
|---|---|
codex | toml (default): the complete merged requirements.toml. plist: a macOS profile payload with requirements_toml_base64. |
claudecode | json (default): the drop-in. claude-hklm-json, reg, intune-settings-catalog: the same content as a HKLM\SOFTWARE\Policies\ClaudeCode Settings value. plist: a macOS managed-preferences payload. version-floor: the version floor drop-in. |
cursor | json: the enterprise hooks.json |
copilot | json: the policy.d drop-in |
opencode | json: a managed OpenCode config that loads <install root>/share/opencode/index.js. Deploy it only where that plugin is installed. |
devincascade | None: DefenseClaw publishes no Cascade entry, so export returns an error |
wsl | Windows. reg (default), json, intune: the Claude Desktop disableWslSessions gate and, with platform: disable, AllowWSL=0. See Agent sessions in WSL |
verifychecks coverage and exits 1 when any machine-policy connector is not covered, or when--userfinds a foreign hook that would be blocked.verify --liveruns the real Codex or Claude Code client as a user and proves that it loads DefenseClaw's hooks. It needs--user, exactly one--connector(codexorclaudecode) and--agent-binarywith the client's absolute path.--timeoutdefaults to 90 seconds. The client runs with a minimalPATH(the client's folder,/usr/binand/bin), so name the native executable, not a launcher script: the npmcodexcommand iscodex.js, which needsnode; the native binary is undernode_modules/@openai/codex-<platform>/vendor/<target>/bin/codex. Claude Code is pointed at a local stub through command-line settings, so a user whose settings use Amazon Bedrock, Vertex AI or another base URL makes no model call, and a provider that managed settings force makes the check fail. For Claude Code the proof is the gateway'stool.invocation.requestedrecord of a canary tool call, so the gateway must be running;--audit-dbnames the audit database if it is not in the standard place. On Linux and macOS run it as root or as that user. A managed Windows host refuses--live; see Windows.
A missing hook executable makes Windows Claude Code, Codex, Cursor and Copilot policy
verification fail even when their machine policy files remain installed and no
users are enrolled. Stop the affected agent, repair the installation, and run
enterprise windows verify --profile standalone --json from an elevated prompt.
Require that full check to pass before allowing agent use.
Usage telemetry
Machine policy registers DefenseClaw's hooks only. It does not turn on an agent's own OpenTelemetry export, so an agent attached this way sends no usage telemetry of its own (token counts, cost, session and request metrics). Its prompts and tool calls are still inspected and audited, and DefenseClaw's own spans, logs and metrics reach your observability destinations. To collect an agent's usage telemetry as well, configure its OpenTelemetry export with the vendor's own managed settings.
Vendor limits
A stopped Codex or Claude Code pre-tool hook can let the tool run. Setup configures a 30-second PreToolUse timeout, but these agents treat hook process failure or timeout as non-blocking. Codex has no reviewed on-timeout deny setting. If the user stops their hook before it contacts the gateway, there is no request to deny or pre-tool audit row to write; a later PostToolUse cannot undo the command and may also be absent. A request that does reach the standalone gateway but loses its answer is recorded as block/no_answer. Standalone status and verify report hook_process_fail_open for affected enabled connectors and set security_complete: false; coverage_complete still means the hook registration is installed. To prevent this class, use application control or EDR that stops standard users from signaling hook processes. The managed hook files and gateway cannot provide that process protection. Restart agents after hook registration changes.
Malformed hook input is refused while the hook runs. The gateway validates the complete JSON event envelope before selecting a connector event. A wrong-type, missing or conflicting event field, truncated body or ambiguous non-tool JSON gets a 400 and a connector-hook audit rejection naming the parse failure. The registered standalone hook turns that response into a closed native failure. A structured pre-tool call with duplicate JSON keys, conflicting tool-input aliases or unreadable tool fields gets a native block with HOOK-TOOL-CALL-UNPARSED in its decision and audit record, including Claude Code and Codex PreToolUse. Oversized input is blocked by the hook itself and reported to the gateway when its authenticated reporting path is available. These checks require the hook process to run; they do not close the stopped-process limit above.
The other agent-specific limits are:
- Claude Code.
claude --bareandCLAUDE_CODE_SIMPLE=1skip the managedSessionStarthook. Claude Code 2.1.287 still runs the managedUserPromptSubmit,PreToolUseand later tool hooks in both modes; other releases may skipUserPromptSubmittoo, so tool calls stay inspected and prompt inspection is best effort. - Claude Code before 2.1.163. These builds do not read
requiredMinimumVersion, so no floor stops them. Those that readmanaged-settings.d, such as 2.1.153, still run DefenseClaw's hooks. Where the Windows hook drop-in uses the v2 contract they also show a Settings Warning about the unknownDirectoryAddedevent. Use application control to allow only the versions you support. - Older Claude Code releases (Linux and macOS). Releases that do not read
managed-settings.d(for example 1.0.128, 2.0.0 and 2.0.77) ignore both DefenseClaw drop-ins. A standard user can run one from a privatenpm --prefixinstall without a hook decision or tool-call audit. The enumerator reports a copy in a known npm root or any npm prefix below the user's home, and a Claude Code extension or desktop engine below that floor, by version and path, makes managed completeness false and audits the coverage finding. That audit reports the gap; it cannot reconstruct the uninspected tool call. Renamed, copied and self-built clients, or clients started and removed between scans, need application control. Allow only approved Claude Code versions at or above 2.1.154. Tracked in #920. - Older Copilot CLI releases. A Copilot CLI below its 1.0.18 floor can skip machine policy: 1.0.15, installed under a home and run with
--no-auto-update, does not load/etc/github-copilot/policy.d, and its tool calls run with no audit record. - Copilot. The vendor hook reference says a timed-out
preToolUsecommand hook is non-blocking, including policy hooks. A laterPermissionRequesthook may still deny: Copilot CLI 1.0.91 denied the managed Linux stop drill ("hook errored"), while earlier releases ran the call. Re-check each release. On Windows, Copilot also loads policy hooks fromHKLM\Software\Policies\GitHub\Copilot; those run beside DefenseClaw's drop-in. - OpenCode. The order in which OpenCode runs plugins is not a documented contract, so the foreign-hook guard stays on. OpenCode 2.2.5 has no pure mode (no
--pureflag) and does not readOPENCODE_PUREorOPENCODE_TEST_MANAGED_CONFIG_DIR, the two ways OpenCode V1 skipped the managed plugin. It loads that plugin from/etc/opencodeon Linux and/Library/Application Support/opencodeon macOS. On Windows it uses%ProgramData%\opencodeas the process environment namesProgramData, so a session started with anotherProgramDataruns without DefenseClaw's hooks.OPENCODE_CONFIG_DIRadds another config directory and does not remove the enrolled managed plugin. Managedstatusandverifyscan running OpenCode processes on Linux, macOS and Windows: they report the process and mark coverage incomplete when itsProgramDatawas moved (Windows), when it was started withOPENCODE_PUREorOPENCODE_TEST_MANAGED_CONFIG_DIR(in case a later release reads them again), or when they cannot establish its launch environment. The observation is written to the gateway audit; Windows also records the coverage code in the enterprise event log and the process detail in its protected lifecycle log. An audit delivery failure is reported.policy showdescribes the installed registration; it cannot prove how a running client was launched. A session that ends before a process scan cannot be observed by that scan. Use application control to prevent launches with a movedProgramDatawhere inspection is required.OPENCODE_CONFIG_CONTENTandOPENCODE_DISABLE_DEFAULT_PLUGINSdo not remove the managed plugin. - Per-user connectors. Amp has no machine-wide plugin location. A changed
HOME,USERPROFILE(Windows) orXDG_CONFIG_HOMEcan move Amp, Devin, Antigravity or Hermes away from the config the guardian repairs. On Windows, redirectedAPPDATAcan move Devin's config and redirectedLOCALAPPDATAcan move Hermes' config.devin --configselects another file; Hermes--safe-modeorHERMES_SAFE_MODEskips its user hooks, andHERMES_HOMEorHERMES_MANAGED_DIRcan move them. Kiro CLI can select another agent with--agent, start a cloud session with--cloud, resume a session of unverified placement with--resume-id, or move its agent files withKIRO_HOME,KIRO_AGENT_CONFIG_DIRorKIRO_TEST_AGENTS_DIR. Managedstatusandverifyinspect selected launch variables and report bypasses or unreadable process environments as incomplete coverage. On Windows, the elevated CLI reads these variables from the process and resolves its profile through the owner SID; a process it cannot read stays unverified. A value Hermes reads from a.envfile after process start, or a session that ends before a scan, may not be recoverable from the process table; use application control where those launches must be prohibited. - Hermes. Reviewed Hermes 0.21 supports
fail_closed: trueonpre_tool_call. Setup and guardian reconciliation now write it;verifyrejects an entry missing it, and existing Hermes sessions must restart to load the repaired registration. Hermes 0.19/0.20 do not support it and can run a tool after hook process failure. Hermes 0.21 still treats a killed hook (non-2 exit with empty stdout) as no decision, so status and verify keephook_process_fail_openfor it. - Devin. A killed pre-tool hook may let the call run.
- Kiro and Antigravity. Kiro CLI 2.x was measured running a tool after a slow pre-tool hook timed out. Antigravity documents a hook timeout but no on-timeout deny setting; the T7 stop drill blocked in one build, which does not establish a contract. Both receive
hook_process_fail_openwhile enabled. - OpenCode and Amp hook process failures. Their reviewed pre-tool plugins block while loaded; the separate agent launch and plugin-load bypasses are listed above.
- Cursor. Cursor applies the enterprise
hooks.jsononly on plans that support enterprise hooks. Confirm on a real client.
For an enrolled account, the five-minute enumerator checks every place it can select an agent version from for separate Claude Code, Codex and Copilot CLI copies: the per-user npm roots and immediate child directories of the home, every installed Node of nvm, fnm, asdf, mise and pnpm (up to 64 per manager), Volta's per-package images, Claude Code's vendor local installer at ~/.claude/local and native versions directory, and the machine npm prefixes (/usr/local, /usr, /opt/homebrew and agent_prefixes; Node's own folder on Windows). On macOS it also checks Homebrew cask releases, and on Windows WinGet installs. A Claude Code npm copy counts whether it runs cli.js or the native bin/claude.exe (2.1.113 and later). Each copy is identified by the real path it resolves to, so a copy reached through a link is listed once. A copy in a location another account can change is listed as unverified whatever version it claims. A folder the account's own discovery cannot read, such as a macOS privacy-protected folder, is not inspected; use application control there. A runnable copy below a verified hook contract, or one whose version cannot be read, is listed individually by path in status and verify as not protected. Both completeness fields become false; status and verify send each finding to the managed audit. An incomplete bounded scan also makes completeness false. This is detection, not an execution block. An old Claude Code such as 2.0.77 ignores the managed drop-in and version floor, so it can still run a tool call until the administrator removes it or application control blocks it.
The enumerator publishes its protected unprotected-agents.json record even when it found no unsupported installs. If the record is missing, unreadable, or more than 16 minutes old, status and verify report agent_install_scan_incomplete and set both completeness fields to false; verify reports it as a scan-pending warning, not a failure, until a successful enumeration publishes the record; an unreadable record fails verify. This includes the short interval after a fresh install or an upgrade from a release that did not publish the record. In enterprise.enrollment.mode: manifest, the enumerator scans the accounts of the enabled administrator-authored targets, including accounts outside the automatic uid, shell, group and home-root filters, and no one else; a target it cannot inspect (an unresolved account, an untrusted home) is reported agent_install_scan_incomplete. It refreshes this record while leaving the targets untouched. exclude_users and exempt_users still win. On Windows, a standard token cannot read the protected record: status and verify report the inspection as incomplete and ask for an elevated Administrator prompt.
The scan cannot prove that every executable on the filesystem is approved. Deeper custom prefixes, links or junctions to unscanned locations, renamed or copied binaries, self-built clients, user-controlled version metadata and a launch between scans remain outside the static search. On Linux and macOS, status and verify identify each running Claude Code from the executable the kernel recorded, not from its process title. They read the release from the native installer's versions directory, a Homebrew cask's version directory, or the npm package of the native binary (@anthropic-ai/claude-code/bin/claude.exe, or the platform package the npm fallback wrapper starts). A release with a verified hook contract passes; an older release, a copied, renamed or self-built binary, and a build replaced on disk while it runs are reported until that session restarts. A Volta shim counts as a launcher while the build it started runs; that build is checked on its own. A Node-hosted Claude Code script is checked by its package version while the script path remains in the process arguments; no release at or above the hook contract floor runs as a Node script, so one whose title hides the script is reported. A process that exits before a running-process scan is not observed. To require complete enforcement, restrict agents to approved builds and install paths with endpoint application control (WDAC or AppLocker on Windows, fapolicyd on Linux, or Santa on macOS) and test the exact private-prefix launch. An allow rule for the Node executable alone does not prevent it from loading an unapproved @anthropic-ai/claude-code/cli.js; the control must also restrict that script or prohibit user-launched Node. Include package runners and user-writable prefixes in the test. DefenseClaw does not install or configure those controls.
See Residual risks for the full list.
Enrollment
How the enumerator picks the users and agents to protect on Windows, Linux and macOS, the filters you can set, and what happens when users change.
Sandboxes on managed computers
Let people on managed Linux and macOS computers run Claude Code, Codex and other agents in NVIDIA OpenShell sandboxes under the policy their directory group selects. Covers the install modes, the sandbox section of a guardrail profile, requiring sandboxes per group and agent, asks, foreign sandboxes, what users see, and how to inspect and troubleshoot it.