Deploy Capsule Security hooks for AI coding assistants across your macOS fleet using Kandji MDM. This guide covers deployment for Cursor, GitHub Copilot, Claude Code, Devin (Windsurf), and Codex using Custom Apps.
- A Kandji tenant with administrative access
- A Capsule Security account with admin access
- Target devices running macOS
Deploy the Cursor hooks configuration using a Kandji Custom App.
- Log in to the Capsule Security portal
- Navigate to Settings > Integrations
- Locate the Cursor integration
- Download the
hooks.jsonfile
Log in to your Kandji tenant
Navigate to Library > Custom Apps
Click Add New and select Custom App
Configure the installation:
- Name: Capsule Security Cursor Hooks
- Install Type: Select ZIP File (unzip contents into specified directory)
- Unzip Location:
/Library/Application Support/Cursor/
Configure the Preinstall Script:
#!/bin/bash mkdir -p "/Library/Application Support/Cursor" chmod 755 "/Library/Application Support/Cursor"Create a ZIP archive containing the
hooks.jsonfile:zip hooks.zip hooks.jsonUpload the hooks.zip file to the Custom App
Assign the Custom App to the appropriate devices or Smart Groups
Deploy the configuration
After deployment, restart Cursor on target devices, then:
- Open Cursor Settings
- Navigate to the Hooks tab
- Confirm the hooks are listed and enabled
To remove the configuration from target devices, create a Kandji Custom Script library item that deletes the deployed file, then unassign the Custom App from the relevant devices or Smart Groups:
rm "/Library/Application Support/Cursor/hooks.json"Deploy the GitHub Copilot hooks configuration using a Kandji Custom App.
- Log in to the Capsule Security portal
- Navigate to Settings > Integrations
- Locate the GitHub Copilot integration
- Download the
hooks.jsonfile
Log in to your Kandji tenant
Navigate to Library > Custom Apps
Click Add New and select Custom App
Configure the installation:
- Name: Capsule Security GitHub Copilot Hooks
- Install Type: Select ZIP File (unzip contents into specified directory)
- Unzip Location:
/Library/Application Support/Code/User/hooks/
Configure the Preinstall Script:
#!/bin/bash mkdir -p "/Library/Application Support/Code/User/hooks" chmod 755 "/Library/Application Support/Code/User/hooks"Create a ZIP archive containing the
hooks.jsonfile:zip hooks.zip hooks.jsonUpload the hooks.zip file to the Custom App
Assign the Custom App to the appropriate devices or Smart Groups
Deploy the configuration
After deployment, restart VS Code on target devices, then:
- Right-click in the Chat view and select Diagnostics
- Confirm the hooks are loaded and enabled
To remove the configuration from target devices, create a Kandji Custom Script library item that deletes the deployed file, then unassign the Custom App from the relevant devices or Smart Groups:
rm "/Library/Application Support/Code/User/hooks/hooks.json"Deploy the Claude Code managed settings configuration using a Kandji Custom App.
- Log in to the Capsule Security portal
- Navigate to Settings > Integrations
- Locate the Claude Code integration
- Click Install and select macOS as the target platform
- Download the
managed-settings.jsonfile
Log in to your Kandji tenant
Navigate to Library > Custom Apps
Click Add New and select Custom App
Configure the installation:
- Name: Capsule Security Claude Code Hooks
- Install Type: Select ZIP File (unzip contents into specified directory)
- Unzip Location:
/Library/Application Support/ClaudeCode/
Configure the Preinstall Script:
#!/bin/bash mkdir -p "/Library/Application Support/ClaudeCode" chmod 755 "/Library/Application Support/ClaudeCode"Create a ZIP archive containing the
managed-settings.jsonfile:zip managed-settings.zip managed-settings.jsonUpload the managed-settings.zip file to the Custom App
Assign the Custom App to the appropriate devices or Smart Groups
Deploy the configuration
After deployment, restart Claude Code on target devices, then:
- Run
/hooksin Claude Code to confirm all hooks are listed - Start a session and verify events appear in the Capsule Security portal
To remove the configuration from target devices, create a Kandji Custom Script library item that deletes the deployed file, then unassign the Custom App from the relevant devices or Smart Groups:
rm "/Library/Application Support/ClaudeCode/managed-settings.json"Deploy the Devin (Windsurf) hooks configuration using a Kandji Custom App. The Cascade agent merges hook configurations from the system, user, and workspace levels (Cascade hooks documentation), so deploying to the system-level path applies the Capsule hooks to every user on the device.
- Log in to the Capsule Security portal
- Navigate to Settings > Integrations
- Locate the Devin (Windsurf) integration
- Choose MDM as the deployment method
- Select Mac as the target platform and download the
hooks.jsonfile
Log in to your Kandji tenant
Navigate to Library > Custom Apps
Click Add New and select Custom App
Configure the installation:
- Name: Capsule Security Windsurf Hooks
- Install Type: Select ZIP File (unzip contents into specified directory)
- Unzip Location:
/Library/Application Support/Windsurf/
Configure the Preinstall Script:
#!/bin/bash mkdir -p "/Library/Application Support/Windsurf" chmod 755 "/Library/Application Support/Windsurf"Create a ZIP archive containing the
hooks.jsonfile:zip hooks.zip hooks.jsonUpload the hooks.zip file to the Custom App
Assign the Custom App to the appropriate devices or Smart Groups
Deploy the configuration
After deployment, restart Devin Desktop on target devices, then:
- Open Devin Desktop settings
- Navigate to the Hooks tab and confirm the hooks are listed and enabled
- Start a Cascade session and verify the activity appears in the Capsule Security portal
To remove the configuration from target devices, create a Kandji Custom Script library item that deletes the deployed file, then unassign the Custom App from the relevant devices or Smart Groups:
rm "/Library/Application Support/Windsurf/hooks.json"Deploy the Codex managed configuration using a Kandji Custom App. Codex reads a managed requirements.toml from the system-wide path /etc/codex/requirements.toml; because the configuration is managed, the Capsule hooks are trusted by policy, apply to every user on the device (including users created later), and cannot be overridden or removed by users. No per-user trust approval is required.
- Log in to the Capsule Security portal
- Navigate to Settings > Integrations
- Locate the Codex integration
- Choose MDM as the deployment method
- Select Mac as the target platform and download the
requirements.tomlfile
Log in to your Kandji tenant
Navigate to Library > Custom Apps
Click Add New and select Custom App
Configure the installation:
- Name: Capsule Security Codex Managed Configuration
- Install Type: Select ZIP File (unzip contents into specified directory)
- Unzip Location:
/etc/codex/
Configure the Preinstall Script:
#!/bin/bash mkdir -p "/etc/codex" chmod 755 "/etc/codex"Create a ZIP archive containing the
requirements.tomlfile:zip requirements.zip requirements.tomlUpload the requirements.zip file to the Custom App
Assign the Custom App to the appropriate devices or Smart Groups
Deploy the configuration
Alternatively, Kandji can deliver the same configuration as a Custom Profile in the com.openai.codex preference domain, with the downloaded file's content base64-encoded into the requirements_toml_base64 key.
After deployment, close any running Codex CLI sessions on target devices, then:
- Start a new Codex CLI session so the managed configuration is loaded
- In the Capsule portal, navigate to Inventory > Agents and confirm the Codex agent appears
To remove the configuration from target devices, create a Kandji Custom Script library item that deletes the deployed file, then unassign the Custom App from the relevant devices or Smart Groups:
rm -f /etc/codex/requirements.toml- The preinstall scripts ensure target directories exist with proper permissions before file deployment
- Restart each application on target devices after deployment for hooks to take effect
- Updates can be deployed by modifying the Custom App and incrementing the version
- Use Kandji Smart Groups for dynamic targeting and staged rollouts
- All five integrations can be deployed as separate library items and assigned independently
- Codex uses a managed configuration (
/etc/codex/requirements.toml) enforced by policy - it applies to all users on the device and cannot be overridden by user-level configuration - Devin (Windsurf) merges system, user, and workspace hook configurations, so the system-level deployment coexists with any per-user hooks
For help with deployment:
- Email: support@capsule.security
- Include: Your organization ID, Kandji tenant details, and any error messages