Authentication and Configuration
Package-based AI Watch uses one organization API key for scans, hooks, sessions, and managed updates on every supported platform. The installedaiwatch 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).
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. If it is lost or exposed, replace it in
place: in Settings → MDM configuration, open the deployment’s View
deployment setup and select Replace organization API key. The new key is
shown once, and the old one stops working at once, so re-push the profile, MSI
command, or credentials file with the new key. The deployment keeps its
settings, its enrolled devices, and its agent enrollment key.
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:0.31.3 or later). A proxy, WAF, IP allowlist, or zero-trust gateway answered instead. The hook recognises Runlayer’s own responses by the X-Runlayer-Origin header, or by X-Request-ID together with a JSON detail body. Monitor and Protect treat it like any other HTTP error, and Monitor does not start the 5-minute pause. Enforce blocks with Runlayer verification blocked by your network (HTTP 403) — check your VPN or zero-trust client and retry. The block is titled Runlayer Verification Blocked by Network, shows Block type: Network, and names the device hostname. A 403 from the Runlayer API itself gets the generic HTTP-error handling; see the authentication table.
What the administrator should do
- Open Settings → MDM configuration to identify the revoked organization API key, and check Audit Logs for
auth_failedentries. 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: its status changes to Inactive after 24 hours without a check-in and to Device Unresponsive after 5 days. The Enforce block message quotes the device hostname, so a helpdesk ticket can name the exact device. - Re-deploy a current key to the affected devices. If the deployment still exists, push its profile or MSI command with its current key; if you no longer have that key, select Replace organization API key in the deployment’s View deployment setup first. If the deployment was deleted, create a new deployment in Settings → MDM configuration and push its profile or MSI command. Replacing a deployment’s key or deleting the deployment revokes its organization API key, so every device still carrying that key is rejected until it receives the new one.
- After the new key lands, hooks recover on their own: Enforce on the next tool call, Monitor within 5 minutes.
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.
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
User appears in the Shadow report for MCP servers they say they never used
User appears in the Shadow report for MCP servers they say they never used
- 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, then fix via Settings → User mapping and re-analyze.
- Click the shadow artifact row on the Shadow AI page’s Details tab to open the detail drawer.
- The detail shows the Device (hostname), User, Scope (Global or Project), the config Path, and the MCP server’s Command / Args / URL. For the device ID or serial number, open the device under Shadow AI → Devices.
- If Scope is Project, the discovery came from a project-level config file. Open that repo and inspect the checked-in MCP config to confirm.
- If Scope is Global, 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). - 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.
A skill is flagged High or Medium risk but is legitimate
A skill is flagged High or Medium risk but is legitimate
- Open the skill’s row in Shadow AI → Skills to read the analyzed instructions and see why it was flagged.
- 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.
- After the skill’s content or management status changes, re-analyze to refresh its classification and risk level.
Package Issues
No devices appearing on the Shadow AI page
No devices appearing on the Shadow AI page
- Confirm the package is installed:
- Confirm managed configuration is present:
- Trigger one scan manually from the device:
- Confirm network connectivity from the device to your Runlayer host.
macOS scan agent is not running
macOS scan agent is not running
- Confirm the bundled LaunchAgent exists:
- Check whether launchd loaded it for the logged-in user:
- Kickstart it once:
- If launchd does not know the agent, re-run the bootstrap now instead of waiting for its next 15-minute run:
- Inspect the scan logs (per user, kept 14 days):
Error: No host configured on macOS
Error: No host configured on macOS
Host / OrgApiKey into managed preferences. The scan prints Error: No host configured. Please provide --host or run 'runlayer login --host <url>' first.; the hook installer prints ✗ no host configured (pass --host, set RUNLAYER_HOST, or push MDM Host).Resolution:- Check managed preferences:
- If the file is empty or missing, force an MDM sync from the device or wait for the next check-in.
- Confirm the profile targets the same device group as the
.pkg.
~/.runlayer/logs has no scan logs on macOS
~/.runlayer/logs has no scan logs on macOS
log show returns nothing.Resolution:- Check whether launchd loaded the agent for the logged-in user:
- If launchd returns
Could not find service, wait for the next bootstrap run (within 15 minutes, with a user logged in). AI Watch0.29.20or later reloads the scan agent itself. To do it now, runsudo aiwatch config sync. Re-deploy the.pkgonly if/Library/LaunchAgents/com.runlayer.aiwatch.plistis missing. - If the agent is loaded, wait one
StartIntervaltick (default 15 minutes) or seed output with: - List the per-user log files, which are kept for 14 days:
Users see 'Background Item Added' notification on first login after install
Users see 'Background Item Added' notification on first login after install
- Confirm
com.runlayer.aiwatch.mobileconfig(which carries the Login Items payload;com.runlayer.aiwatch.loginitems.mobileconfigon fleets still running the older split profiles) is deployed to the device. - After MDM sync, verify Background Task Management state:
- Expect the agent to show
Disposition: enabled allowed visible.
AI Watch background items show 'disallowed' or 'cannot be launched because of BTM policy'
AI Watch background items show 'disallowed' or 'cannot be launched because of BTM policy'
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:- Download the current
com.runlayer.aiwatch.mobileconfig(orcom.runlayer.aiwatch.ws1.mobileconfig) from Settings → MDM configuration and re-deploy it. Installed profiles don’t update on their own. A profile downloaded from an existing deployment contains the<YOUR_API_KEY>placeholder; replace it with the deployment’s key before re-deploying. - If you manage Login Items in your own MDM payload instead, replace the rule with:
- After MDM sync, confirm every Runlayer item shows
allowed:
AI Watch bootstrap daemon not loaded after reboot
AI Watch bootstrap daemon not loaded after reboot
.pkg or your MDM runs a Runlayer item, and this returns Could not find service:.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:- Check whether macOS blocks the Runlayer items:
If they show
disallowed, fix the Login Items rule first (see AI Watch background items show ‘disallowed’ above). - Load the daemon now:
- Add the
launchctl printchecks from the Iru / Kandji 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.
macOS package blocked by Gatekeeper
macOS package blocked by Gatekeeper
.pkg is not signed, not notarized, or is not the official signed AI Watch package from Runlayer.Resolution:- Verify the package signature and notarization:
- Expected output includes
status: signed by a developer certificate issued by Appleandsource=Notarized Developer ID. - Official packages downloaded from Settings → MDM configuration are signed and notarized by Anysource Inc. with Developer ID team
AF2M8HC7A2.
Windows scans are not running
Windows scans are not running
- Confirm the app installed
aiwatch.exeunderC:\Program Files\Runlayer\AIWatch\. - Confirm the hidden
\Runlayertask folder and theAIWatchScantask exist:The task-registration action gates on theOrgApiKeyregistry value — if there are no tasks, confirmGet-ItemProperty "HKLM:\Software\Runlayer\AIWatch"showsOrgApiKey, then repair/reinstall the app. - Check the
AIWatchScantask’s last result and the per-profile scan outcomes. The single SYSTEM task runsaiwatch.exe scan --all-usersand 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): - Check the task-registration lines (tagged
[register]) inC:\ProgramData\Runlayer\Logs\scheduled-task.log. - Run a one-off scan as the logged-in user:
Hook configs are not installed or drifted
Hook configs are not installed or drifted
- 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.
- Check hook config compliance:
- On macOS, confirm the bootstrap daemon is loaded:
- On Windows, confirm the device-local
AIWatchHookstask (SYSTEM) is running:Get-ScheduledTaskInfo -TaskPath "\Runlayer\" -TaskName "AIWatchHooks" | Select-Object LastRunTime, LastTaskResult. Force a run withStart-ScheduledTask -TaskPath "\Runlayer\" -TaskName "AIWatchHooks", or reinstall the app if it’s missing. - For OpenCode,
runlayer-aiwatch.js is not a Runlayer pluginmeans another file already uses the Runlayer plugin’s name in~/.config/opencode/plugins. Move that file aside; the next reconcile installs the plugin. - For Goose or VS Code drift that never clears, the check’s detail names the cause; see the exit-1 causes under Enforce troubleshooting.
- 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.
Hooks are installed but not blocking
Hooks are installed but not blocking
- 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: Mode=monitoris 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.- Check whether the “missed” call was allowed by policy rather than missed by the hook:
- The user is on the exemption list under Exempt users on Settings → Tool governance → 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.
- Change Mode from Settings → AI Watch → Manage settings, then wait for the next 15-minute hook reconcile or run
aiwatch config syncto apply it immediately. Re-push MDM policy only when changing the fallback or another MDM-owned value. - For OpenCode, check the version (
opencode --version) and how it was started. If an OpenCode 2 device records nothing, update AI Watch to 0.31.35 or later: older releases install a plugin that OpenCode 2 cannot load. On OpenCode 1,opencode --pureandOPENCODE_PURE=1skip every plugin, including Runlayer’s. On OpenCode 2, a config whosepluginslist holds"-runlayer-aiwatch"or"-*"skips it, and so does anOPENCODE_CONFIG_DIRthat points at a directory without it;aiwatch setup hooks check --user, run in the user’s shell, names that directory. The hook cannot report these cases to Runlayer. - Restart the AI client so it reloads hook config.
- Run the Enforce test detections. Enforce and Protect block them for every user who is not exempt, whatever your allowlists say, so a test that still goes through rules out policy and points at the device’s mode, hooks, or client.
Device shows healthy but the user says their sessions never arrive
Device shows healthy but the user says their sessions never arrive
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
runlayerCLI 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 yourrunlayer loginhost<login host>. Clients without a user-message channel on an allow (for example Cursor) stay silent. runlayer loginprints the same note at the end when the login host differs from the managed host.
- If the user should be working against the managed tenant, have them run
runlayer login --host <managed host>(orrunlayer logout). The badge clears on the next scan after their hooks see the two hosts agree. - 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.
- Devices whose hooks are wired only to the
aiwatchbinary never show this:aiwatchdoes not read~/.runlayer/config.yamlat all.
The browser extension does not appear in Chrome, Edge, or Firefox
The browser extension does not appear in Chrome, Edge, or Firefox
chrome://extensions, edge://extensions, or about:addons.Resolution:- The extension is installed by the 15-minute hook reconcile. Rerun it immediately as an administrator instead of waiting:
- Fully quit and reopen the browser — Chrome, Edge, and Firefox apply managed extension policy at startup.
- Confirm the device runs a supported AI Watch version and appears in Shadow AI → Devices:
0.29.6or newer for Chrome and Firefox on macOS, or0.30.13or newer for Edge and for Windows devices. - For Chrome or Edge, confirm the device meets the browser requirements. In Edge, a personal Microsoft account profile on a managed device may not receive the extension.
- See Browser extension for session-collection and blocking issues once the extension is installed.
Scan or hook fails behind a corporate TLS inspection proxy
Scan or hook fails behind a corporate TLS inspection proxy
3. The certificate error is in the scan log under ~/.runlayer/logs. If the failure happens before submission, the scan prints Error: <message> and See logs for details: <path> and exits 1.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:- Prefer installing the corporate root CA into the OS trust store through MDM.
- For debugging or one-off deployments, pass a PEM bundle explicitly:
- For custom CLI workflows, set
RUNLAYER_CA_BUNDLE. The CLI also honorsSSL_CERT_FILEandREQUESTS_CA_BUNDLEas fallbacks. - Ask the security team to exempt the Runlayer tenant hostname from TLS inspection, such as
*.runlayer.comor customer-managed hostnames likerunlayer.dev.company.comjust like they do for other security products like endpoint detection and response (EDR).
runlayer: command not found after install
runlayer: command not found after install
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:- Restart your terminal (new shells pick up the updated PATH)
- Or run
uv tool update-shellto add~/.local/binto your shell profile, thenexec $SHELL -l(or open a new terminal) - Verify:
which runlayer(macOS/Linux) orwhere runlayer(Windows)
Users see macOS consent dialogs for AI Watch
Users see macOS consent dialogs for AI Watch
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:- Deploy
com.runlayer.aiwatch.mobileconfig(which carries the PPPC payload;com.runlayer.aiwatch.pppc.mobileconfigon fleets still running the older split profiles) via your MDM. - Re-deploying the profile restores access even if a user clicked “Don’t Allow”.
- Ensure devices are enrolled via User-Approved MDM or Automated Device Enrollment (required for MDM-managed PPPC profiles to take effect)
- Verify the profile is installed:
- Re-run the scan after the profile is applied
Scan finds fewer MCP servers than expected on macOS
Scan finds fewer MCP servers than expected on macOS
- Deploy the AI Watch PPPC profile to grant Full Disk Access to
/usr/local/lib/runlayer/aiwatch/aiwatch. - Ensure devices are enrolled via User-Approved MDM or Automated Device Enrollment
- Verify the profile is installed:
profiles show -type configuration | grep aiwatch - Check TCC denials:
Look for
Prompting policy ... Denylines. TCC PPPC payloads are ignored on manually enrolled MDM devices. - Verify the package binary is installed and signed correctly:
- Re-run the scan after the PPPC profile is applied
PPPC profile applied but TCC still denies AI Watch
PPPC profile applied but TCC still denies AI Watch
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:- Verify the installed binary:
- Expected output:
- If the team identifier or identifier do not match, re-download the official signed and notarized
.pkgfrom Settings → MDM configuration and re-deploy it. Contact your Runlayer account team if you suspect the deployed build was tampered with.
Legacy runlayer-scan artifacts still appear
Legacy runlayer-scan artifacts still appear
/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. For full package removal, use Remove AI Watch.Log Locations and Checks
scheduled-task.log rotates to scheduled-task.log.1 above 10 MiB. If ~/.runlayer/logs is not writable, the log goes to runlayer-logs in the system temp directory.
Exit Codes
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). On Windows, the AIWatchScan task’s LastTaskResult is 0 (every profile scan succeeded), 1 (at least one profile scan failed), or 2 (not running as SYSTEM). The failing profile’s own exit code is on its all_users_profile_scan_nonzero line in C:\ProgramData\Runlayer\Logs\scheduled-task.log. On macOS, the code is the last exit code in launchctl print "gui/$(id -u)/com.runlayer.aiwatch".
Verifying PPPC Profile Deployment
After deploying the AI Watch PPPC profile, verify it is installed on target devices:Verifying Package Binary
Verify the package binary is properly installed and signed:Identifier=com.runlayer.aiwatch, which matches the AI Watch PPPC profile.
Related Resources
User and Identity Mapping
FAQ
Remove AI Watch
Getting Help
If you continue to experience issues:- Collect the relevant log files from the affected device
- Note the HTTP status codes and error messages
- Contact Runlayer support with the collected information