> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endorlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy the Claude Cowork plugin

> <Badge color="green">Beta</Badge> <br /> Build an Endor Labs plugin for Claude Cowork and install it for your Claude organization to audit and govern Cowork tasks.

Claude Cowork tasks run in a cloud workspace, not on the member's laptop. No MDM profile or managed settings file reaches that workspace. Cowork loads the hooks of every plugin installed for the member. Endor Labs uses an organization plugin to govern Cowork.

The plugin carries the same hook events and policies as Claude Code. An organization Owner installs it once for every member.

## How the plugin differs from a configuration file

The plugin is a ZIP with five files:

* **`.claude-plugin/plugin.json`**: The plugin name and version.
* **`hooks/hooks.json`**: The hook events. It holds no credentials.
* **`scripts/endor-hook.sh`**: Loads `endor.env` and runs `endorctl ai-audit claudecode`.
* **`scripts/bootstrap.sh`**: Downloads endorctl into the workspace.
* **`endor.env`**: Your API URL, namespace, API key, and secret.

The plugin audits `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `ConfigChange`, and `Stop`. It applies the same policies as Claude Code.

The plugin doesn't include endorctl. The `SessionStart` hook downloads endorctl in the background at the start of every task. Hooks allow actions until the download finishes.

## Before you begin

Confirm the following requirements before you build the plugin:

* Your Claude organization is on a Team or Enterprise plan with Cowork and Skills turned on.
* An organization Owner is available to install the plugin.
* You have an API key with only the **AI Audit User** role. See [Prerequisites](https://docs.endorlabs.com/agent-governance/prerequisites.md) to create one.
* You know the namespace that owns your Coding Agent Governance policies.

> [!WARNING]
>
> Every member of your organization can read `endor.env` inside a Cowork task. Claude can read it too. Use an API key with only the **AI Audit User** role. Treat the ZIP as a secret.

## Build the plugin

Build the plugin with the [in-browser generator](https://docs.endorlabs.com/agent-governance/mdm-deployment.md#generate-a-configuration-in-your-browser).

1. Choose **Claude Cowork (organization plugin)** as the agent.
2. Enter your namespace, API key, and API secret.
3. Optional: Enter your tenant's API URL in **API URL** if it isn't `https://api.endorlabs.com`.
4. Click **Download** to save `endor-cowork-governance.zip`.

Enter the namespace itself, such as `acme.engineering`. The generator rejects a namespace that contains `/` or `:`. The API URL goes in its own field.

To build the plugin on an admin machine instead, run `scripts/render.sh` from the [MDM scripts repository](https://github.com/endorlabs/mdm-scripts/tree/main/agent-governance). The build needs a POSIX shell and `zip`.

```bash theme={null}
git clone https://github.com/endorlabs/mdm-scripts
cd mdm-scripts/agent-governance
scripts/render.sh --agent claude-cowork \
  --api-key "$ENDOR_API_CREDENTIALS_KEY" \
  --api-secret "$ENDOR_API_CREDENTIALS_SECRET" \
  --namespace "$ENDOR_NAMESPACE" \
  -o endor-cowork-governance.zip
```

The plugin takes no target OS. The Cowork workspace always runs Linux. The `--env` and `--skip-endorctl-update` options work as for the other agents and go into `endor.env`. Add `--env ENDOR_AI_AUDIT_NO_BLOCKING=true` for a monitor-only start.

To build the plugin as a directory for a private repository, pass a directory path to `-o` instead of a `.zip` path. The directory must be new or empty.

## Install the plugin for your organization

An organization Owner installs the plugin in the Claude organization settings.

1. Open **Organization settings** > **Plugins & skills** in Claude.
2. Upload `endor-cowork-governance.zip`, or sync a private GitHub repository that holds the plugin directory.
3. Set the plugin to **Required**.

A **Required** plugin installs for every member. Members can't turn it off or remove it. Keep one copy installed. A member who also uploads the plugin personally records every event twice.

A synced repository picks up a change only after the `version` in `.claude-plugin/plugin.json` goes up. Claude refuses a public repository.

## Allow the Endor Labs API host

The Cowork workspace reaches the internet through a proxy that enforces your organization's allowed domains. An Enterprise organization that restricts network access blocks the Endor Labs API by default.

1. Open **Organization settings** > **Capabilities** in Claude.
2. Add the host of your API URL to the allowed domains for network access. The default host is `api.endorlabs.com`.
3. Start a new task. A running task keeps the list it started with.

The plugin downloads endorctl from the same API URL that receives its events. `*.endorlabs.com` covers every Endor Labs API host.

## Verify the plugin

Check the events in Endor Labs. Claude's own summary of what a hook did isn't reliable.

1. As a member who never installed the plugin personally, open the **Cowork** tab in Claude.
2. Start a task and send a short prompt. This starts the endorctl download.
3. After about two minutes, ask Claude to run `ls -la ~/.endorctl; ~/.endorctl/endorctl --version` in the cloud workspace. A version number means endorctl is ready.
4. Send a prompt that uses a tool, such as `List the files in the current folder.`
5. Send another prompt a minute later. endorctl sends queued events only during a later hook.
6. List the hook events in your namespace.

   ```bash theme={null}
   endorctl api list -r AgentHookEvent -n "$ENDOR_NAMESPACE" --list-all
   ```

   Each event names the member's email address as the user.

An empty `~/.endorctl` means the workspace can't reach the Endor Labs API. See [Allow the Endor Labs API host](#allow-the-endor-labs-api-host) to fix the network access.

An installed endorctl with no events in Endor Labs means the sends are failing. Look for queued rows in `~/.endorctl/aigovernance/localdb/` in the workspace. Check the namespace and the role of the API key.

## Update the plugin

Rebuild and upload the plugin again after any of the following changes:

* You rotate the API key or secret.
* You change the namespace or the API URL.
* You change the environment variables or the skip-update choice.
* The MDM scripts repository publishes a new release of the plugin.

For a synced repository, commit the new files and raise the `version` in `.claude-plugin/plugin.json`.

Server-side policy changes need no new plugin. Each task downloads the current endorctl release. endorctl updates need no new plugin either.

## Known limitations

The Cowork plugin has the following limitations:

* **Start of each task**: Hooks allow actions until endorctl finishes downloading. About the first minute of every task isn't audited. A scheduled task can act inside that window.
* **End of each task**: Closing the workspace discards any events still in the queue. Cowork has no `SessionEnd` hook yet.
* **Claude Chat**: Chat ignores plugin hooks. Connector calls and code runs in Chat are neither blocked nor recorded.
* **Claude Code on laptops**: A **Required** plugin also syncs to each member's Claude Code. Its hooks exit without auditing in a Claude Code session on a laptop. Deploy the [Claude Code hooks](https://docs.endorlabs.com/agent-governance/claude-code.md) to govern those sessions.
* **Hooks fail open**: A hook that crashes or times out allows the action, as on every other agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.