hooks.json, Claude Code settings.json, Codex requirements.toml, or a macOS configuration profile for Claude Code or Codex. The generated hooks install and update endorctl when a coding agent session starts.
Before you begin
Complete the following tasks before you generate a configuration:- Complete the Coding Agent Governance prerequisites.
- Create an API key with the AI Audit User role.
- Identify the namespace that owns your Coding Agent Governance policies.
- For manual generation, install
giton the admin machine. The scripts run with system tools only. Creating a macOS configuration profile also requires macOS andplutil.
Generate a configuration in your browser
The browser generator assembles the configuration locally. Your API key, secret, namespace, and environment variable values are never sent to Endor Labs or GitHub. Use the manual generation steps below if the browser generator isn’t available or can’t fetch its source files.Generate a configuration manually
The Endor Labs MDM scripts repository is the authoritative source for the generator scripts. Clone the repository on an admin machine.- Cursor
- Claude Code
- Claude Code macOS profile
- Codex
- Codex macOS profile
Generate For Windows, add
hooks.json for macOS or Linux.--target-os windows. The generated hook uses an encoded PowerShell command that can run from Git Bash, PowerShell, or Command Prompt.Configure optional behavior
The generator enables the local response cache by default. Add--env ENDOR_AI_AUDIT_NO_BLOCKING=true to evaluate and record actions without blocking them.
--skip-endorctl-update if your fleet provisions endorctl separately and shouldn’t check for updates when a session starts.
Deploy the generated configuration
Deliver the generated file through your mobile device management (MDM) or configuration management tool.Deploy Cursor hooks
Delivercursor-hooks.json to the location that matches your deployment:
- For a local trial, copy
cursor-hooks.jsonto~/.cursor/hooks.json. - On managed macOS machines, deliver it to
/Library/Application Support/Cursor/hooks.json. - On managed Linux machines, deliver it to
/etc/cursor/hooks.json. - On Windows, push
cursor-hooks.jsonwith your MDM tool.
Deploy Claude Code settings
Deliver the generated Claude Code configuration to the location that matches your deployment:- For a local trial, copy
claude-settings.jsonto~/.claude/settings.json. - On managed Linux machines, deliver it to
/etc/claude-code/managed-settings.json. - On Windows, push
claude-settings.jsonwith your MDM tool. - On managed macOS machines, upload
com.anthropic.claudecode.mobileconfigas a custom profile.
Deploy Codex requirements
Deliver the generated Codex configuration to the location that matches your deployment:- On managed macOS and Linux machines, deliver
codex-requirements.tomlto/etc/codex/requirements.toml. - On managed macOS machines, you can instead upload
com.openai.codex.mobileconfigas a custom profile. - On Windows, push
codex-requirements.tomlto%ProgramData%\OpenAI\Codex\requirements.tomlwith your MDM tool.
Update a deployment
The session hook installs endorctl on first use and checks for updates during later session starts. It verifies the downloaded binary with SHA-256. Regenerate and redeploy the configuration when you change credentials, environment variables, or delivery settings. Server-side Coding Agent Governance policy changes don’t require a new configuration.Keep a fleet current with the scheduled runner
The mdm-scripts repository also shipsscripts/runner.sh, which replaces one-shot generation with a self-updating deployment on macOS and Linux. Paste it into your MDM as a recurring script body (a Jamf script, Kandji Custom Script, or JumpCloud Command) and edit the settings block at the top to pick the agent and pin a reviewed revision. On each run it fetches the repository at that revision, renders the configuration on the endpoint, and replaces the installed file atomically, only when the result changed. Repository, credential, and flag changes then roll out on the next scheduled run without a redeploy.
Keep the following in mind:
- The MDM must set
ENDOR_API_CREDENTIALS_KEY,ENDOR_API_CREDENTIALS_SECRET, andENDOR_NAMESPACEin the script’s environment. Use an API key with the AI Audit User role. - Endpoints need only
curlandtar, which ship with macOS and Linux. - Windows does not use the runner. Pre-generate the configuration and push it with Intune or your MDM tool.