Workspace Tool Policies
Control which AI tools are permitted, require approval, or are blocked within a workspace. Policies apply to both Chao sessions and the Chainabit MCP server.
Base path
/api/v1/workspaces/:workspaceId/tool-policiesAuth: Bearer token (workspace member)
Policy values
| Value | Behavior |
|---|---|
allow | Tool runs without any confirmation prompt, even for tools that normally require approval |
ask | Tool always requires explicit user approval before running |
block | Tool is disabled — any attempt to run it returns an error |
| (no row) | Default behavior — follows the tool's built-in requiresApproval flag |
Tool key format
| Tool type | Key format | Example |
|---|---|---|
| Native Chainabit tool | {domain}.{action} | bits.delete |
| Connector tool | connector.{connectorKey}.{toolKey} | connector.github.create_issue |
Endpoints
GET /workspaces/:workspaceId/tool-policies
List all tool policies set for the workspace.
Request
| Path Parameter | Description |
|---|---|
workspaceId | Workspace UUID |
Response
json
[
{ "workspaceId": "ws-uuid", "toolKey": "bits.delete", "policy": "block" },
{ "workspaceId": "ws-uuid", "toolKey": "connector.github.create_issue", "policy": "ask" }
]PUT /workspaces/:workspaceId/tool-policies/:toolKey
Set or update a tool policy. Creates the row if it does not exist.
Request
| Path Parameter | Description |
|---|---|
workspaceId | Workspace UUID |
toolKey | The tool key being configured (see Tool key format above) |
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
policy | "allow" | "ask" | "block" | Yes | The policy to apply |
Response
200 OK with the updated policy row.
Code Example
bash
curl -X PUT https://api.chainabit.com/api/v1/workspaces/YOUR_WS_ID/tool-policies/bits.delete \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"policy": "block"}'DELETE /workspaces/:workspaceId/tool-policies/:toolKey
Remove a tool policy. The tool reverts to its default behavior.
Request
| Path Parameter | Description |
|---|---|
workspaceId | Workspace UUID |
toolKey | The tool key whose policy should be removed |
Response
204 No Content
Examples
bash
# Block a destructive tool workspace-wide
PUT /workspaces/{id}/tool-policies/bits.delete
{ "policy": "block" }
# Require approval before creating GitHub issues
PUT /workspaces/{id}/tool-policies/connector.github.create_issue
{ "policy": "ask" }
# Explicitly allow a tool that has requiresApproval by default
PUT /workspaces/{id}/tool-policies/calendar.create_event
{ "policy": "allow" }
# Remove the policy (back to default behavior)
DELETE /workspaces/{id}/tool-policies/bits.delete