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.
When to use this
Run this cleanup if your fleet was previously deployed with the script-based Detect path (an MDM Script + therunlayer-scan PPPC profile) and you are migrating to the new macOS .pkg flow (see the per-MDM guides linked from Detect). The two paths use different binary identifiers, paths, and PPPC pins — leaving the old artifacts in place causes:
- Duplicate scans (per-user
com.runlayer.scanLaunchAgent + system-widecom.runlayer.aiwatchLaunchAgent both fire). - Dangling TCC grants for
/usr/local/bin/runlayer-scanthat survive even after the script is unscoped. - Confusing log output split across
/var/log/runlayer/ai_watch_detect.log(old) and the new macOS unified log underprocess == "aiwatch".
What gets left behind
The script-based deployment installs and configures the following on each enrolled device:| Artifact | Path / Identifier |
|---|---|
| Wrapper binary | /usr/local/bin/runlayer-scan (ad-hoc signed, identifier com.runlayer.scan) |
| Per-user LaunchAgent | ~/Library/LaunchAgents/com.runlayer.scan.plist |
| Runlayer CLI (uv tool) | ~/.local/share/uv/tools/runlayer |
| MDM org API key | ~/.runlayer/config.yaml — only the org_api_keys.ai_watch_mdm entry |
| Logs | /var/log/runlayer/ai_watch_detect.log (fallback /tmp/runlayer-ai_watch_detect.log), plus /tmp/runlayer-scan.{stdout,stderr}.log |
| MDM-side script | One Script per MDM (Jamf, SimpleMDM, Mosyle, Kandji, …) |
| MDM-side PPPC profile | com.runlayer.scan.pppc (pins Full Disk Access to /usr/local/bin/runlayer-scan) |
Order of operations
- Unscope the old MDM artifacts (Script + old PPPC profile) so devices stop receiving the script-based deployment.
- Push a one-time per-device cleanup script (below) to remove leftover binaries, LaunchAgent, and logs.
- Deploy the new
.pkgvia the per-MDM guide for your platform — see Detect for the index of MDM-specific guides.
MDM-side cleanup
For each MDM, remove or unscope the two script-based artifacts. Names below match the artifacts created in the original setup guides.- Jamf Pro
- SimpleMDM
- Mosyle
- Iru/Kandji
- Workspace ONE
- Other MDM
- Computers → Policies → open the “Deploy AI Watch Detect” Policy → set Scope to none (or delete the Policy).
- Settings → Computer Management → Scripts → delete the “AI Watch Detect” Script.
- Computers → Configuration Profiles → delete the uploaded Runlayer PPPC profile (
com.runlayer.scan.pppc).
Per-device cleanup script
Push the script below as a one-time Custom Script to every device that previously ran the script-based deployment. It is idempotent — safe to re-run, and a no-op on devices that never had the old deployment.The script intentionally leaves the following in place:
uvitself (/usr/local/bin/uv,/usr/local/bin/uvx) — general-purpose tooling that may be in use for other workflows. Only therunlayeruv-tool install is removed.~/.runlayer/config.yaml— only theorg_api_keys.ai_watch_mdmentry is removed. Other host entries and any personalrunlayer logincredentials are kept. The file is not deleted, even if it ends up empty.- OS Keychain entries — the script-based deployment never wrote to the keychain. Any
runlayerkeychain entries belong to an interactiverunlayer loginsession and are left untouched.
Verification
After the cleanup script runs and the new.pkg is deployed, confirm there is exactly one Runlayer scan agent on each device:
com.runlayer.aiwatch. Any remaining com.runlayer.scan entries indicate a device that didn’t receive the cleanup script — re-target it and re-run.
Rollback
If you need to revert to the script-based deployment temporarily, re-scope the original Script and PPPC profile in your MDM. The new.pkg and the old wrapper can coexist for short periods (they use distinct identifiers and paths), but scheduled scans will then run twice per cycle — use only as a short-term safety net during migration.