- Confirm Coding Agent Governance is available in your tenant.
- Create an API key with the AI Audit User role to deploy with hooks.
- Deploy hooks on developer machines. See Deploy hooks for Cursor, Claude Code, Codex, and GitHub Copilot.
- Review in-built policies and write any custom rules your organization needs. See Write a policy.
- Optional: See Connect the Anthropic Compliance API to let session policies match Claude Code developers by organization role or group.
Confirm Coding Agent Governance is available
Select Agent Governance from the left sidebar. If the entry is missing, contact your account team to enable Coding Agent Governance for your tenant.Create an API key with the AI Audit User role
The AI Audit User role is a least-privilege system role for Coding Agent Governance hooks. An API key with this role can submit hook events, read your policy snapshot for local evaluation, read the Coding Agent Governance inventory, and write operational client logs. It cannot read policy violations or any Endor Labs data outside Coding Agent Governance.Create the API key through the user interface
- Select User menu > Settings from the left sidebar.
- Select Access Control.
- Select API Keys, then click Generate API Key.
- Enter a name that identifies the key, such as
agent-governance-hooks. - Under Role, choose AI Audit User.
- Choose an expiration that matches your rotation policy.
- Click Generate, then copy the key and secret. Store both in your secret manager. Endor Labs shows the secret only once.
Create the API key with endorctl
For MDM-driven rollouts or automated provisioning, create the key with endorctl. Replace<namespace> with the namespace that owns your Coding Agent Governance policies, <key-name> with a descriptive name for the key, and <YYYY-MM-DDTHH:MM:SSZ> with the expiration in ISO 8601 UTC format.
spec.key and spec.secret. Capture both before the response scrolls out of your terminal. Endor Labs returns the secret only once.
See Create an API key through Endor Labs API for the full API reference, including longer expirations and namespace propagation.
Data collection
Each hook event carries the metadata Endor Labs needs for inventory and policy evaluation:- Agent name, version, and (where available) model
- Session and sub-session IDs
- Device (endpoint) identifier
- Session configuration, such as permission mode and sandbox state
- User identifier when the agent provides one
- Repository name (not populated for Claude Code sessions) and working directory
- MCP server name, tool name, and call counts
- Shell command line (regex-matched against your policies)
- File path and operation type (read, write, delete, edit)
- Secrets check match (rule, line, column, and fingerprint, never the secret value)
- Policy match outcome and the action applied
Secret redaction
Endor Labs runs every command line, file path, URL, environment value, and MCP tool input or output through a regex-based redactor before it leaves the developer’s machine. Environment variables and keys named like a secret (such asTOKEN, SECRET, API_KEY, PASSWORD, or AUTHORIZATION) become [REDACTED]. The redactor also matches common secret formats in place. These include URL and database-connection credentials, AWS access keys, JWTs, PEM private keys, and provider tokens such as GitHub (ghp_*), OpenAI, and Anthropic keys.
Redaction of event payloads is best-effort regex pattern matching. A secret that does not match a known pattern or key name can still reach the backend. The secrets check is separate from redaction: it detects secrets in file content on the developer’s machine, and its violations carry the rule and location, never the value. When an enabled secrets policy detects a secret, Endor Labs also scrubs the detected string from the stored event payload. The follow-up event recorded after a permitted file operation carries no file content.
Distribute credentials to developer machines
Hooks read credentials from environment variables wherever they run:ENDOR_API: The Endor Labs API endpoint, for examplehttps://api.endorlabs.com.ENDOR_NAMESPACE: The Endor Labs namespace that owns the policies and receives the events.ENDOR_API_CREDENTIALS_KEY: The API key value.ENDOR_API_CREDENTIALS_SECRET: The API secret.
env block of settings.json, as shown on Deploy hooks for Claude Code. Use your MDM (Jamf, Intune, Kandji, JumpCloud) to deliver the values, and to ensure endorctl is on PATH, on every machine that runs an Endor Labs hook.
Do not distribute ENDOR_TOKEN alongside these variables. Hooks authenticate with the API key and secret only, and on older versions of endorctl the extra token triggered a mixed-authentication error that blocked endorctl ai-audit.
See endorctl CLI to install endorctl.
Confirm supported agents and platforms
Coding Agent Governance hooks support Cursor, Claude Code, Codex, and GitHub Copilot on macOS, Linux, and Windows developer machines. See Supported agents and platforms for the full matrix, including hosted and CLI form factors.Next steps
After you complete the prerequisites, proceed to the next steps:- See Deploy hooks for Cursor, Claude Code, Codex, and GitHub Copilot to roll hooks out.
- See Write a policy to review the in-built catalog and add organization-specific rules.
- See Connect the Anthropic Compliance API to give Claude Code sessions an organization identity for policies.