EnterpriseWindows

Windows reference

Look up standalone DefenseClaw on Windows: paths, services, Setup actions and properties, rule packs, payload trust, LocalSystem Setup, recovery and WSL.

Reference detail for the standalone Windows deployment. The install path is in Install on Windows. Upgrade and removal are in Upgrade and remove on Windows.

Layout

Binaries go under Program Files and state under ProgramData. Standard users cannot change either tree.

ItemPath
BinariesC:\Program Files\Cisco\DefenseClaw\bin: defenseclaw.exe, defenseclaw-gateway.exe, defenseclaw-hook.exe, defenseclaw-hook-guard.exe, defenseclaw-acp.exe, defenseclaw-sensor-helper.exe
Hook imagesC:\Program Files\Cisco\DefenseClaw\bin\hooks\<digest>\: the hook and hook guard that agents start (The hook during an upgrade)
Lifecycle scriptsC:\Program Files\Cisco\DefenseClaw\libexec
Managed OpenCode pluginC:\Program Files\Cisco\DefenseClaw\share\opencode\index.js. Users hold read, execute and write-attributes on this one file because OpenCode opens every module with that right (Machine policy)
ConfigC:\ProgramData\Cisco\DefenseClaw\etc\config.yaml
SecretsC:\ProgramData\Cisco\DefenseClaw\secrets
Target manifestC:\ProgramData\Cisco\DefenseClaw\hook-guardian\targets.yaml (the enumerator writes it)
Lifecycle stateC:\ProgramData\Cisco\DefenseClaw\install
Gateway dataC:\ProgramData\Cisco\DefenseClaw\runtime
Authorization ledgerC:\ProgramData\Cisco\DefenseClaw\hook-guardian-state
Service logsC:\ProgramData\Cisco\DefenseClaw\logs
Scanner runtimeC:\ProgramData\Cisco\DefenseClaw-ScannerRuntime: defenseclaw-scanners.exe and the Python runtime it unpacks. The gateway can only read and run it
Shipped rule packsC:\ProgramData\Cisco\DefenseClaw-RulePacks\<digest>\strict and \permissive (Strict and permissive rule packs)
Hook runtimeC:\ProgramData\Cisco\DefenseClaw-HookRuntime, readable by users: the enrollment lists, runtime selectors and machine-policy.json
Lifecycle log%WINDIR%\Logs\DefenseClaw: enterprise-lifecycle.log, last-result.json and mdm-wrapper.log. Only Administrators and Event Log Readers can read them

Before the gateway launches a scanner, it checks the access list of the bundled Python interpreter and every file under python, including Lib\site-packages. Only SYSTEM and Administrators may change code there. A failed check blocks the scan and names the path; DefenseClawSetup-Enterprise-Standalone-x64.exe /repair JSON=1 restores the runtime.

Windows registrations

RegistrationValue
Deployment markerHKLM\SOFTWARE\Cisco\DefenseClaw\Enterprise (Profile, ProductVersion, InstallRoot, StateRoot, TrustMode, UpdatedAt, DisableSelfUpdate). For detection only: verify never trusts it
Add/Remove ProgramsHKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CiscoDefenseClawEnterprise, "Cisco DefenseClaw Enterprise"
Event logThe DefenseClaw log, source DefenseClaw Lifecycle, writable only by LocalSystem and Administrators
Self-update policyHKLM\SOFTWARE\Policies\Cisco\DefenseClaw\DisableSelfUpdate = 1, written only when absent and removed on uninstall only in that case. Set enterprise.coexistence.disable_self_update: false to opt out

Services

The four services restart after a failure.

ServiceIdentityRole
DefenseClawGatewayLocalSystem, write-restricted by its NT SERVICE\DefenseClawGateway service SID, with only SeChangeNotifyPrivilegePolicy engine and hook API on 127.0.0.1:18970
DefenseClawSensorHelperLocalSystem, SeChangeNotifyPrivilege onlyAnswers the gateway's fixed AI Discovery requests
DefenseClawHookGuardianLocalSystemWrites and repairs each enrolled user's registrations and the configured machine hooks every minute, even with no enrolled users
DefenseClawHookEnumeratorLocalSystemFinds eligible profiles (local, domain and Microsoft Entra ID (Preview) accounts) every five minutes and writes the target manifest
writes
reads
repairs, as the user
PrivilegedZ1 · Services (LocalSystem)
ProtectedZ3 · Admin-owned files
UntrustedZ4 · User session (the user)
Enumeratorlists the users
Guardianchecks every minute
Target manifesttargets.yaml
Agent configin the user's profile

List view for small screens. Use the expand button to open the drawing.

PrivilegedZ1 · Services (LocalSystem)

  1. Enumeratorlists the users
    • writesTarget manifestZ3
  2. Guardianchecks every minute
    • readsTarget manifestZ3
    • repairs, as the userAgent configZ4

ProtectedZ3 · Admin-owned files

  1. Target manifesttargets.yaml

UntrustedZ4 · User session (the user)

  1. Agent configin the user's profile
Windows. The enumerator lists the users to protect in hook-guardian\targets.yaml. The guardian puts back DefenseClaw's hooks in each listed user's agent config, writing under that user's own token and only while the user has an active session. It also writes the Claude Code, Cursor, Copilot and OpenCode machine policy; the lifecycle writes Codex's.
Text version of this diagram

Privileged: Z1 · Services (LocalSystem)

  • Enumerator: lists the users (component)
    • writes to Target manifest (Z3 · Admin-owned files)
  • Guardian: checks every minute (component)
    • reads to Target manifest (Z3 · Admin-owned files)
    • repairs, as the user to Agent config (Z4 · User session (the user))

Protected: Z3 · Admin-owned files

  • Target manifest: targets.yaml (policy layer)

Untrusted: Z4 · User session (the user)

  • Agent config: in the user's profile (agent)

Setup actions and properties

Setup exits with Windows Installer codes:

CodeMeaning
0Success, or nothing to do
1603Failure. A failed install, upgrade or repair is rolled back; a refusal before any change leaves the computer as it was. If the rollback cannot finish, the transaction stays pending (Recover a pending transaction). For status and verify: the deployment is unhealthy
1618Retry later. Another lifecycle run holds the lock, or a program holds the installed hook or a Codex file open (hook_calls_running, hook_in_use, codex_state_held, codex_requirements_held, codex_state_unsettled). When a rollback met such a program, the transaction stays pending and /repair finishes it
1639Invalid arguments: a malformed command line (a relative CONFIG= path, an unknown property), /ensure without CONFIG= on a computer with no deployment, a config the gateway cannot load, or a run enterprise.trust refuses. Retrying does not help
3010Reserved. The lifecycle never requests a restart

Actions: /ensure (preferred), /install (also needs MANIFEST=), /upgrade, /repair, /reconcile, /status, /verify and /uninstall. /? lists the actions and properties.

Properties use NAME=value. Names are case-insensitive and ignore dashes.

PropertyMeaning
CONFIG=<path>The administrator config, as an absolute path. Required for the first install; later runs reuse the installed config
MANIFEST=<path>A target manifest you publish. Required for /install and for enterprise.enrollment.mode: manifest
BUNDLE=<path>With /ensure: apply this signed policy bundle. With CONFIG= on a computer without DefenseClaw, Setup installs with every service stopped, applies the bundle and starts the services on it; if the bundle is not applied it removes that install and exits 1603. On an installed computer CONFIG= is then ignored
TRUSTANCHORS=<path>With /ensure and BUNDLE=: install this administrator-only bundle trust anchor file with the bundle
DEVICEGROUP=<group>With TRUSTANCHORS=: pin the installed anchors to this one device group, which the file must list (or the file lists none). enterprise windows ensure --trust-anchors <file> --device-group <group> does the same
COWORKPACKAGE=<path>With /ensure, /install, /upgrade or /repair, not with BUNDLE=: the Cowork VM sensor package, authenticated by package_sha256 and cached (Cowork VM sensor)
COWORKSIGNATURE=<path>Like COWORKPACKAGE=: the package's detached signature, authenticated by signature_sha256
REFUSECAPABILITYLOSS=1With /ensure and BUNDLE=: refuse a bundle that turns off an enforced capability
ATTESTCLAUDEEFFECTIVEPOLICY=1With /repair: record the Claude Code attestation
ALLOWEDSIGNERS=<sha256>,<sha256>Accept only these Authenticode signer thumbprints (Payload trust)
JSON=1Print the result document on standard output
NOSTART=1Install with the services stopped and disabled (not_started warning); a later /repair starts them
PURGE=1With /uninstall: also remove each enrolled account's per-user data (Remove)
FORCE=1With /uninstall: remove the deployment without recovering a pending transaction
TIMEOUTSECONDS=<n>Lifecycle timeout, 60 to 7200, default 1800, counted from when Setup starts. A run stopped at the limit recovers for up to 10 more minutes, so allow TIMEOUTSECONDS plus 10 minutes. A change needs at least about 120 (Timeouts)

Other rules:

  • A property Setup does not know is refused, with a hint that lists the known ones.
  • A relative CONFIG= or --config path is invalid_arguments.
  • /repair from a release other than the installed one is refused before it changes anything. Use /ensure to move to this release and /upgrade to go down.
  • Prerelease versions order as semver does (rc.10 is newer than rc.9).
  • Third-party readers of managed files must open them with FILE_SHARE_DELETE or retry a transient open failure during replacement.

Timeouts

  • TIMEOUTSECONDS counts from when Setup starts. It also bounds the ensure run Setup starts: that run gets what is left, less a tenth, taking off at most 2 minutes.
  • A direct & 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows ensure keeps a 12-minute limit.
  • A run that stops at the limit (lifecycle_timeout) prints the retry command with TIMEOUTSECONDS=7200. Setup then runs its own recovery for up to 10 more minutes, so allow TIMEOUTSECONDS plus 10 minutes.
  • A change (/install, /ensure, /upgrade, /repair, /uninstall) needs at least about 120. With less than about a minute left after the payload checks, Setup does not start the lifecycle and changes nothing. Lower values suit only /verify and /status.

Rule packs

Custom rule packs

A pack folder (a guardrail.custom_packs entry) must be writable only by administrators and readable by the gateway service SID and by no standard user. Every parent folder needs Read and execute for that SID too, so give the packs their own folder, not the staging folder. Keep it apart from the shipped packs under C:\ProgramData\Cisco.

sc.exe showsid DefenseClawGateway prints the SID. Before the first install the service does not exist and icacls cannot grant it (error 1332), so set the permissions with Set-Acl, which writes the SID without a lookup:

$Packs = 'C:\ProgramData\DefenseClaw-RulePacks'
New-Item -ItemType Directory -Path $Packs -Force | Out-Null
# Owner Administrators, no inherited entries, SYSTEM and Administrators Full control,
# NT SERVICE\DefenseClawGateway Read & execute (by SID, so this works before the first install).
$Acl = Get-Acl -LiteralPath $Packs
$Acl.SetSecurityDescriptorSddlForm('O:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;S-1-5-80-1858176940-1394861675-2895326486-505287571-2610476274)', 'Owner, Access')
Set-Acl -LiteralPath $Packs -AclObject $Acl
if (Test-Path -LiteralPath "$Packs\my-pack") {
    icacls "$Packs\my-pack" /reset /T /C | Out-Null
    Remove-Item -LiteralPath "$Packs\my-pack" -Recurse -Force -ErrorAction Stop
}
Copy-Item -LiteralPath .\my-pack -Destination $Packs -Recurse -ErrorAction Stop
icacls "$Packs\my-pack" /setowner '*S-1-5-32-544' /T /C | Out-Null

The snippet is safe to run again. Then name and pin the pack in the config:

config.yaml (excerpt)
guardrail:
  rule_pack: my-pack
  custom_packs:
    my-pack:
      path: 'C:\ProgramData\DefenseClaw-RulePacks\my-pack'
      digest: 'sha256:<digest>'

To get the digest before the first install, put a placeholder (sha256: and 64 zeros) in the config and run Setup. It refuses with 1639 and prints the pack's digest. Review the pack, put the digest in the config and run Setup again. Once installed, & 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw-gateway.exe' rulepack validate --dir <folder> prints it as custom_packs pin:.

CheckResult
Pack folder with the wrong owner or permissionsRefused, 1639, with the fix
Pack readable by Users, Authenticated Users, Everyone, INTERACTIVE or Domain UsersWarning rule_pack_readable_by_users
kind: jsonl destinationNeeds a folder only SYSTEM, Administrators and the gateway SID can write

For Intune, the kit's reference rule-pack app sets these permissions (Custom rule pack app).

Strict and permissive rule packs

default is built into the binaries. Setup writes strict and permissive to C:\ProgramData\Cisco\DefenseClaw-RulePacks\<digest>, where <digest> is the first 16 hex digits of a digest of the packs' files. A release reads only its own folder, so a rollback keeps working. Only SYSTEM and Administrators can change it.

Select a pack with no other setting, then run /ensure. Set rule_pack: default and run /ensure again to switch back.

config.yaml (excerpt)
guardrail:
  rule_pack: strict
  • The gateway refuses a shipped pack folder whose files are not the ones its release ships. status and verify then report rule_pack_shipped_invalid, and /repair or /ensure writes the folder again.
  • If Setup cannot write the folders while the config uses default, the run succeeds with a warning. The first run that selects strict or permissive writes them, and fails if it cannot.
  • A policy_dir that holds guardrail\strict (or guardrail\permissive) takes precedence, and that copy is yours to change. To use the shipped pack instead, remove that folder from policy_dir and run Setup /repair.
  • Setup keeps the folders of older packs on upgrade, so a rollback finds its own. Uninstall removes all of them once no deployment is left.

Payload trust

The lifecycle refuses any payload file it cannot trust:

ModeHow a file is trusted
authenticodeEvery binary and script has a valid Authenticode signature. An allowed-signer list narrows the signers
hash_pinnedEvery file that is not validly signed matches a SHA-256 in an administrator-owned payload manifest
Entry pointTrust usedHow to change it
Standalone SetupChosen by the build: an unsigned Setup uses hash_pinned with a manifest Setup writes from its embedded copy; a signed Setup uses authenticodeALLOWEDSIGNERS= pins the signer of a signed build
defenseclaw.exe enterprise windowsauthenticode--trust-mode hash_pinned --payload-manifest <file>; --allowed-signer <sha256> (repeatable)
MDM wrapper (Invoke-DefenseClawEnterprise.ps1)HashPinned: it checks the Setup file against -Sha256 first-TrustMode Authenticode -AllowedSigners <sha256> (MDM)

Check a Setup's signature and print the signer thumbprint for ALLOWEDSIGNERS=:

$sig = Get-AuthenticodeSignature -LiteralPath .\DefenseClawSetup-Enterprise-Standalone-x64.exe
$sig.Status
if ($sig.SignerCertificate) {
  $sha = [Security.Cryptography.SHA256]::Create()
  [BitConverter]::ToString($sha.ComputeHash($sig.SignerCertificate.RawData)).Replace('-', '').ToLowerInvariant()
}

Valid means signed. NotSigned means a hash-pinned build, trusted by the hash you checked against checksums.txt. Hash-pinned files do not satisfy WDAC or AppLocker rules that require a publisher signature.

To allow them, use path rules for C:\Program Files\Cisco\DefenseClaw and C:\ProgramData\Cisco\DefenseClaw-ScannerRuntime, where Setup starts defenseclaw-scanners.exe. An AppLocker hash rule uses AppLocker's own file hash, not the SHA-256 in checksums.txt or the payload manifest. To use hash rules, build them after Setup installed the files and merge them into your policy:

$policy = 'C:\Program Files\Cisco\DefenseClaw', 'C:\ProgramData\Cisco\DefenseClaw-ScannerRuntime' |
  ForEach-Object { Get-AppLockerFileInformation -Directory $_ -Recurse -FileType Exe } |
  New-AppLockerPolicy -RuleType Hash -User Everyone -Xml
$policy | Out-File -Encoding utf8 "$env:TEMP\defenseclaw-applocker.xml"
Set-AppLockerPolicy -XmlPolicy "$env:TEMP\defenseclaw-applocker.xml" -Merge

The hashes change with every release, so build the rules again after each upgrade.

enterprise.trust in the config can only narrow what the entry point accepts: mode: authenticode refuses a hash-pinned run (1639), also over a deployment installed hash-pinned (Configuration).

Run the lifecycle from a payload folder

For your own build or re-signing pipeline, the lifecycle CLI can run from a folder with the payload files (defenseclaw.exe, defenseclaw-gateway.exe, defenseclaw-hook.exe, defenseclaw-hook-guard.exe, defenseclaw-acp.exe, defenseclaw-sensor-helper.exe, install-enterprise.ps1, DefenseClawEnterprise.psm1) with ensure --profile standalone --config <path> --json.

  • A folder without defenseclaw-hook-guard.exe is refused before anything changes, and so is a direct install or upgrade without --hook-guard-binary.
  • Unsigned files need --trust-mode hash_pinned --payload-manifest <file>: a JSON file {"schema_version":1,"files":{"<file name>":"<sha256>"}} that pins every unsigned file, including defenseclaw-scanners.exe.
  • The ...payload-manifest.json release asset has another format.

Otherwise use Setup.

Run Setup as LocalSystem

Recovery, purge and per-user cleanup need LocalSystem. An MDM already runs as LocalSystem (Intune install behavior System). Without an MDM, a one-time scheduled task gives LocalSystem.

Run Setup from the administrator-only staging folder, never from a folder a standard user can write: the task runs whatever file is at that path as SYSTEM.

Elevated PowerShell
if ((Get-Acl $Stage).GetOwner([Security.Principal.SecurityIdentifier]).Value -ne 'S-1-5-32-544') {
    throw "$Stage is not owned by Administrators; create it as in step 2"
}
Copy-Item .\DefenseClawSetup-Enterprise-Standalone-x64.exe $Stage
$Setup  = "$Stage\DefenseClawSetup-Enterprise-Standalone-x64.exe"
$Result = "$Stage\setup-as-system.json"
$Log    = "$Stage\setup-as-system.log"
$Task   = 'DefenseClaw Setup as SYSTEM'
$Action = New-ScheduledTaskAction -Execute "$env:SystemRoot\System32\cmd.exe" `
    -Argument "/d /c `"`"$Setup`" /ensure CONFIG=$Stage\config.yaml JSON=1 > `"$Result`" 2> `"$Log`"`""
Register-ScheduledTask -TaskName $Task -Action $Action -User 'NT AUTHORITY\SYSTEM' -RunLevel Highest -Force | Out-Null
Start-ScheduledTask -TaskName $Task
$Shown = 0
do {
    Start-Sleep -Seconds 5
    $Lines = @(Get-Content $Log -ErrorAction SilentlyContinue)
    $Lines | Select-Object -Skip $Shown
    $Shown = $Lines.Count
} while ((Get-ScheduledTask -TaskName $Task).State -in 'Queued', 'Running')
(Get-ScheduledTaskInfo -TaskName $Task).LastTaskResult
Unregister-ScheduledTask -TaskName $Task -Confirm:$false
Get-Content $Result

$Stage is the staging folder from step 2. LastTaskResult is Setup's exit code. For an uninstall, replace /ensure CONFIG=$Stage\config.yaml with /uninstall.

After the services are back, Setup prepares the scanner runtime. That takes seconds to a few minutes, at most 15. On timeout Setup fails with 1603 and scanner_runtime_unavailable: DefenseClaw runs, but watched assets that need a scan stay blocked until a /repair finishes the unpack. A burstable cloud VM out of CPU credits can reach the bound; run /repair JSON=1 as LocalSystem again when the computer has CPU to spare.

Recover a pending transaction

A lifecycle that fails normally rolls back. If the rollback cannot finish, the transaction stays pending: the result reports transaction_pending: true and names the services that stay stopped. status shows it and verify refuses until it is recovered.

While the gateway is stopped, users' agents block with enterprise_managed_gateway_not_running. Starting a service by hand does not recover it. Do not edit DefenseClaw files by hand.

Run Setup as LocalSystem

/ensure recovers the transaction, then installs or upgrades. /uninstall recovers it and removes the deployment. Use a SYSTEM task without an MDM.

As LocalSystem
DefenseClawSetup-Enterprise-Standalone-x64.exe /ensure CONFIG=C:\ProgramData\DefenseClaw-Staging\config.yaml JSON=1
DefenseClawSetup-Enterprise-Standalone-x64.exe /uninstall JSON=1

/repair also recovers it, but after a failed first install it stops with "run Install", so /ensure is the one-step command.

Read the result

ResultWhat to do
recovered_pending_transactionThe recovery restored the release that ran before the change. Run the newer Setup /ensure again
recovery_gateway_fallback, recovery_gateway_not_used, recovery_activation_deferredThe lifecycle retried the rollback with the gateway from the running Setup, or declined to (Recovery gateway refusal codes)
"module SHA-256 does not match the pinned payload manifest"An upgrade was cut off. Run that release's Setup /ensure (troubleshooting)
lifecycle_timeoutSetup already ran one recovery of up to 10 minutes. If the error names what is left (a purge or install-rollback intent), run the step above

Last resort: force the uninstall

If no recovery finishes, fix what its error names. Then remove the deployment without recovering the transaction, and install again:

As LocalSystem, last resort
DefenseClawSetup-Enterprise-Standalone-x64.exe /uninstall FORCE=1 JSON=1
DefenseClawSetup-Enterprise-Standalone-x64.exe /ensure CONFIG=C:\ProgramData\DefenseClaw-Staging\config.yaml JSON=1

FORCE=1 moves C:\ProgramData\Cisco\DefenseClaw aside, removes the services, C:\Program Files\Cisco\DefenseClaw and the machine-wide hook files, then deletes the moved folder (forced_uninstall; forced_state_root_kept if that fails). If a process holds a file open, Setup fails, moves everything back and restores the services. Keep C:\Windows\Logs\DefenseClaw\enterprise-lifecycle.log for support.

Recovery notes

Recovery gateway refusal codes

When the staged gateway fails a managed-hook step, recovery may rerun it with the gateway beside the running Setup. If recovery declines, the result has a recovery_gateway_not_used warning with one of these reasons, and the staged gateway's error stands:

ReasonMeaning
no_payloadNo gateway ships beside the running Setup
unsigned_scopeThe run is not a production run
not_local_systemThe lifecycle does not run as LocalSystem
inside_install_rootThe candidate is the installed payload
untrustedThe candidate fails the source or trust checks (an administrator-owned source on a local NTFS volume, and a valid signature or the pinned SHA-256)
same_binaryThe candidate is the staged gateway that already failed
version_unknownThe release of the candidate or of the staged gateway cannot be read
older_releaseThe candidate is older than the staged gateway

A failure about file permissions is reported in plain terms; the internal detail is in a lifecycle_diagnostic warning for support.

How the guardian ends a hold on the hook

A program can open the hook so that no one else can open it (a handle that shares nothing, or one that writes without sharing deletion). While that handle is open, no account can start the hook. A swap cannot end that, because Windows refuses to replace a file while a handle on it does not share deletion.

On a standalone install the guardian, which runs as SYSTEM, ends such a hold by closing that one handle in the process that owns it. The task-page summary is in A program that holds the hook open.

During an upgrade, Setup tests for a holder first, four times 100 ms apart, and asks Restart Manager only when every test finds a handle that does not share deletion. Restart Manager opens the file with no sharing for a short time the first time it is asked, so asking it first could make a hook start fail during an upgrade.

When it closes a handle

  • It waits for the second or third check. The hook must still refuse a start, and a test open for deletion, on two checks about 5 seconds apart, with a handle of the same program on both: the same process, or the same file object (a duplicated handle keeps it).
  • When the handle on the second check is in a different process of the same user (account and session), it waits for a third check.
  • The hook is free again 5 to 15 seconds after the hold starts, not at once.
  • A single read shorter than about 5 seconds is not closed. Several short reads in a row are closed only when the same program keeps the hook blocked across two checks, or the same user across three.

Which handle it closes

  • It closes only a handle on the hook's own file (same volume and file ID), with data or execute access, found without reading any name.
  • Windows does not show the sharing mode of one handle. So the guardian tests whether any handle on the file refuses deletion, closes one handle, tests again and stops when the hook can be started.
  • Handles that refer to the same file object are closed together, one file object at a time, the one with the fewest handles first (among objects with as many handles, the one with a handle that can write or append first).
  • It works on one user at a time, the user whose hold began first. It reaches a second user's handles only if that user also kept a handle on the hook across the same checks and the hook is still refused after the first user's are closed.
  • Because Windows does not show one handle's sharing, if that user has other handles on the hook, in the same process or another, on the same file object or another, the guardian can close one that was not the cause (a read handle that shares deletion) before it reaches the one that was. It closes no more than it needs to start the hook, and never in a service, protected or session 0 process.
  • A handle that its owner protected from being closed is named and skipped, and the user's other handles are still closed.

Processes it never touches

It never closes a handle in a protected process, in a process that runs as LocalSystem, LocalService, NetworkService or another service account, or in session 0. It closes handles only in the processes of a user who is signed in.

Windows does not show whose handle refuses the start, but its sharing rules say which file objects can. A start asks for read and execute and shares read and delete, so a file object can refuse it only if one of its handles can write or append, or if it is the only file object open on the hook.

  • A program of one of those other kinds that has the hook open on such an object may be what refuses the start. While it is there, the guardian closes no user's handle either: it logs and audits that program, names it and says why, and waits one check for a program of that kind it has only just seen.
  • If that program only has the hook open and a user's handle is what refuses the start, the hook stays unavailable until that program lets go. The exception: after one user's hold has lasted about 30 seconds, the guardian closes that user's handles once per streak, one file object at a time, to rule the program out, and the audit rows say so.
  • A program of that kind that only reads, beside another file object, cannot refuse a start. The guardian names it in a row with closed set to false and still closes the user's blockers.
  • If the program is what refuses the start, the hook stays unavailable until it lets go.
  • On Windows Server 2025 the guardian service does not get the address of a handle's file object, so it counts every handle as an object of its own. Two handles on one file object then look like two objects, and the audit rows and log lines say that the file object count counts handles there.

Audit rows

  • Every handle it closes writes a HIGH connector-hook-tampered audit row: the program's full path, process id, account (SID and name), session, the access the handle had, the hook's path, and how many candidate handles, processes and file objects it chose from.
  • A hold it did not end writes a row with the same action and closed set to false, also HIGH, because while that handle lives no hook start is allowed. The file is not changed and the process keeps running.
  • A row waits for the gateway: it is kept in memory and in a file in the guardian's state folder (at most 256 rows) and delivered in order once the gateway answers, so a gateway that is down delays the row, never the close.
  • A row the gateway refuses for good (HTTP 400, 413, 415 or 422, which describe a bad row) is dropped after 5 tries, with a log line, so the rows behind it still go out. A 401, 403, 404 or 405 is about the gateway, not the row, and the row stays queued.
  • A close that finishes after the guardian stopped waiting for it is audited when it finishes, with a sentence that says so. The guardian waits a quarter of a second for a call, and up to 2 seconds more for a close that has begun; until then its log says the handle "may have been closed", and the next check shows whether the hook is free.
  • A standalone uninstall removes the guardian's whole state folder, with or without PURGE=1, and the row file with it.

Limits

LimitWhat happens
A holder that re-opens the hookA holder that takes the handle again is closed again after 10 seconds, then 20, doubling to 5 minutes, with one audit row per holder until 10 minutes pass without a hold. A user who keeps re-opening the hook this way can keep it from starting for most of that time. That is a known limit of a hook image every user may start
Many handlesThe guardian closes at most 64 handles in one check. If the hook is still refused after 64, the next 64 are closed at a later check, after the wait above, so a user who duplicates the hook handle many times keeps the hook unavailable for longer
Very many open filesIf the processes that have the hook open hold more than about 2,000 file handles with data access between them, the guardian stops looking and closes none, and the hook stays unavailable until some of them are closed
Calls that do not answerA call on a handle that does not answer within a quarter of a second is given up on, and that handle is not closed. A user who keeps 24 such calls blocked can stop the guardian from looking for as long as they stay blocked, and the hook stays unavailable

The runtime files it watches

It watches the files a hook start reads, not only the hook:

  • The hook binary.
  • The regular files in C:\ProgramData\Cisco\DefenseClaw-HookRuntime with exactly these names, when they exist as regular files and not as links: machine-policy.json (the machine policy summary), .defenseclaw-hot-config-undo-closed (the closure marker), and in each of the antigravity, copilot, devin, hermes, kiro and opencode folders, enrollment.json and .defenseclaw-managed-runtime-selector.state. That is 14 files at most.

The guardian does not walk the folder. A lock file (.defenseclaw-enrollment.lock, .defenseclaw-managed-runtime-selector.lock), a .defenseclaw-policy-*.tmp temp file, a setup record or any other name is never watched. Setup and the command line hold those locks with no sharing for a whole transaction and the hook never opens them, so closing such a handle would break the lock or write a tamper row for DefenseClaw's own run. A file anywhere else is not watched, even if a program holds it.

  • In each check the hook binary comes first. The guardian then works on at most 4 held runtime files, and the next check starts where this one stopped, so a user who holds many of them cannot delay the binary; the other held files are handled at most 4 per check, so with N held files a given file can wait up to ceil(N/4) checks for its pass.
  • A hold of machine-policy.json fails every guarded call closed, because the hook cannot read it.
  • Each file has its own two checks, backoff, streak and audit rows, with the same bounds and the same refused-holder rules as the binary.
  • The hook reads these files with read access and every sharing allowed, so a hold is a handle that allows no reading and no deletion. There is no swap for a data file, only the bounded close. The audit row and the log line name the file.

Who can make such a hold

A standard user cannot make such a hold on Windows Server 2025. A FILE_SHARE_NONE open by an account with no write access to the file does not keep other programs from opening it. No file a hook start reads can be written by Users, so the holds this guardian ends come from administrator sessions, SYSTEM and service accounts. This holds only while the shipped file permissions are unchanged.

Holders that share deletion

A holder that shares deletion (a handle opened with FileShare.Delete) is swapped around instead of closed. The guardian swaps no more than every 10 seconds, doubling to 5 minutes, and stops while 8 backups are pending.

Review the audit log

Export the audit database from an elevated prompt, or as LocalSystem from an MDM script. The output file must not exist yet and takes the permissions of its folder, so write it where only administrators can read it. Omit --connector to export every row. Treat the export as sensitive: it can hold prompt and tool content.

Elevated Administrator prompt
$Stage = 'C:\ProgramData\DefenseClaw-Staging'   # administrator-only, from step 2
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' audit export --connector claudecode -o "$Stage\audit-claudecode.jsonl"

Standard accounts cannot read the managed audit log. The export also holds refusals:

RefusalRows
A hook call from an excluded or not yet enrolled accountA hook_decision row and a connector-hook row with action block, the account's SID and name, and reason enterprise_managed_sid_unregistered or enterprise_managed_enrollment_pending
A command defenseclaw.exe refuses an account (setup, upgrade, rollback, config set/unset, the guardrail writers, skill/mcp/plugin/tool block, allow, unblock, a standard account's enterprise windows and enterprise secret commands)An action row for the command with outcome=refused, the reason (managed_device, or elevation_required), the account's SID and name and the number of attempts. Arguments are never recorded

The gateway takes the account from the Windows token of the refused process. Repeated refusals of one account and agent (or command) are one row a minute.

Review AI Discovery

With ai_discovery.enabled: true, the gateway scans each user profile for AI agents, skills, MCP servers, plugins and running AI processes and sends the result to your observability destinations (AI Discovery). Read the inventory from an elevated prompt:

Elevated Administrator prompt
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows discovery
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows discovery --user <account> --json
  • --user takes the bare account name, COMPUTER\name, .\name, DOMAIN\name or the SID.
  • Each runtime finding is attributed to the account that runs it (process_owner, session or enrolled_profile). Anything else is attribution: unattributed and host-wide.
  • Destinations get ai_component.discovered, changed and removed records with the user but without the skill or MCP name. Read names with discovery --user <account> --json.
  • ai_discovery.runtime.acquisition is not available on Windows (config_schema_invalid), and enterprise.tetragon is accepted and ignored.

Agent sessions in WSL

An agent inside a WSL 2 distribution is outside every policy DefenseClaw publishes on Windows. The distribution has its own /etc/claude-code and ~/.codex, the user can open it as root, and Windows endpoint sensors do not see the WSL VM.

The standalone profile turns WSL sessions off where a vendor documents a control, and enterprise policy show and verify report the rest in a wsl row. Set the behavior under enterprise.machine_policy.windows_wsl (Configuration).

SurfaceWhat DefenseClaw does
Claude Desktop WSL sessionsAdds disableWslSessions (REG_SZ true) to HKLM\SOFTWARE\Policies\Claude only when the key already holds machine policy, and never changes an administrator's value. An administrator false or 0 turns WSL sessions on and fails verify unless agent_sessions: allow is set
wslInheritsWindowsSettingsDetected, never written. While WSL sessions are allowed it fails verify, because a WSL session would load a Windows hook command that cannot start inside Linux
Codex IDE extensionEvery guardian pass, as each enrolled user, resets chatgpt.runCodexInWindowsSubsystemForLinux: true to false in VS Code, VS Code Insiders and Cursor user settings. After 3 repairs for one account in an hour it only reports
Codex appReported only: there is no documented managed control
WSL itselfWith platform: disable, sets HKLM\SOFTWARE\Policies\WSL\AllowWSL=0, turning WSL off for every account. It never replaces an administrator value

Any value directly under HKLM\SOFTWARE\Policies\Claude makes Claude Desktop ignore HKCU policy, so DefenseClaw joins machine policy only when it already exists. With an empty key, Claude Desktop's own default applies, and the wsl row shows a pending line. To make the gate explicit, either:

  • add the output of enterprise policy export --connector wsl (reg, json or intune) to the Claude Desktop policy you deploy, or
  • set claude_desktop_key: create.

If claude_desktop_key: create is later removed (or the organization removes its own values), DefenseClaw keeps the disableWslSessions value it wrote, so WSL sessions stay off. The wsl row names it as DefenseClaw's own, or names a conflict when the value overrides HKCU policy or local configuration. Uninstall removes only values DefenseClaw wrote that are unchanged.

Limits:

  • The vendor documents only false and 0. Whether REG_SZ true forces the gate off is not documented: check Desktop's main.log for [wslPolicyGate] lines.
  • A running Claude Desktop WSL session continues; Desktop checks the value at each session start.
  • A user can turn the Codex extension setting back on until the next guardian pass, and workspace settings are not checked.
  • Agent CLIs a user runs inside the distribution are not covered. Only platform: disable closes WSL as a whole.
  • A Linux standalone install inside the distribution is refused (Linux requirements).