aiwatch.exe) installed once per device. Tenant config — host, a single organization API key, and the Enforcement / Sessions capability properties — is written to the registry by the MSI.
Prerequisites
- Microsoft Intune admin with app upload rights. Enforce additionally needs Devices → Scripts and remediations → Remediations access (P2 or add-on).
- Devices running Windows 10 1809+ / 11, 64-bit, Microsoft Entra joined.
- A single organization API key with the Detect Scan role minted in Settings → Organization API keys (
rl_org_...). The same key covers scanning, enforcement, and sessions.
What you receive
The deployment package (aiwatch-<version>-intune-package.zip) contains:
| File | Purpose |
|---|---|
aiwatch-<version>-win-x64.intunewin | App package for Intune upload (installs aiwatch.exe + tenant registry) |
scan-on-detect/detect.ps1 | Detect, Option A — runs aiwatch.exe scan directly in the detection phase |
scheduled/detect.ps1 + scheduled/remediate.ps1 | Detect, Option B — checks staleness, then scans when stale |
assert/detect.ps1 + assert/remediate.ps1 | Hooks — runs aiwatch.exe setup hooks check/install --mdm to assert hook configs when Enforce or Sessions is enabled (SYSTEM) |
.zip yet.
Capability properties
The MSI install command carries tenant config and capability flags. Detect is always available after the app is installed; Enforce and Sessions are controlled by the optional properties below. All values write toHKLM\Software\Runlayer\AIWatch\ (Host / OrgApiKey as REG_SZ, Enforcement / Sessions as REG_DWORD):
| Property | Required | Default | Effect |
|---|---|---|---|
AIWATCH_HOST | Yes | None | Tenant host URL |
AIWATCH_ORG_API_KEY | Yes | None | The rl_org_... secret used for Detect scans, Enforce hooks, and Sessions telemetry |
AIWATCH_ENFORCEMENT | No | 0 | Set 1 to install blocking hooks for unmanaged MCP sources and local tool policy checks |
AIWATCH_SESSIONS | No | 1 | Set 0 to skip full event/session hooks; when both this and AIWATCH_ENFORCEMENT are 0, hook configs are removed while Detect scans continue |
Phase 1 — Create the app
Open the Intune admin center
App information
| Field | Value |
|---|---|
| Name | Runlayer AI Watch |
| Description | Runlayer AI Watch agent for Shadow MCP detection and enforcement. |
| Publisher | Runlayer Inc. |
| App Version | The version from the deployment package (e.g. 1.0.0) |
| Notes | stableAppId=com.runlayer.aiwatch |
Program
| Field | Value |
|---|---|
| Install command | msiexec /i aiwatch-<version>-win-x64.msi /qn AIWATCH_HOST=https://<your-host>.runlayer.com AIWATCH_ORG_API_KEY=rl_org_... AIWATCH_ENFORCEMENT=1 AIWATCH_SESSIONS=1 |
| Uninstall command | msiexec /x aiwatch-<version>-win-x64.msi /qn |
| Install behavior | System |
| Device restart behavior | No action |
AIWATCH_ENFORCEMENT=0 AIWATCH_SESSIONS=0. For a monitoring-only rollout, set AIWATCH_ENFORCEMENT=0.For full package, remediation, and hook cleanup, see Remove AI Watch.Click Next.Requirements
- Operating system architecture: 64-bit
- Minimum operating system: Windows 10 1809
Detection rules
| Field | Value |
|---|---|
| Rule type | File |
| Path | C:\Program Files\Runlayer\AIWatch |
| File or folder | aiwatch.exe |
| Detection method | File version |
| Operator | Greater than or equal to |
| Value | The version you are deploying (e.g. 1.0.0) |
Dependencies and Supersedence
- Dependencies: skip (none required).
- Supersedence: skip on first deploy. For upgrades, see Upgrade path below.
Return codes
| Code | Result |
|---|---|
| 0 | Success |
| 1707 | Success |
| 3010 | Soft reboot |
| 1641 | Hard reboot |
| 1618 | Retry |
Phase 2 — Schedule scans (Detect)
The app installsaiwatch.exe and writes tenant config to the registry, but it does not schedule scans by itself. Create an Intune Remediation to run scans on a recurring schedule. The deployment package ships two strategies — pick one.
Option A — Scan on detect
The detection script runsaiwatch.exe scan directly. Exit 0 if the scan succeeds, exit 1 if it fails. No remediation script is needed.
Create the remediation
Upload scripts
- Upload
scan-on-detect/detect.ps1as the Detection script. - Remediation script: leave blank, or paste a one-line
exit 0placeholder. - Run this script using the logged-on credentials: Yes.
- Run script in 64-bit PowerShell host: Yes.
Option B — Detect staleness + remediate
A lightweight detection script checks whetheraiwatch.exe exists and whether the last scan is fresh (within 30 minutes). If either check fails, Intune triggers the remediation script, which runs the scan and records a timestamp. This follows Intune’s fast-detect / heavy-remediate best practice and gives a 3-state dashboard.
Create the remediation
Upload scripts
- Upload
scheduled/detect.ps1as the Detection script andscheduled/remediate.ps1as the Remediation script. - Run this script using the logged-on credentials: Yes.
- Run script in 64-bit PowerShell host: Yes.
Phase 3 — Assert hooks (Enforce or Sessions)
WhenAIWATCH_ENFORCEMENT=1 or AIWATCH_SESSIONS=1, add the assert/ Remediations pair so hook configs stay asserted in SYSTEM context.
Create the `assert/` Intune Remediation (SYSTEM)
- Name: e.g. “AI Watch — Assert Hooks”.
- Detection script: upload
assert/detect.ps1. Remediation script: uploadassert/remediate.ps1. - Run this script using the logged-on credentials: No. Required — the scripts write SYSTEM-scoped paths under
Program Files/ProgramDataand refuse user context with exit 2. - Run script in 64-bit PowerShell host: Yes.
- Enforce script signature check: Yes for CI-built releases, No for local unsigned builds.
- Schedule: every 1 hour (Intune minimum). Both scripts are idempotent.
- Assign to the same device group as the app.
Enforcement and Sessions are disabled, so Detect-only fleets pay zero hourly noise. To stop enforcing, re-push the app with AIWATCH_ENFORCEMENT=0; if Sessions stays enabled, hooks remain installed for monitoring-only telemetry and aiwatch hook stops blocking on its next fire.
Verification
After devices sync with Intune (and, for Enforce, a user logon):Upgrade path
The MSI usesMajorUpgrade with RemoveExistingProducts before InstallFinalize — it uninstalls the old C:\Program Files\Runlayer\AIWatch\ tree then installs the new one. Registry values in HKLM\Software\Runlayer\AIWatch survive because they are owned by a separate component keyed on a registry value, not a file. Remediation scripts and the Intune schedule are unchanged.
Download the new package
aiwatch-<version>-intune-package.zip and extract the .intunewin.Create a new app
AIWATCH_HOST and AIWATCH_ORG_API_KEY (plus your capability properties) — re-writing the same registry values is a no-op, but the MSI requires both mandatory properties.Troubleshooting
App shows as 'Not installed' on devices
App shows as 'Not installed' on devices
- Ensure the device is Microsoft Entra joined (not just registered)
- Check that the Intune Management Extension service is running
- Verify the install command has the correct host and API key
- Review logs in
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs
MSI install fails: `AIWATCH_HOST` / `AIWATCH_ORG_API_KEY` property is required
MSI install fails: `AIWATCH_HOST` / `AIWATCH_ORG_API_KEY` property is required
AIWATCH_HOST and AIWATCH_ORG_API_KEY are required — the MSI’s launch conditions refuse a half-configured registry write. Re-run with both set.Remediation shows non-compliant / no data in Runlayer
Remediation shows non-compliant / no data in Runlayer
- Check
%ProgramData%\Runlayer\ai_watch_detect.logfor errors - Verify the organization API key is correct and not revoked (Settings → Organization API keys)
- Ensure the device can reach your Runlayer instance over HTTPS
`assert/` remediation marked Failed with `must run as SYSTEM` (exit 2)
`assert/` remediation marked Failed with `must run as SYSTEM` (exit 2)