hooks.json, Claude Code settings.json, Codex requirements.toml, a GitHub Copilot policy hook file, 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
- GitHub Copilot
Generate For Windows, add
hooks.json for macOS or Linux. Cursor has no managed environment block, so every hook command carries the credentials and --env settings inline. Treat the file as a secret.--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.jsontoC:\ProgramData\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.jsontoC:\Program Files\ClaudeCode\managed-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.
Deploy Copilot policy hooks
Delivercopilot-hooks.json to Copilot’s policy directory. Copilot treats that directory as administrator policy: hooks there ignore disableAllHooks and run regardless of folder trust. Only the Copilot CLI reads the policy level.
- For a local trial, copy
copilot-hooks.jsonto~/.copilot/hooks/endor.json. Both the Copilot CLI and VS Code agent mode read that directory, but a developer can edit it. - On managed macOS and Linux machines, deliver it to
/etc/github-copilot/policy.d/endor.json, owned by root with mode0644. - On Windows, push it to
C:\ProgramData\GitHub\Copilot\policy.d\endor.jsonwith your MDM tool.
Update a deployment
The session hook installs endorctl on first use and checks for a newer version on later session starts. It verifies every downloaded binary with SHA-256. On macOS and Linux the hook never waits for the download. It hands the install or update to a background job and audits with the binary already on disk. A machine without endorctl skips the audit. The version check runs at most once a day. SetENDORCTL_UPDATE_TTL_MINUTES in the configuration’s environment variables to change that interval. On Windows the hook downloads during session start.
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 providesscripts/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, a Kandji Custom Script, or a JumpCloud Command. Edit the settings block at the top to pick the agent (cursor, claude, codex, or copilot) 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 come with macOS and Linux. - For
copilot, the runner writes/etc/github-copilot/policy.d/endor.jsonand creates the directory if needed. - Windows does not use the runner. Pre-generate the configuration and push it with Intune or your MDM tool.