Skip to content

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-policies

Auth: Bearer token (workspace member)


Policy values ​

ValueBehavior
allowTool runs without any confirmation prompt, even for tools that normally require approval
askTool always requires explicit user approval before running
blockTool 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 typeKey formatExample
Native Chainabit tool{domain}.{action}bits.delete
Connector toolconnector.{connectorKey}.{toolKey}connector.github.create_issue

Endpoints ​

GET /workspaces/:workspaceId/tool-policies ​

List all tool policies set for the workspace.

Request ​

Path ParameterDescription
workspaceIdWorkspace UUID

Response ​

json
[
  { "workspaceId": "ws-uuid", "toolKey": "bits.delete", "policy": "block" },
  { "workspaceId": "ws-uuid", "toolKey": "connector.github.create_issue", "policy": "ask" }
]

GET /workspaces/:workspaceId/tool-policies/effective ​

Inspect what is in force for every tool Chao can use in this workspace: the rules that apply, the strongest result, the tool's category and the safety floors that no rule waives. Clients use it to show a permissions list; it changes nothing.

Request ​

ParameterDescription
workspaceId (path)Workspace UUID
sessionId (query, optional)A session UUID you own. Includes that session's rules and lists session among the editable scopes. A value that is not a UUID returns 400.

Response ​

200 OK (this response is the object itself, with no data envelope):

json
{
  "workspaceId": "ws-uuid",
  "sessionId": null,
  "precedence": ["block", "ask", "allow"],
  "exactKeysOnly": true,
  "editableScopes": ["workspace"],
  "unsupportedScopes": ["global", "account"],
  "rows": [
    {
      "toolKey": "bits.delete",
      "title": "Delete Tasks",
      "sensitivity": "destructive",
      "effectivePolicy": "ask",
      "rules": [
        { "scope": "workspace", "policy": "ask", "inherited": true }
      ],
      "category": "work",
      "floors": {
        "mutates": true,
        "irreversible": true,
        "externalMutation": false,
        "externalMutationWaivableByAllow": false,
        "estimatedCostCredits": 0,
        "highCost": false
      },
      "safetyFloors": [
        "Plan mode blocks writes",
        "Ask mode confirms writes",
        "Destructive or irreversible actions require confirmation",
        "Actions with a high estimated credit cost require confirmation",
        "Rules never waive authorization, entitlements, budgets, or host safety"
      ]
    }
  ],
  "recentDenials": [],
  "recentDenialsSupported": true,
  "policyMeaning": "Effective rule is not execution approval. Action-specific safety and run mode are evaluated at dispatch."
}
FieldDescription
precedenceHow rules combine, strongest first: a block beats an ask, which beats an allow.
exactKeysOnlyRules match an exact tool key; there are no wildcards.
editableScopesThe scopes you may write now: workspace for workspace owners and admins, plus session when you pass sessionId.
unsupportedScopesScopes that do not exist: global and account.
highCostCreditFloorCredits at or above which one call always asks for confirmation. Read the current value from the response.
recentDenialsYour recent denied tool calls (toolKey, reason, occurredAt).

Each row describes one tool:

Row fieldDescription
toolKeyThe tool key; see Tool key format.
titleA display name.
sensitivityread, write or destructive.
effectivePolicyThe strongest policy of the rules, or null when no rule applies and the tool's own behavior decides.
rulesThe rules behind it. scope is tool_default, workspace or session; inherited is true for rules you did not set on this session.
categoryWhat the tool is for, one value from a closed list: work, content, personalization, web, agents_extensions, connectors, workspace, conversation, local_machine or other. other appears only for a stored rule whose tool is not registered right now.
floorsThe facts behind the safety floors, as booleans: mutates (Plan blocks it, Ask confirms it), irreversible (always confirms, whatever a rule says), externalMutation (changes something outside the platform and confirms unless an exact allow waives it, externalMutationWaivableByAllow), estimatedCostCredits and highCost (the estimate reaches highCostCreditFloor).
safetyFloorsThe same floors in words, for clients that show prose.

Tools that run on a person's own machine are not listed: their client governs them. An effective rule is not an approval: each action is checked again when it runs, and no rule waives authorization, entitlements, budgets or host safety.

Code Example ​

curl https://api.chainabit.com/api/v1/workspaces/YOUR_WS_ID/tool-policies/effective \
  -H "Authorization: Bearer $TOKEN"

PUT /workspaces/:workspaceId/tool-policies/:toolKey ​

Set or update a tool policy. Creates the row if it does not exist.

Request ​

Path ParameterDescription
workspaceIdWorkspace UUID
toolKeyThe tool key being configured (see Tool key format above)

Request body:

FieldTypeRequiredDescription
policy"allow" | "ask" | "block"YesThe policy to apply

Response ​

200 OK with the updated policy row.

Code Example ​

curl -X PUT https://api.chainabit.com/api/v1/workspaces/YOUR_WS_ID/tool-policies/bits.delete \
  -H "Authorization: Bearer $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 ParameterDescription
workspaceIdWorkspace UUID
toolKeyThe tool key whose policy should be removed

Response ​

204 No Content


Examples ​

text
# 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

Built with purpose. chainabit.com