Skip to main content
The kill switch endpoint lets workspace admins instantly halt all agent activity or pause a specific tool. Base URL: https://<project-ref>.supabase.co/functions/v1/kill-switch Auth: Supabase user JWT. Caller must have admin or owner role.

Request

POST /functions/v1/kill-switch
Authorization: Bearer <supabase-jwt>
Content-Type: application/json

Body

FieldTypeRequiredDescription
workspaceIdstring (uuid)YesTarget workspace
actionstringYesenable, disable, pause_tool, or resume_tool
toolstringFor pause_tool / resume_toolOne of the valid tool names

Examples

curl -X POST \
  "https://<project-ref>.supabase.co/functions/v1/kill-switch" \
  -H "Authorization: Bearer <supabase-jwt>" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "your-workspace-uuid",
    "action": "enable"
  }'

Response

// Success
{ "ok": true }

// Error — not admin
{ "ok": false, "error": "Admin or owner role required" }

// Error — unsupported action
{ "ok": false, "error": "Unsupported action" }

Status codes

CodeMeaning
200Action applied successfully
400Invalid payload or unsupported action
401Not authenticated
403Admin or owner role required
405Method not allowed
500Database update failed

Side effects

Every kill switch call:
  1. Updates workspaces.kill_switch_enabled (for global) or tool_connections.paused (for tool pause)
  2. Writes an audit log entry with risk_level = critical
  3. Queues a notification for the kill_switch event (email + Slack if configured)