Skip to main content
Coding Agent Governance configurations connect Cursor, Claude Code, and Codex events to Endor Labs. Use this page to generate hook configuration for individual machines or managed fleets. You can create Cursor 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 git on the admin machine. The scripts run with system tools only. Creating a macOS configuration profile also requires macOS and plutil.

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.
Set your credentials as environment variables. The generator reads these exact variable names, and prompts for any missing credential when you run it interactively.
Generate the configuration that matches your coding agent and deployment method.
Generate hooks.json for macOS or Linux.
For Windows, add --target-os windows. The generated hook uses an encoded PowerShell command that can run from Git Bash, PowerShell, or Command Prompt.
The generated configuration contains your API key and secret. Treat the output and its MDM policy as secrets. Restrict access and rotate the API key if someone exposes the configuration.

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.
Add --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

Deliver cursor-hooks.json to the location that matches your deployment:
  • For a local trial, copy cursor-hooks.json to ~/.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.json with your MDM tool.
See Deploy hooks for Cursor to verify the installation and review the registered hook events.

Deploy Claude Code settings

Deliver the generated Claude Code configuration to the location that matches your deployment:
  • For a local trial, copy claude-settings.json to ~/.claude/settings.json.
  • On managed Linux machines, deliver it to /etc/claude-code/managed-settings.json.
  • On Windows, push claude-settings.json with your MDM tool.
  • On managed macOS machines, upload com.anthropic.claudecode.mobileconfig as a custom profile.
See Deploy hooks for Claude Code to verify the installation and review the registered hook events.

Deploy Codex requirements

Deliver the generated Codex configuration to the location that matches your deployment:
  • On managed macOS and Linux machines, deliver codex-requirements.toml to /etc/codex/requirements.toml.
  • On managed macOS machines, you can instead upload com.openai.codex.mobileconfig as a custom profile.
  • On Windows, push codex-requirements.toml to %ProgramData%\OpenAI\Codex\requirements.toml with your MDM tool.
See Deploy hooks for Codex to verify the installation and review the registered hook events.

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 ships scripts/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, and ENDOR_NAMESPACE in the script’s environment. Use an API key with the AI Audit User role.
  • Endpoints need only curl and tar, 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.