> ## 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.

# Troubleshooting

> Common issues and solutions for AI Watch package, endpoint modes, and Sessions deployments

## Authentication and Configuration

Package-based AI Watch uses one organization API key for scans, hooks, sessions, and managed updates on every supported platform. The installed `aiwatch` binary reads it from the macOS Configuration Profile (`OrgApiKey`), the Windows MSI property (`AIWATCH_ORG_API_KEY`), or Linux's root-only `/etc/runlayer/aiwatch/credentials` file (`RUNLAYER_API_KEY`).

| HTTP Status | Error | Cause | Resolution |
| - | - | - | - |
| 401 | Missing or invalid API key | The key is missing from managed config, malformed, or has been revoked/rotated | Verify `OrgApiKey` (macOS) / `OrgApiKey` (Windows) is present and current in the AI Watch configuration; if it was rotated, regenerate the configuration from **Settings → MDM configuration** and re-push |
| 403 | Valid key, wrong scope | The organization API key lacks the **Shadow AI Scan** role or is being used for a different API operation | Regenerate the AI Watch configuration from **Settings → MDM configuration**. The wizard creates a key that can submit AI Watch data and download managed updates, but cannot read tenant data, change settings or policies, or act as a user |
| 500 | Server error | Internal server issue | Contact Runlayer support |

Manual `runlayer scan` workflows can still use interactive login credentials or a stored organization API key. Legacy enrollment keys only apply to older non-package auto-provisioning flows.

The AI Watch organization API key is tenant-scoped: it is not tied to a user,
cannot impersonate one, and does not grant dashboard or policy access. In
Runlayer it is stored only as a one-way hash — the plaintext is shown once at
creation and cannot be retrieved later, so if it is lost, regenerate the
configuration to mint a new one.

## Hook behavior when a device's credentials are rejected

A hook verifies each action with the Runlayer API. When the API answers **HTTP 401**, this device's credentials were rejected — a revoked or rotated organization API key, or a per-user login that is no longer valid. The API was reachable, so this is not an outage. What the hook does next depends on the device's effective Mode:

| Mode | HTTP 401 (credentials rejected) | Other HTTP error (403, 429, 5xx, …) | Runlayer API unreachable (network) |
| - | - | - | - |
| **Monitor** | Allows. Monitoring is offline for this device; Claude Code users see a one-line notice once an hour; the hook stops re-verifying for 5 minutes, then retries | Allows silently | Allows silently |
| **Protect** | Allows the MCP call (fail open); the content scan for supported tools still blocks (fail closed) | Same as 401 | Same as 401 |
| **Enforce** | Blocks with a message that names the device hostname and who can fix it — the administrator via **Settings → MDM configuration** for an org key, `runlayer login` for a user key (fail closed) | Blocks with a message naming the HTTP status (fail closed) | Blocks with a message describing the connection failure (fail closed) |

The Monitor notice reads: *Runlayer monitoring is offline on this device (credentials rejected). Nothing is blocked. Ask your Runlayer administrator to re-push the AI Watch configuration.* Clients whose hook contract has no user-message channel on an allow (for example Cursor) allow silently. The 5-minute pause applies to Monitor only and to the rejected credential only — Enforce re-verifies every call, and a re-minted key takes effect immediately in every mode.

A 403 is deliberately not treated as a credential rejection: corporate proxies and WAFs answer 403 per request, so it gets the generic HTTP-error handling above. See the [authentication table](#authentication-and-configuration) for what a 403 from the Runlayer API itself means.

**What the administrator should do**

1. Open **Settings → MDM configuration** to identify the revoked organization API key, and check [Audit Logs](https://docs.runlayer.com/platform-audit-logs.md) for `auth_failed` entries. There is no per-device marker: a device on a revoked key is not flagged in **Shadow AI → Devices**; it stops reporting and goes stale like any other silent device. The Enforce block message quotes the device hostname, so a helpdesk ticket can name the exact device.
2. Re-deploy a current configuration to the affected devices: regenerate it from **Settings → MDM configuration** and re-push it. Deleting an MDM configuration revokes its organization API key, so every device still carrying that key is rejected until it receives the new one.
3. After the new key lands, hooks recover on their own: Enforce on the next tool call, Monitor within 5 minutes.

On a device that uses an organization API key, nothing local fixes the rejection — `runlayer login` and retries do not replace an MDM-provisioned credential. On a device without an organization key (a per-user `runlayer login` install), the Enforce message tells the user to run `runlayer login` again.

## Built-in diagnostic commands

AI Watch packages ship a small set of operator commands that cover most on-device checks. Use the installed binary path: `/usr/local/bin/aiwatch` on macOS, `C:\Program Files\Runlayer\AIWatch\aiwatch.exe` on Windows.

| Command | What it does | Privileges |
| - | - | - |
| `aiwatch config show [--json]` | Prints the resolved managed configuration (secrets redacted) and whether a valid settings snapshot is cached (`valid`, `rejected`, `missing`, or `unverified`) | None |
| `aiwatch config sync` | Runs the settings sync and hook reconcile immediately instead of waiting for the next 15-minute tick | `sudo` on macOS; none on Windows |
| `aiwatch update-now` | Starts the managed self-update cycle immediately | `sudo` on macOS and Linux; elevated prompt on Windows |
| `aiwatch daemon status` | Reports whether the hook daemon is running and healthy for the current user | None |

`aiwatch config show` is the fastest way to answer "what settings is this device actually using?" — it shows the effective Mode, Sessions, and detection options after the settings sync, plus the tenant host and each key shown the way the dashboard displays it (org API keys as a prefix like `rl_org_Ab1C2d3...`, enrollment keys as prefix plus last four characters), so you can confirm which key a device is using.

## Interpreting Discovery Results

> [accordion] User appears in the Shadow report for MCP servers they say they never used
>
> **Cause:** Detect classifies based on **MCP config files found on disk**, not actual tool calls. A user being attributed to a shadow MCP means a matching config was found on a device whose login username resolved to that user — not that they ever invoked any tool from the server.
>
> Common reasons a config gets attributed to a user who never used it:
>
> * **Project-level config in a cloned repo.** A `.cursor/mcp.json`, `.vscode/mcp.json`, `.mcp.json`, `.codex/config.toml`, or similar checked into a shared repo is discovered on every developer who clones it. The config is attributed to the OS user who ran the scan on that machine.
> * **Stale or experimental config.** The user added the server to a client config file once (e.g. trying it out, copy-pasting from a blog), never invoked it, and forgot it was still there.
> * **Shared device.** Another OS account on the same workstation configured the MCP, but the scan ran under a different OS account that resolves to this Runlayer user.
> * **Username resolution mismatch.** Username matching can link a device's OS username to the wrong Runlayer user. See [User and Identity Mapping](https://docs.runlayer.com/shadow-ai/identity-mapping.md), then fix via **Settings → User mapping** and [re-analyze](https://docs.runlayer.com/shadow-ai/re-analyzing.md).
>
> **How the user (or admin) can verify the source themselves:**
>
> 1. Click the shadow artifact row on the **Shadow AI** page's **Details** tab to open the detail drawer.
> 2. The detail includes the **device hostname**, **device id**, the MCP server's `command` / `args` / `url`, and any **project paths** where the config was found.
> 3. If a project path is listed, the discovery came from a project-level config file. Open that repo and inspect the checked-in MCP config to confirm.
> 4. If no project path is listed, the discovery came from a global client config. On the listed device, inspect the relevant client config (e.g. `~/Library/Application Support/Claude/claude_desktop_config.json`, `~/.cursor/mcp.json`, `~/.codex/config.toml`).
> 5. To clear the discovery, remove the entry from the offending config file (or uninstall the project) and the next scan will drop it from the inventory.

> [accordion] A skill is flagged High or Medium risk but is legitimate
>
> **Cause:** Detect assigns each discovered skill a risk level (High, Medium, Low, Minimal) by analyzing the skill's instructions for risky patterns — prompt-injection phrasing, data-exfiltration, or unsafe-automation language. The risk level is a heuristic signal for triage, **not** a verdict that the skill is malicious. A legitimate internal skill can score High or Medium if its instructions resemble those patterns (for example, a sanctioned skill that reads files and posts to an API).
>
> **What to do:**
>
> 1. Open the skill's row in **Shadow AI → Skills** to read the analyzed instructions and see why it was flagged.
> 2. If the skill is sanctioned, bring it under management by publishing it through Runlayer — managed skills are classified **Managed** instead of **Shadow**. See [Responding to Discoveries](https://docs.runlayer.com/shadow-ai/responding-to-discoveries.md).
> 3. After the skill's content or management status changes, [re-analyze](https://docs.runlayer.com/shadow-ai/re-analyzing.md) to refresh its classification and risk level.
>
> Detect does not block skills — risk levels are for inventory and review only. Scanner Block/Mask actions and source governance apply to tool calls through [Protect or Enforce](https://docs.runlayer.com/shadow-ai/enforce.md).

## Package Issues

> [accordion] No devices appearing on the Shadow AI page
>
> **Quick fixes:**
>
> 1. Confirm the package is installed:
>    ```bash theme={null}
>    test -x /usr/local/bin/aiwatch && echo "macOS aiwatch installed"
>    ```
>    ```powershell theme={null}
>    Test-Path "C:\Program Files\Runlayer\AIWatch\aiwatch.exe"
>    ```
> 2. Confirm managed configuration is present:
>    ```bash theme={null}
>    defaults read /Library/Managed\ Preferences/com.runlayer.aiwatch.plist
>    ```
>    ```powershell theme={null}
>    Get-ItemProperty "HKLM:\Software\Runlayer\AIWatch"
>    ```
> 3. Trigger one scan manually from the device:
>    ```bash theme={null}
>    /usr/local/bin/aiwatch scan
>    ```
>    ```powershell theme={null}
>    & "C:\Program Files\Runlayer\AIWatch\aiwatch.exe" scan
>    ```
> 4. Confirm network connectivity from the device to your Runlayer host.

> [accordion] macOS scan agent is not running
>
> **Quick fixes:**
>
> 1. Confirm the bundled LaunchAgent exists:
>    ```bash theme={null}
>    test -f /Library/LaunchAgents/com.runlayer.aiwatch.plist
>    ```
> 2. Check whether launchd loaded it for the logged-in user:
>    ```bash theme={null}
>    launchctl print "gui/$(id -u)/com.runlayer.aiwatch"
>    ```
> 3. Kickstart it once:
>    ```bash theme={null}
>    launchctl kickstart -k "gui/$(id -u)/com.runlayer.aiwatch"
>    ```
> 4. Inspect the unified log:
>    ```bash theme={null}
>    log show --predicate 'process == "aiwatch"' --last 1h
>    ```

> [accordion] `aiwatch: host not configured` on macOS
>
> **Cause:** The AI Watch Configuration Profile has not synced yet, or it did not write `Host` / `OrgApiKey` into managed preferences.
>
> **Resolution:**
>
> 1. Check managed preferences:
>    ```bash theme={null}
>    defaults read /Library/Managed\ Preferences/com.runlayer.aiwatch.plist
>    ```
> 2. If the file is empty or missing, force an MDM sync from the device or wait for the next check-in.
> 3. Confirm the profile targets the same device group as the `.pkg`.

> [accordion] log show --predicate 'process == "aiwatch"' returns nothing
>
> **Cause:** The LaunchAgent has not loaded, no scan has run yet, or unified log history has already rolled off.
>
> **Resolution:**
>
> 1. Check whether launchd loaded the agent for the logged-in user:
>    ```bash theme={null}
>    launchctl print "gui/$(id -u)/com.runlayer.aiwatch"
>    ```
> 2. If launchd returns `Could not find service`, re-deploy the `.pkg`; the postinstall may not have bootstrapped the agent.
> 3. If the agent is loaded, wait one `StartInterval` tick (default 15 minutes) or seed output with:
>    ```bash theme={null}
>    /usr/local/bin/aiwatch scan
>    ```
> 4. For durable logs, collect unified logs with `log collect` or forward them to your SIEM. macOS retains unified logs for roughly 24 hours to a few days depending on device log volume.

> [accordion] Users see 'Background Item Added' notification on first login after install
>
> **Cause:** The Login Items payload has not applied yet, or the device is running macOS older than 13 where the payload is ignored harmlessly.
>
> **Resolution:**
>
> 1. Confirm `com.runlayer.aiwatch.mobileconfig` (which carries the Login Items payload; `com.runlayer.aiwatch.loginitems.mobileconfig` on fleets still running the older split profiles) is deployed to the device.
> 2. After MDM sync, verify Background Task Management state:
>    ```bash theme={null}
>    sfltool dumpbtm | grep -i runlayer
>    ```
> 3. Expect the agent to show `Disposition: enabled allowed visible`.

> [accordion] AI Watch background items show 'disallowed' or 'cannot be launched because of BTM policy'
>
> **Cause:** The deployed profile predates the current Login Items rule. Earlier profiles matched by `BundleIdentifier` `com.runlayer.aiwatch`, which never matches the AI Watch LaunchAgents and LaunchDaemons because they don't run from an app bundle. Background Task Management then blocks them: `sfltool dumpbtm` shows every Runlayer item as `disallowed`, the scan agents log "Service cannot be launched because of BTM policy", and the bootstrap daemon doesn't start at boot.
>
> **Resolution:**
>
> 1. Download the current `com.runlayer.aiwatch.mobileconfig` (or `com.runlayer.aiwatch.ws1.mobileconfig`) from **Settings → MDM configuration** and re-deploy it. Installed profiles don't update on their own.
> 2. If you manage Login Items in your own MDM payload instead, replace the rule with:
>    ```xml theme={null}
>    <dict>
>        <key>RuleType</key>
>        <string>TeamIdentifier</string>
>        <key>RuleValue</key>
>        <string>AF2M8HC7A2</string>
>    </dict>
>    ```
> 3. After MDM sync, confirm every Runlayer item shows `allowed`:
>    ```bash theme={null}
>    sfltool dumpbtm | grep -i -C8 runlayer
>    ```

> [accordion] AI Watch bootstrap daemon not loaded after reboot
>
> **Symptoms:** After a restart, hooks and the browser extension's tenant settings stay missing until someone reinstalls the `.pkg` or your MDM runs a Runlayer item, and this returns `Could not find service`:
>
> ```bash theme={null}
> sudo launchctl print system/com.runlayer.aiwatch.bootstrap
> ```
>
> **Cause:** Only the `.pkg` installer loads the bootstrap and update daemons directly; after that, macOS loads them at boot. If Background Task Management blocks them, they stay unloaded after every restart. A file-presence audit script still passes, so your MDM never reinstalls the package.
>
> **Resolution:**
>
> 1. Check whether macOS blocks the Runlayer items:
>    ```bash theme={null}
>    sfltool dumpbtm | grep -i -C8 runlayer
>    ```
>    If they show `disallowed`, fix the Login Items rule first (see **AI Watch background items show 'disallowed'** above).
> 2. Load the daemon now:
>    ```bash theme={null}
>    sudo launchctl bootstrap system /Library/LaunchDaemons/com.runlayer.aiwatch.bootstrap.plist
>    ```
> 3. Add the `launchctl print` checks from the [Iru / Kandji](https://docs.runlayer.com/shadow-ai/deploy/kandji.md) audit script to your MDM's audit or detection script, so a device with an unloaded daemon fails the audit and your MDM reinstalls the `.pkg`.

> [accordion] macOS package blocked by Gatekeeper
>
> **Cause:** The `.pkg` is not signed, not notarized, or is not the official signed AI Watch package from Runlayer.
>
> **Resolution:**
>
> 1. Verify the package signature and notarization:
>    ```bash theme={null}
>    pkgutil --check-signature /path/to/aiwatch-<version>-macos-arm64.pkg
>    spctl --assess --type install -vv /path/to/aiwatch-<version>-macos-arm64.pkg
>    ```
> 2. Expected output includes `status: signed by a developer certificate issued by Apple` and `source=Notarized Developer ID`.
> 3. Official packages downloaded from **Settings → MDM configuration** are signed and notarized by Anysource Inc. with Developer ID team `AF2M8HC7A2`.

> [accordion] Windows scans are not running
>
> Scans run from device-local Scheduled Tasks the MSI registers — there are no Intune Remediations to check.
>
> **Quick fixes:**
>
> 1. Confirm the app installed `aiwatch.exe` under `C:\Program Files\Runlayer\AIWatch\`.
> 2. Confirm the hidden `\Runlayer` task folder and the `AIWatchScan` task exist:
>    ```powershell theme={null}
>    Get-ScheduledTask -TaskPath "\Runlayer\" | Format-Table TaskName, State
>    ```
>    The task-registration action gates on the `OrgApiKey` registry value — if there are no tasks, confirm `Get-ItemProperty "HKLM:\Software\Runlayer\AIWatch"` shows `OrgApiKey`, then repair/reinstall the app.
> 3. Check the `AIWatchScan` task's last result and the per-profile scan outcomes. The single SYSTEM task runs `aiwatch.exe scan --all-users` and scans each real profile in a child process; a never-signed-in user has no profile yet and is picked up on the next tick (logon / boot / 15 min):
>    ```powershell theme={null}
>    Get-ScheduledTaskInfo -TaskPath "\Runlayer\" -TaskName "AIWatchScan" | Select-Object LastRunTime, LastTaskResult
>    # Orchestrator summary (all_users_scan_complete) + per-profile all_users_profile_scan_* lines:
>    Get-Content "C:\ProgramData\Runlayer\Logs\scheduled-task.log" -Tail 40
>    # Detailed per-profile child-scan output lives in each scanned user's profile:
>    #   C:\Users\<username>\.runlayer\logs
>    ```
> 4. Check the task-registration lines (tagged `[register]`) in `C:\ProgramData\Runlayer\Logs\scheduled-task.log`.
> 5. Run a one-off scan as the logged-in user:
>    ```powershell theme={null}
>    & "C:\Program Files\Runlayer\AIWatch\aiwatch.exe" scan
>    ```

> [accordion] Hook configs are not installed or drifted
>
> **Quick fixes:**
>
> 1. Confirm Mode is Protect/Enforce, Sessions is enabled, or **Track MCP tool usage without content** is enabled. Monitor with Sessions disabled and that setting off is Detect-only and installs no hooks.
> 2. Check hook config compliance:
>    ```bash theme={null}
>    /usr/local/bin/aiwatch setup hooks check --mdm
>    ```
>    ```powershell theme={null}
>    & "C:\Program Files\Runlayer\AIWatch\aiwatch.exe" setup hooks check --mdm
>    ```
> 3. On macOS, confirm the bootstrap daemon is loaded:
>    ```bash theme={null}
>    sudo launchctl print system/com.runlayer.aiwatch.bootstrap
>    ```
> 4. On Windows, confirm the device-local `AIWatchHooks` task (SYSTEM) is running: `Get-ScheduledTaskInfo -TaskPath "\Runlayer\" -TaskName "AIWatchHooks" | Select-Object LastRunTime, LastTaskResult`. Force a run with `Start-ScheduledTask -TaskPath "\Runlayer\" -TaskName "AIWatchHooks"`, or repair/reinstall the app if it's missing.
> 5. For OpenCode, `runlayer-aiwatch.js is not a Runlayer plugin` means another file already uses the Runlayer plugin's name in `~/.config/opencode/plugins`. Move that file aside; the next reconcile installs the plugin.
> 6. Restart the AI client after hook configs change — Cursor, VS Code, Claude Code, GitHub Copilot CLI, Gemini CLI, Grok CLI, Cline CLI, Devin CLI, Muse Code, OpenCode, Codex, Qwen Code, Hermes, Windsurf, and Goose all read hook configs only at process start.

> [accordion] Hooks are installed but not blocking
>
> **Quick fixes:**
>
> 1. Confirm the deployment's effective settings with `aiwatch config show` — it prints the resolved Mode, Sessions, and detection options, and whether a valid settings snapshot is cached. To inspect the raw snapshot instead:
>    ```bash theme={null}
>    sudo cat /var/db/com.runlayer.aiwatch/backend-config.json
>    ```
>    ```powershell theme={null}
>    (Get-ItemProperty "HKLM:\Software\Runlayer\AIWatch").BackendConfig
>    ```
> 2. `Mode=monitor` is report-only. Protect applies scanner decisions plus fail-open, allow-unless-denied MCP source governance. Enforce adds local-tool controls and fail-closed, deny-by-default MCP source governance, while managed MCP calls scan at the gateway.
> 3. Check whether the "missed" call was allowed by policy rather than missed by the hook:
>    * The user is on the exemption list under **Settings** → **Tool governance** → **Exempt users**. Exempted users' violations are still recorded and alerted, but the call proceeds.
>    * The MCP server is managed through Runlayer or matches an allowlist entry, so source governance allows it by design.
>    * For built-in tool blocking, the tool's behavior type (shell/terminal, file read, file write) is not toggled on in the Enforce policy — types you have not enabled are allowed by default.
>    * The matching scanner's action is **Alert** rather than **Block**, which records a finding without stopping the call.
> 4. Change Mode from **Settings** → **AI Watch** → **Manage settings**, then wait for the next 15-minute hook reconcile or run `aiwatch config sync` to apply it immediately. Re-push MDM policy only when changing the fallback or another MDM-owned value.
> 5. For OpenCode, check how it was started: `opencode --pure` and `OPENCODE_PURE=1` skip every plugin, including Runlayer's, and the hook cannot report that.
> 6. Restart the AI client so it reloads hook config.

> [accordion] Device shows healthy but the user says their sessions never arrive
>
> On a managed device, AI Watch hooks and check-ins always report to the host in the MDM configuration. A user who ran `runlayer login --host <other-host>` (a staging tenant, a sandbox, an old tenant) only changed where their *interactive* `runlayer` commands go — hook traffic stays on the managed host. Their sessions are arriving, just in the tenant the administrator provisioned, not the one they logged into.
>
> **How it shows up:**
>
> * **Shadow AI → Devices** shows a **Login host differs** badge next to the device, and the device drawer's **Hook host** section lists the managed host, the user's login host, and when this was last observed. The badge appears only for devices whose `runlayer` CLI hooks actually fired with a differing login host, and clears within a day of the two hosts agreeing again.
> * Claude Code users see a one-line notice once an hour: *This device is managed by Runlayer: AI Watch hooks report to `<managed host>`, not your `runlayer login` host `<login host>`.* Clients without a user-message channel on an allow (for example Cursor) stay silent.
> * `runlayer login` prints the same note at the end when the login host differs from the managed host.
>
> **Quick fixes:**
>
> 1. If the user should be working against the managed tenant, have them run `runlayer login --host <managed host>` (or `runlayer logout`). The badge clears on the next scan after their hooks see the two hosts agree.
> 2. If the user legitimately needs a second tenant for interactive commands, nothing is broken: leave the login as is and treat the badge as informational. Hooks cannot be pointed at a per-user host on a managed device.
> 3. Devices whose hooks are wired only to the `aiwatch` binary never show this: `aiwatch` does not read `~/.runlayer/config.yaml` at all.

> [accordion] The browser extension does not appear in Chrome, Edge, or Firefox
>
> **Symptoms:** **Install browser extension** is enabled in **Manage settings → Browser extension**, but the Runlayer extension is missing from `chrome://extensions`, `edge://extensions`, or `about:addons`.
>
> **Resolution:**
>
> 1. The extension is installed by the 15-minute hook reconcile. Rerun it immediately as an administrator instead of waiting:
>    ```bash theme={null}
>    sudo aiwatch config sync
>    ```
>    ```powershell theme={null}
>    & "C:\Program Files\Runlayer\AIWatch\aiwatch.exe" config sync
>    ```
> 2. Fully quit and reopen the browser — Chrome, Edge, and Firefox apply managed extension policy at startup.
> 3. Confirm the device runs a supported AI Watch version and appears in **Shadow AI → Devices**: `0.29.6` or newer for Chrome and Firefox on macOS, or `0.30.13` or newer for Edge and for Windows devices.
> 4. For Chrome or Edge, confirm the device meets the [browser requirements](https://docs.runlayer.com/shadow-ai/browser-extension.md#browser-requirements). In Edge, a personal Microsoft account profile on a managed device may not receive the extension.
> 5. See [Browser extension](https://docs.runlayer.com/shadow-ai/browser-extension.md#troubleshooting) for session-collection and blocking issues once the extension is installed.

> [accordion] Scan or hook fails behind a corporate TLS inspection proxy
>
> **Symptoms:** The scan discovers local config, then fails while submitting results:
>
> ```text theme={null}
> Submitting 9 servers from 9 configs (1 global, 8 project)...
> Scan failed: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
> ```
>
> **Cause:** Some enterprise proxies intercept HTTPS and re-sign traffic with a private root CA. The Runlayer CLI and packaged `aiwatch` binary trust the OS trust store automatically, but scans and hooks can fail if that private CA is not installed in system trust.
>
> **Resolution:**
>
> 1. Prefer installing the corporate root CA into the OS trust store through MDM.
> 2. For debugging or one-off deployments, pass a PEM bundle explicitly:
>    ```bash theme={null}
>    runlayer --ca-bundle /path/to/corporate-ca.pem scan
>    ```
> 3. For custom CLI workflows, set `RUNLAYER_CA_BUNDLE`. The CLI also honors `SSL_CERT_FILE` and `REQUESTS_CA_BUNDLE` as fallbacks.
> 4. Ask the security team to exempt the Runlayer tenant hostname from TLS inspection, such as `*.runlayer.com` or customer-managed hostnames like `runlayer.dev.company.com` just like they do for other security products like endpoint detection and response (EDR).

> [accordion] runlayer: command not found after install
>
> **Cause:** `uv tool install runlayer` places the binary in `~/.local/bin` (macOS/Linux) or `%USERPROFILE%\.local\bin` (Windows), which may not be in your shell's PATH yet.
>
> **Resolution:**
>
> 1. Restart your terminal (new shells pick up the updated PATH)
> 2. Or run `uv tool update-shell` to add `~/.local/bin` to your shell profile, then `exec $SHELL -l` (or open a new terminal)
> 3. Verify: `which runlayer` (macOS/Linux) or `where runlayer` (Windows)

> [accordion] Users see macOS consent dialogs for AI Watch
>
> **Symptoms:** Users are prompted with macOS permission dialogs asking to grant access to `aiwatch` for directories like Desktop, Documents, or Downloads.
>
> **Cause:** The AI Watch PPPC payload was not deployed before the package ran, so macOS falls back to interactive consent prompts. This can also happen if a device is not enrolled via User-Approved MDM or Automated Device Enrollment.
>
> **Resolution:**
>
> 1. Deploy `com.runlayer.aiwatch.mobileconfig` (which carries the PPPC payload; `com.runlayer.aiwatch.pppc.mobileconfig` on fleets still running the older split profiles) via your MDM.
> 2. Re-deploying the profile restores access even if a user clicked "Don't Allow".
> 3. Ensure devices are enrolled via User-Approved MDM or Automated Device Enrollment (required for MDM-managed PPPC profiles to take effect)
> 4. Verify the profile is installed:
>    ```bash theme={null}
>    profiles show -type configuration | grep -i aiwatch
>    ```
> 5. Re-run the scan after the profile is applied

> [accordion] Scan finds fewer MCP servers than expected on macOS
>
> **Symptoms:** Scan completes successfully but doesn't find MCP servers you know exist in directories like Desktop, Documents, or Application Support.
>
> **Cause:** macOS TCC (Transparency, Consent, and Control) is blocking access to protected directories.
>
> **Resolution:**
>
> 1. Deploy the AI Watch PPPC profile to grant Full Disk Access to `/usr/local/lib/runlayer/aiwatch/aiwatch`.
> 2. Ensure devices are enrolled via User-Approved MDM or Automated Device Enrollment
> 3. Verify the profile is installed: `profiles show -type configuration | grep aiwatch`
> 4. Check TCC denials:
>    ```bash theme={null}
>    sudo log show --predicate 'subsystem == "com.apple.TCC"' --last 10m | grep aiwatch
>    ```
>    Look for `Prompting policy ... Deny` lines. TCC PPPC payloads are ignored on manually enrolled MDM devices.
> 5. Verify the package binary is installed and signed correctly:
>    ```bash theme={null}
>    ls -la /usr/local/lib/runlayer/aiwatch/aiwatch
>    codesign -dv /usr/local/lib/runlayer/aiwatch/aiwatch
>    ```
> 6. Re-run the scan after the PPPC profile is applied

> [accordion] PPPC profile applied but TCC still denies AI Watch
>
> **Cause:** The PPPC profile's CodeRequirement does not match the installed binary. The profile pins identifier `com.runlayer.aiwatch` and Developer ID team `AF2M8HC7A2` (Anysource Inc.). Custom, local, or ad-hoc signed builds do not satisfy that requirement, so TCC falls back to deny.
>
> **Resolution:**
>
> 1. Verify the installed binary:
>    ```bash theme={null}
>    codesign -dv --verbose=4 /usr/local/lib/runlayer/aiwatch/aiwatch
>    ```
> 2. Expected output:
>    ```text theme={null}
>    Authority=Developer ID Application: Anysource Inc. (AF2M8HC7A2)
>    Identifier=com.runlayer.aiwatch
>    ```
> 3. If the team identifier or identifier do not match, re-download the official signed and notarized `.pkg` from **Settings → MDM configuration** and re-deploy it. Contact your Runlayer account team if you suspect the deployed build was tampered with.

> [accordion] Legacy runlayer-scan artifacts still appear
>
> **Cause:** The device still has artifacts from the old script-based macOS Detect rollout, such as `/usr/local/bin/runlayer-scan`, `com.runlayer.scan`, or `com.runlayer.scan.pppc`.
>
> **Resolution:** Deploy AI Watch `0.31.14` or newer, or run the uninstall package: both retire the old agent and wrapper. If the artifacts come back, the legacy MDM script is still scoped; delete it per [Legacy macOS Detect Cleanup](https://docs.runlayer.com/shadow-ai/deploy/macos-cleanup-script-deployment.md). For full package removal, use [Remove AI Watch](https://docs.runlayer.com/shadow-ai/deploy/remove.md).

## Log Locations and Checks

| Platform | Feature | Log Location |
| - | - | - |
| macOS package | Detect / endpoint modes / Sessions | Unified log: `log show --predicate 'process == "aiwatch"' --last 1h` |
| macOS package | LaunchAgent | `launchctl print "gui/$(id -u)/com.runlayer.aiwatch"` |
| macOS package | Hook daemon | `aiwatch daemon status`, or `launchctl print "gui/$(id -u)/com.runlayer.aiwatch.daemon"` |
| macOS package | Bootstrap daemon | `sudo launchctl print system/com.runlayer.aiwatch.bootstrap` |
| macOS package | Update daemon | `sudo launchctl print system/com.runlayer.aiwatch.update` (check state and last exit status) |
| Windows | Intune | `C:\ProgramData\Microsoft\IntuneManagementExtension\Logs` |
| Windows package | Hook daemon | `aiwatch daemon status`; supervising service: `Get-Service RunlayerAIWatch` |
| Windows package | Managed config | `HKLM\Software\Runlayer\AIWatch` |
| Windows package | Scan (all-users orchestrator) | `C:\ProgramData\Runlayer\Logs\scheduled-task.log` (orchestrator summary `all_users_scan_complete` + per-profile `all_users_profile_scan_*` lines) |
| Windows package | Scan (per-profile child output) | `C:\Users\<username>\.runlayer\logs` (each scanned profile; the child scan's `USERPROFILE` points there) |
| Manual CLI | Runlayer CLI | Terminal output from `runlayer scan --verbose` |
| Legacy macOS script | Detect | `/var/log/runlayer/ai_watch_detect.log`, `/tmp/runlayer-scan.stdout.log`, `/tmp/runlayer-scan.stderr.log` |

## Exit Codes

| Code | Meaning |
| - | - |
| 0 | Success / compliant |
| 1 | General failure (auth error or unexpected exception) or hook config drift |
| 2 | `scan`: the Runlayer API returned 404, so findings were not stored (wrong `Host`, an out-of-date Runlayer instance, or the path was intercepted by a proxy/CDN). Other commands: missing input, misconfiguration, or no supported clients. |
| 3 | `scan`: a submission was attempted but failed with a network error or a server error (5xx), so some findings were not stored. |
| 4 | Hook install/check credential gate failed |

A `scan` that finds no MCP servers, skills, or plugins may still POST skill-removal records for skills that disappeared since the previous scan; it exits `3` if that POST fails with a server or network error and `0` otherwise. Servers, skills, and plugins are submitted independently, so a failure in one category does not block the others; if any found item cannot be stored the scan exits nonzero (`2` or `3`). Any nonzero `scan` exit surfaces in the `AIWatchScan` task's `LastTaskResult` (Windows) / the launchd job log (macOS), so a scan that ran but persisted nothing is not reported as a silent green.

## Verifying PPPC Profile Deployment

After deploying the AI Watch PPPC profile, verify it is installed on target devices:

```bash theme={null}
profiles show -type configuration | grep -i aiwatch

# Check if Full Disk Access is granted (requires admin)
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" \
  "SELECT client, auth_value FROM access WHERE service='kTCCServiceSystemPolicyAllFiles';"
```

## Verifying Package Binary

Verify the package binary is properly installed and signed:

```bash theme={null}
# Check package binary is installed
ls -la /usr/local/lib/runlayer/aiwatch/aiwatch

# Verify the signature and identifier
codesign -dv /usr/local/lib/runlayer/aiwatch/aiwatch

# Test a scan
/usr/local/bin/aiwatch scan
```

The signature should show `Identifier=com.runlayer.aiwatch`, which matches the AI Watch PPPC profile.

## Related Resources

> [card] [User and Identity Mapping](https://docs.runlayer.com/shadow-ai/identity-mapping.md)
>
> Resolve device usernames to Runlayer users

> [card] [FAQ](https://docs.runlayer.com/shadow-ai/faq.md)
>
> Pre-deployment, security-review, and operational questions

> [card] [Remove AI Watch](https://docs.runlayer.com/shadow-ai/deploy/remove.md)
>
> Remove package-based and legacy script-based deployments

## Getting Help

If you continue to experience issues:

1. Collect the relevant log files from the affected device
2. Note the HTTP status codes and error messages
3. Contact Runlayer support with the collected information


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