Before you begin
About 30 minutes. At the end, every device in scope holds a Lumos device token, and Claude Code, Codex and Cursor run the Lumos hooks. You need:- Lumos: Organization Admin, or the MCP Governance role, with MCP Governance enabled on your domain. Creating the enrollment token in step 3 also needs permission to create API tokens.
- Your MDM: permission to create scripts, policies and configuration profiles. In Jamf Pro, that means Advanced Computer Searches, Scripts, Policies and Configuration Profiles.
- Devices: Macs running Claude Code, Codex, Cursor, or any combination. If your Claude organization also uses server-managed settings, Claude Code 2.1.242 or later is needed to merge them with the MDM profile; see Check it worked. Windows devices running Claude Code enroll through Intune with a PowerShell script; see the Intune Windows tabs below. Linux is covered by the per-user install only; see Linux. Cursor on Windows is not covered yet.
Testing with a few people first? Per-user install vs MDM
Testing with a few people first? Per-user install vs MDM
git config user.email), which they can change, and they can remove the hooks. If you intend to block anything, deploy by MDM.1. Bring your devices into Lumos
Lumos needs each device’s serial number and its owner. There are two ways to supply them. If Jamf or Kandji is connected to Lumos, the devices it manages sync in on their own and you can skip the export and the import in step 2. Otherwise, export a CSV from your MDM and import it.From a connected Jamf or Kandji integration
A connected MDM integration is a live inventory. Lumos reads it once a day and keeps the Devices tab in step with what your MDM reports, with no file to export or re-import.- Jamf: turn on Include Devices on the integration. It needs the Read Computers privilege on the API role. See Jamf.
- Kandji: managed devices sync by default. The API token needs List Devices. See Kandji.
How the sync works
How the sync works
- The integration’s regular sync brings each managed computer into Lumos as a Device permission, held by the person your MDM assigns it to. You can see them on the integration’s permissions.
- Once a day, at 06:00 UTC, MCP Governance reads those devices and writes them to the Devices tab with the connection type MDM sync. The read takes whatever the integration’s own sync has brought in by then, so expect a machine to appear within a day or two of being assigned in your MDM. New machines start as Pending, exactly like an imported row, and enroll the next time the enrollment script runs on them.
- A device is written only when Lumos can attribute it to exactly one person in your directory. A computer with no assigned user, one assigned to several people, or one whose holder does not match a directory identity is skipped. Fix the assignment in your MDM and it is picked up on the next sync. Nothing is guessed.
- Each device is matched by serial number. A serial that is already on the Devices tab, from an earlier import or sync, is updated rather than duplicated.
- A machine your MDM stops reporting is Retired on the next sync. Its token is cleared, and its tool calls are denied at once, the same as a revoke. It returns to Pending if the MDM reports it again, or if a later CSV import lists its serial. No row is ever deleted.
- An owner you assigned by hand on the Devices tab is kept. The rest of the owner details follow your MDM’s assignment.
- A Revoked device stays revoked through every sync, until an admin clicks Allow.
- Two safeguards keep a broken sync from retiring a working fleet. A sync that reports no machines at all, or none with a serial, changes nothing. And a sync that would retire more than half of the machines it previously reported is refused, once that MDM has ten or more devices on the tab. In both cases nothing is written and the previous inventory stands. If you are decommissioning most of your fleet, revoke the machines by hand.
- Each connected MDM keeps its own population. With both Jamf and Kandji connected, one never retires the other’s machines.
From a CSV export
- Jamf
- Intune macOS
- Intune Windows
- Kandji
- Go to Computers → Search inventory → + New, or open an existing search and click Edit.
- Criteria: leave empty for the whole fleet, or restrict it to your pilot smart group.
- On the Display tab, tick:
- Hardware → Serial Number
- Computer → UDID
- User and Location → Email Address and Username
- Optional: Computer → Computer Name, so Lumos shows the Mac’s name next to its serial.
- Click Save, then View. Check the columns are there, then click Report (bottom right).
- On the Reports tab, pick Comma-Separated Values (.csv) and click Download Report.
CSV columns Lumos reads
CSV columns Lumos reads
Serial Number, Device Serial Number, Hardware UUID, Email Address, Device User Email, Primary user UPN, User Principal Name, Assigned User, Intune device ID, Computer Name and Device name. Header names are case-insensitive, spacing and punctuation are ignored, and order does not matter.A file can hold up to 10,000 rows and 5 MB, and must be UTF-8.2. Import the export into Lumos
Skip this step if your devices sync from a connected Jamf or Kandji integration.- Go to MCP Governance → Devices, then click the import icon (top right, next to search).
- Drop the CSV and click Import.
Device states on the Devices tab
Device states on the Devices tab
- Pending: in your inventory, not enrolled yet.
- Enrolled: holds a device token. Its tool calls are attributed to its owner.
- Revoked: an admin cut the device off and its token is cleared. It stays revoked through enrollment script re-runs and re-imports until an admin clicks Allow. It then returns to Pending and enrolls with a fresh token the next time the script runs.
- Refused: a machine tried to enroll with a serial that is not in your inventory. Review these: they show you agents running on machines you are not governing. To let one in, click Allow. If Lumos could not match the owner the machine claimed to someone in your directory, pick the owner in the Owner column first.
- Retired: a connected MDM’s nightly sync no longer lists it. Its token is cleared, and it returns to Pending if a later import or sync lists its serial. A CSV import never retires a device.
What re-importing changes
What re-importing changes
udid, email and name. A blank udid or email cell clears that value, but a blank name never does. An owner an admin assigned by hand is kept.A Retired device whose serial is in the file returns to Pending, so leave retired machines out of the file. A Refused serial that is now in the file also becomes Pending and can enroll. A Revoked device stays revoked. Other statuses, and each device’s token and timestamps, stay as they are.A name from the file wins over the name the machine reports when it enrolls. On macOS, the enrollment script reports the machine’s Computer Name rather than its DNS hostname.3. Create an enrollment token
- In Lumos, go to Settings → API Tokens → Add, or click Create token in step 2 of the First-Time Setup checklist.
- Choose MCP Enrollment Token and name it after the rollout. Lifetimes run from 7 days to 1 year. On Jamf, the default 90-day lifetime is fine because the token stays in the policy. On Intune and Kandji the token sits in the script body, where anyone who can read your script library can see it, so pick the shortest lifetime that covers your rollout. Click Add.
- Copy the
lmcpe_…value. It is shown once.
Two tokens: which is which
Two tokens: which is which
4. Enroll your devices
The enrollment script runs as root. On macOS it writes the device token to/Library/Lumos/device-token. Once the device holds a token, the script also writes Cursor’s hooks, because LUMOS_CURSOR_HOOKS=1 is set in every snippet below. On a device that is already enrolled, it changes nothing unless Lumos has newer Cursor hooks, and exits 0.
Run the script on a recurring schedule. Cursor reads its hooks only from a file, so no configuration profile can deliver them. Each run of the enrollment script is how Cursor’s hooks reach new devices and stay current when Lumos updates them.
How the script writes Cursor's hooks
How the script writes Cursor's hooks
LUMOS_CURSOR_HOOKS=1, the --cursor-hooks flag, or Jamf Parameter 8 set to 1, the script writes two files:hooks.json is replaced only when it is absent or matches the copy Lumos ships. If your device already has its own hooks.json, the script leaves that file alone and prints the entries to add to it. The entries name only the hook script, not a version, so a file you merged them into keeps working as Lumos updates the script.Without the setting, the script writes only the device token. Cursor’s hooks on Windows are not covered yet.- Jamf
- Intune macOS
- Intune Windows
- Kandji
- Go to Settings (bottom of the left rail) → Computer management → Scripts, and click + New.
- General tab → Display name:
Lumos MCP Governance · Enroll. - Script tab → language Shell/Bash, then paste exactly this:
- Options tab → Parameter 4 label:
Lumos enrollment token (lmcpe_…), so the policy screen explains itself. - Click Save.
5. Install the hooks profile
On Windows, skip this step. The enrollment script already wrote the hook config. In Lumos, go to MCP Governance → Deployment → MDM hooks → Update Hooks, choose Locked or Unlocked, and download the hook config. Do not edit it. It carries the hooks for both Claude Code and Codex. Cursor’s hooks are not in the profile; the enrollment script in step 4 writes them.- Locked: only the Lumos hooks run. People can’t add their own.
- Unlocked: people’s own hooks keep running beside the Lumos hooks. They still can’t remove the Lumos hooks.
?lock=false.
- Jamf
- Intune macOS
- Kandji
- Go to Computers → Configuration profiles → Upload, and pick the file.
- Scope: the same smart group as the enrollment policy. Save.
curl call, so nothing is installed.
Optional switches. When you download from the URL directly, append these before uploading:
?lock=false&capture=none.
?capture=none is separate from the tool input settings on the Deployment tab, which decide what Lumos stores of the inputs it receives. By default, Lumos stores no tool input. See Tool input settings.
Linux
Linux is not part of the MDM setup. Linux users install the hooks for Claude Code, Codex and Cursor themselves from the install page, as in the per-user install above. Their machines appear on the Devices tab as Per-user install.6. Check it worked
Ask someone on an enrolled device to use Claude Code for a minute, then open MCP Governance → Events. Their tool calls appear within seconds, under their name. Click a row: User is the owner from your export. Under Trace, Harness is the agent that made the call, such as Claude Code, Codex or Cursor, and Hook source reads MDM (hook config 1.8 or later). Nothing is blocked by policy until you write one. If events show up under the right people, you are done.No events? Check the Devices tab
No events? Check the Devices tab
- Enrolled: the enrollment ran. If events are still missing, see the warning above and restart Claude Code on that device.
- Pending: the enrollment has not run there yet. Check its scope and your MDM’s logs.
- Refused: the device presented a serial you did not import. Add it to the export and re-import, or click Allow on its row; the next check-in enrolls it.
- Revoked: an admin revoked it. It stays revoked until someone clicks Allow.
In Jamf: which Macs have finished which step
In Jamf: which Macs have finished which step
- Policy: open the policy and click Logs (bottom right, or Control+L). Completed means the script ran, so that Mac should be Enrolled in Lumos. Pending means the Mac has not checked in since you saved the policy. Failed: click Details for the script output; the Lumos error text is in there. Flush clears the entry so the policy runs again at that Mac’s next check-in.
- Profile: on Computers → Configuration profiles, the Completed / Pending / Failed counts next to the profile work the same way, and View under Logs lists each Mac.
On one Mac
On one Mac
/hooks. The Lumos hooks are listed under managed settings.Troubleshooting
Tool calls are denied on a device right after the profile landed
Tool calls are denied on a device right after the profile landed
sudo jamf policy on it.All tool calls are denied on a device that was Enrolled
All tool calls are denied on a device that was Enrolled
The script logs "the enrollment token is unknown, expired or revoked"
The script logs "the enrollment token is unknown, expired or revoked"
A device shows Refused
A device shows Refused
The enrollment token has a rising refusal count
The enrollment token has a rising refusal count
An Enrolled device has a rising refusal count
An Enrolled device has a rising refusal count
A device you revoked needs to come back
A device you revoked needs to come back
Cursor tool calls do not appear on an enrolled Mac
Cursor tool calls do not appear on an enrolled Mac
- No
Cursor hooks:line: the script ran withoutLUMOS_CURSOR_HOOKS=1. Add it to the script, as in step 4. holds hooks Lumos did not write and was left as it is: the Mac already has its own Cursorhooks.json. Add the entries the script printed to that file, then let the next policy run confirm it.
Engineers say their own hooks stopped running
Engineers say their own hooks stopped running
?lock=false URL, and replace the profile in your MDM.Tool calls show up twice for people who installed it themselves first
Tool calls show up twice for people who installed it themselves first
LUMOS_CLEANUP_LEGACY=0 to the script. In Jamf, add LUMOS_CLEANUP_LEGACY="$7" before sh in the script. Set Parameter 7 to 0. On Windows, add $env:LUMOS_CLEANUP_LEGACY = '0' to the wrapper.The cleanup also removes the Cursor hooks people installed themselves, once the enrollment script has written Cursor’s hooks on that machine.For a single machine, have the person run this once. It removes the self-installed hooks and keeps the managed ones.Sessions open during the rollout still behave the old way
Sessions open during the rollout still behave the old way
A Claude Cowork or Claude Code tool call was blocked
A Claude Cowork or Claude Code tool call was blocked
Rolling out in stages
Enrollment is the mechanical part. Getting from “installed” to “enforcing” without breaking anyone’s work is the part worth pacing.Pilot (about a week)
Fleet enrollment (one to two weeks)
Observe (at least two weeks)
Enforce
Keeping it running
- New hires. A new device appears in your MDM and the enrollment policy runs on it. With Jamf or Kandji connected, the device reaches Lumos with the next nightly sync; otherwise include it in your next import. Keep the policy scoped to a dynamic group.
- Leavers. With Jamf or Kandji connected, a machine your MDM stops reporting is Retired on the next sync and its token stops working. To cut a machine off sooner, revoke it on the Devices tab.
- Token expiry. Devices already enrolled keep working when an enrollment token expires; new devices stop enrolling. Note the expiry date.
- Re-imaged or replaced machines. A wiped Mac that Lumos still lists as Enrolled cannot re-enroll: the script exits with “already enrolled, but no device token”. On the Devices tab, Revoke the device, then click Allow. The next policy run enrolls it with a fresh token. In Jamf, flush the computer’s entry in the policy Logs if the policy already ran on it.
- Lost, stolen or offboarded machines. Revoke the device on the Devices tab. Its token stops working immediately and nothing else in your fleet is affected.
Updating the hooks
When Lumos ships a new hook version, the hook config changelog says what changed and whether it asks anything of you beyond these steps. The Deployment tab shows which version each device reports.- macOS. The Claude Code and Codex hooks ship in the configuration profile. Download the profile from Deployment → MDM hooks → Update Hooks and replace the old one in your MDM. If you use the Claude Code-only profile, open Customize and paste the new Codex blocks over the old ones in your
requirements.toml. Cursor’s hooks update the next time the enrollment script runs, so keep the policy on a recurring schedule. - Windows. The enrollment script writes every hook itself, so there is nothing to upload. If you set
LUMOS_WRITE_HOOKSto0, download the new hook config from Update Hooks and deliver it as before. A script deployed as a Remediation picks up the new version on its next run. A platform script runs again when you save it again. - Per-user installs. MCP Tool Usage shows these as Self-serve under Hook source. Ask the people who installed from the per-user install page to run its install command again. Codex then asks them to trust the updated hooks in
/hooks. Only per-user installs cover Linux.