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

# Kill Switch API

> Emergency endpoints to halt agents, runs, or missions, and check kill state from the SDK.

The kill switch is an org-scoped emergency stop. Killing an `agent`, `run`, or `mission` causes the SDK's pre-execution check to refuse all further `@guarded_action` calls for that target until it is revived.

| Field                       | Description                                                      |
| --------------------------- | ---------------------------------------------------------------- |
| `target_type`               | `agent`, `run`, or `mission`                                     |
| `target_id`                 | The ID of the target (`agent_id`, `run_id`, etc.)                |
| `reason`                    | Optional, ≤2000 chars; surfaced in interventions and the console |
| `is_active`                 | True until the target is revived                                 |
| `killed_by` / `killed_at`   | User who killed the target and when                              |
| `revived_by` / `revived_at` | Set when the target is revived                                   |
| `organization_id`           | Kill switches are scoped per organization                        |

## Endpoints

All endpoints live under `/api/v1/kill-switch` and require either a session cookie (Clerk) or an API key (`Authorization: Bearer ...`).

### Kill a target

```http theme={null}
POST /api/v1/kill-switch/kill
Content-Type: application/json

{
  "target_type": "agent",
  "target_id": "rogue-bot",
  "reason": "Drained $3k in 4 minutes"
}
```

Returns the full `KillSwitchPublic` record. Returns `409 Conflict` if the target is already killed.

### Revive a target

```http theme={null}
POST /api/v1/kill-switch/revive
Content-Type: application/json

{
  "target_type": "agent",
  "target_id": "rogue-bot"
}
```

Returns `404 Not Found` if there is no active kill switch for the target.

### Check kill status (SDK)

```http theme={null}
GET /api/v1/kill-switch/check?target_type=agent&target_id=rogue-bot
```

The SDK calls this before each guarded action executes. Response:

```json theme={null}
{
  "is_killed": true,
  "target_type": "agent",
  "target_id": "rogue-bot",
  "reason": "Drained $3k in 4 minutes",
  "killed_at": "2026-04-18T17:00:00Z"
}
```

### List active kill switches

```http theme={null}
GET /api/v1/kill-switch/active?skip=0&limit=100
```

Returns all currently-active kill switches for the caller's organization, ordered by `killed_at` descending.

```json theme={null}
{
  "data": [
    {
      "id": "9f3c…",
      "target_type": "agent",
      "target_id": "rogue-bot",
      "reason": "Drained $3k in 4 minutes",
      "is_active": true,
      "killed_by": "usr_abc",
      "killed_at": "2026-04-18T17:00:00Z",
      "revived_by": null,
      "revived_at": null,
      "organization_id": "org_123"
    }
  ],
  "count": 1
}
```

## SDK behaviour

When the SDK's pre-action check returns `is_killed: true`, the next `@guarded_action` raises `PolicyViolationError` with a kill-switch reason — the action body never runs. All blocked attempts are recorded as `HARD_BLOCK` interventions referencing the killing user.

## Console

The console exposes `/kill-switch` as a top-level route — see [Console → Kill Switch](/console/kill-switch).

## See also

* [Console → Kill Switch](/console/kill-switch) — UI for killing and reviving targets
* [Platform → Interventions](/platform/interventions) — kill-switch blocks appear here
