> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove AI Watch

> Remove AI Watch packages, profiles, scheduled tasks, and legacy script-based installs

Use this page when decommissioning AI Watch from a fleet or rolling back a test
deployment. If you are only migrating from the old script-based macOS Detect
rollout to the package, use
[Legacy macOS Detect Cleanup](https://docs.runlayer.com/shadow-ai/deploy/macos-cleanup-script-deployment.md).

The platform uninstallers remove Runlayer hook entries at uninstall time —
you do not need to change deployment settings or wait for hook reconciliation
first. The macOS uninstall package and the AI Watch 0.30.9+ Windows MSI both
sweep Runlayer hook entries from user and enterprise client configurations
while preserving third-party hooks, then remove the package itself. For a
staged decommission where hooks should stop fleet-wide before packages are
removed over time, see
[Disable hooks before uninstalling](#disable-hooks-before-uninstalling-optional).

> [tab] macOS
>
> **1. Prepare the deployment**
>
> In **Settings** → **Client Updates**, pin the currently deployed
> AI Watch version so hourly update checks are no-ops during removal.
> Unscope the device from the regular AI Watch installer assignment so
> your MDM cannot reinstall AI Watch.
>
> **2. Run the uninstall package**
>
> Deploy the signed and notarized `aiwatch-uninstall-<version>.pkg`
> from the AI Watch release as a one-time root/system package.
>
> The uninstall package is standalone and payload-free: it does not
> depend on the installed `aiwatch` binary, and its version is
> independent of the installed package version. The latest uninstall
> package removes any previously installed AI Watch version, including
> devices that are already broken or partially removed. It removes
> Runlayer hook entries across local users and enterprise locations
> while preserving third-party hooks, unloads the AI Watch launchd
> jobs, removes package-owned files and browser native-messaging
> hosts, resets the AI Watch TCC entry, and forgets both the AI Watch
> receipt and its own disposable receipt. Running `pkgutil --forget`
> by hand is not a substitute — it only forgets the installer receipt
> and removes nothing.
>
> > [!WARNING]
> >
> > The uninstall package deliberately leaves no receipt. Use a one-time
> > MDM assignment or your MDM's command result as the success signal,
> > then remove the assignment; a recurring receipt-based policy can
> > offer the package again.
>
> **3. Restart AI clients and browsers**
>
> Restart running AI clients and supported browsers on the device so
> they stop reading cached hook and extension policy. The uninstaller
> restarts the macOS preferences daemon first to evict stale policy from
> its cache. In particular, restart Firefox so it reloads its system
> preferences policy.
>
> **4. Unscope profiles**
>
> Keep the deployment profile assigned until the uninstall package
> reports success, then unscope it yourself:
>
> * Merged deployment profile: `com.runlayer.aiwatch`
>
> Fleets deployed before the profile consolidation ran three separate
> profiles instead — unscope all three:
>
> * Tenant configuration profile: `com.runlayer.aiwatch.config`
> * PPPC / Full Disk Access profile: `com.runlayer.aiwatch.pppc`
> * Login Items profile: `com.runlayer.aiwatch.loginitems`
>
> The uninstaller removes Runlayer-owned Chrome extension metadata and
> the Chrome and Edge per-extension policy files. It also strips only
> Runlayer entries from the runtime-written shared Chrome and Edge
> extension policy plists and the current and legacy Firefox policy
> plists, including the copied tenant credential. It does not remove configuration profiles. If a separate
> MDM browser policy also deploys the extension, remove that assignment
> through your MDM. Finally, restore your preferred **Client Updates**
> policy.
>
> **5. Verify removal**
>
> Spot-check that the package is gone:
>
> ```bash theme={null}
> ls /usr/local/bin/aiwatch /usr/local/lib/runlayer/aiwatch  # No such file or directory
> pkgutil --pkg-info com.runlayer.aiwatch                    # No receipt for ...
> launchctl print system/com.runlayer.aiwatch.bootstrap      # Could not find service
> launchctl print system/com.runlayer.aiwatch.update         # Could not find service
> ```
>
> Grok CLI, Devin CLI, Muse Code, and OpenCode cleanup is best effort: the uninstaller sweeps
> their standard hook paths, but custom or legacy layouts can remain.
> Check those clients manually.

> [tab] Windows
>
> **1. Prepare the deployment**
>
> In **Settings** → **Client Updates**, pin the currently deployed
> AI Watch version so hourly update checks are no-ops during removal.
> In Intune, remove or unassign the AI Watch app so it cannot be
> reinstalled.
>
> **2. Uninstall the MSI**
>
> The uninstall command is a standard MSI removal:
>
> ```powershell theme={null}
> msiexec /x aiwatch-<version>-win-x64.msi /qn /norestart
> ```
>
> Beginning with AI Watch 0.30.9, a true MSI uninstall removes residual
> Runlayer hook entries from user and enterprise client configurations
> while preserving third-party hooks. It runs this cleanup after
> unregistering the hidden `\Runlayer` Task Scheduler folder, so
> `AIWatchHooks` cannot recreate entries during removal. The MSI then
> stops and removes the `RunlayerAIWatch` service, removes
> `C:\Program Files\Runlayer\AIWatch\`, and clears managed values under
> `HKLM\Software\Runlayer\AIWatch`.
>
> Beginning with AI Watch 0.30.13, the uninstall also removes Runlayer's
> Chrome, Edge, and Firefox extension policy entries and tenant values
> while preserving other extensions' policy, then removes the browser
> native-messaging host registrations. This cleanup uses the installed
> `aiwatch.exe`; if the binary is damaged or missing, repair the MSI
> before uninstalling.
>
> MSIs older than 0.30.9 do not perform hook cleanup at uninstall
> time. Prefer upgrading once to 0.30.9 or later before uninstalling.
> If that is not possible, follow
> [Disable hooks before uninstalling](#disable-hooks-before-uninstalling-optional)
> and verify hook absence before removing the old MSI; if the binary
> is already gone, manually remove only Runlayer-owned hook entries
> and preserve every third-party entry.
>
> **3. Restart AI clients and browsers**
>
> Restart running AI clients and browsers on affected devices so they
> stop reading any cached hook configuration and extension policy.
>
> **4. Unscope profiles**
>
> There are no separate Intune Remediation assignments to remove. MDM
> profile unscoping remains your responsibility. The MSI removes only
> the browser policy that AI Watch wrote; if a separate Intune profile
> also deploys the Runlayer extension, remove that assignment through
> Intune. Finally, restore your preferred **Client Updates** policy.
>
> **5. Verify removal**
>
> Spot-check that the package is gone:
>
> ```powershell theme={null}
> Test-Path "C:\Program Files\Runlayer\AIWatch\aiwatch.exe"                # False
> Get-ItemProperty "HKLM:\Software\Runlayer\AIWatch" -ErrorAction SilentlyContinue   # no managed values
> Get-ScheduledTask -TaskPath "\Runlayer\" -ErrorAction SilentlyContinue   # no AIWatch* tasks
> Get-Service RunlayerAIWatch -ErrorAction SilentlyContinue                # nothing
> ```
>
> Grok CLI, Devin CLI, Muse Code, and OpenCode cleanup is best effort: the uninstaller sweeps
> their standard hook paths, but custom or legacy layouts can remain.
> Check those clients manually.

## macOS retained state and exceptions

The standalone macOS uninstaller removes current Runlayer hook entries; it is
not a snapshot restore of every setting that existed before installation.

It deliberately retains:

* `~/.runlayer` logs, scan cache and state, device identity, enrollment
  markers, and the scan lock because this directory can be shared with the
  full Runlayer CLI
* `runlayer-aiwatch` items in each user's login keychain because a root
  installer cannot purge another user's login keychain
* `/Library/Logs/Runlayer/aiwatch-uninstall.log`, which records the result of
  each cleanup phase
* empty shared client settings files and parent directories, including
  `~/.claude/settings.json`, `~/.qwen/settings.json`,
  `~/.config/devin/config.json`, and `~/.config/muse/settings.json`
* OpenCode's own files in `~/.config/opencode`, such as `package.json` and
  `node_modules`; only the Runlayer plugin, `plugins/runlayer-aiwatch.js`, is
  deleted

To remove an AI Watch credential too, run the following as each affected user.
Repeat it if the user has credentials for more than one Runlayer host:

```bash theme={null}
security delete-generic-password -s runlayer-aiwatch
```

The cleanup also has these retained-state exceptions:

* VS Code Claude hook-location values set to `false` are removed rather than
  restored to an earlier value.
* Codex `features.hooks` and Gemini `hooksConfig.enabled` remain at their
  current values because other hooks may depend on them.
* Rewritten JSONC files preserve configuration semantics, but lose comments
  and original formatting.
* Managed `GrokHome` locations are swept. Per-user shell overrides such as
  `GROK_HOME`, `QWEN_HOME`, `COPILOT_HOME`, and `XDG_CONFIG_HOME` are not discoverable by the
  root uninstaller and must be checked manually.

Hook entries do not record whether AI Watch or the separately installed
Runlayer CLI created them. The uninstaller therefore removes both `aiwatch
hook` and `runlayer hook` forms. If the full CLI should keep its hooks, run
`runlayer setup hooks --install` again after removing AI Watch.

> [!WARNING]
>
> The macOS uninstall package always exits successfully so it is safe to run as
> an MDM package postinstall. Check
> `/Library/Logs/Runlayer/aiwatch-uninstall.log` for any phase marked `failed`;
> the package result alone does not prove that every user home was reachable.

## Disable hooks before uninstalling (optional)

For a staged decommission — hooks off across the fleet now, packages removed
over the following days — or for Windows fleets stuck on MSIs older than
0.30.9, switch the deployment to Detect-only while AI Watch is still
installed. Its own reconciler then removes Runlayer hook entries on its
normal 15-minute schedule while preserving third-party hooks.

Under **Settings** → **AI Watch** → **Manage settings**, set Mode to Monitor,
Sessions off, and **Track MCP tool usage without content** off. For older or
offline clients, also push the same fallback values through your MDM:

```xml macOS configuration profile theme={null}
<key>Mode</key>
<string>monitor</string>
<key>Enforcement</key>
<false/>
<key>Sessions</key>
<false/>
```

```powershell Windows registry (Intune script) theme={null}
New-Item -Path "HKLM:\Software\Runlayer\AIWatch" -Force | Out-Null
New-ItemProperty -Path "HKLM:\Software\Runlayer\AIWatch" -Name "Mode" -Value "monitor" -PropertyType String -Force | Out-Null
New-ItemProperty -Path "HKLM:\Software\Runlayer\AIWatch" -Name "Enforcement" -Value 0 -PropertyType DWord -Force | Out-Null
New-ItemProperty -Path "HKLM:\Software\Runlayer\AIWatch" -Name "Sessions" -Value 0 -PropertyType DWord -Force | Out-Null
```

Keep the AI Watch package and configuration profile assigned while devices
reconcile. To force reconciliation on a device immediately, run
`aiwatch setup hooks install --mdm` as root (macOS,
`/usr/local/bin/aiwatch`) or SYSTEM (Windows,
`C:\Program Files\Runlayer\AIWatch\aiwatch.exe`), then confirm with
`aiwatch setup hooks check --mdm` — exit `0` means the device is compliant
with the Detect-only hook state.

> [!WARNING]
>
> Devices pick up the new Mode and Sessions settings on their next settings
> sync. A device that is offline, asleep, or unenrolled keeps its old hooks
> until it next reaches your Runlayer instance — do not assume the fleet has
> reconciled just because you changed the settings. Verify per device with
> `aiwatch setup hooks check --mdm` (exit `0`).

## Legacy script-based installs

The uninstall package also retires the original script-based macOS Detect
rollout on the device: it boots out every user's `com.runlayer.scan`
LaunchAgent and removes its plist and the `/usr/local/bin/runlayer-scan`
wrapper. It does not remove the legacy MDM script or `com.runlayer.scan.pppc`
profile, revoke the legacy org API key, or touch the uv-installed CLI. For
those, follow
[Legacy macOS Detect Cleanup](https://docs.runlayer.com/shadow-ai/deploy/macos-cleanup-script-deployment.md).

For custom Windows script or hand-rolled Scheduled Task deployments, remove
the MDM script or task assignment, then remove any custom task, script, or
log paths your deployment created. The packaged MSI registers its own tasks
under the `\Runlayer` Task Scheduler folder and removes them on uninstall, so
this section only applies to bespoke deployments you built yourself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.