# Takeover protection

Per-agent baselines, takeover verdicts, the owner's responses and the settings.

Related guide: [Prevent agent takeover](https://provenanceauth.com/docs/mandate/guides/protect-agents-from-takeover.md)

## Endpoints

- `GET /v1/mandate/agents/{id}/takeover`: [Read an agent's takeover verdict](#get-v1-mandate-agents-id-takeover)
- `GET /v1/mandate/settings/takeover_protection`: [Read takeover protection settings](#get-v1-mandate-settings-takeover-protection)
- `GET /v1/mandate/takeover_events/{id}`: [Read a takeover event](#get-v1-mandate-takeover-events-id)
- `PUT /v1/mandate/settings/takeover_protection`: [Change takeover protection settings](#put-v1-mandate-settings-takeover-protection)
- `GET /v1/mandate/takeover_events`: [List takeover events](#get-v1-mandate-takeover-events)
- `POST /v1/mandate/takeover_events/{id}/clear`: [This was us](#post-v1-mandate-takeover-events-id-clear)
- `POST /v1/mandate/takeover_events/{id}/lock_down`: [Lock it down](#post-v1-mandate-takeover-events-id-lock-down)
- `POST /v1/mandate/takeover_events/{id}/recover`: [Resume a locked-down agent](#post-v1-mandate-takeover-events-id-recover)

## The takeover event object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | Unique identifier for the object. |
| `object` | enum | no | The type of object. One of `takeover_event`. |
| `agent_id` | string | no | The agent. |
| `risk` | enum | no | The verdict: one signal is `elevated`; two, or `split_use` or `key_leaked` alone, is `high`. One of `elevated`, `high`. |
| `reasons` | array of enums | no | The reason codes, sorted. |
| `signals` | array of objects | no | Each signal with a sentence for the owner. |
| `signals.signal` | string | no | The reason code. |
| `signals.detail` | string | no | What happened. |
| `signals.network_families` | array of objects | no | The networks involved, for network signals. |
| `signals.network_families.family` | string | no | `cloud:<provider>` or `net:<period>:<hash>`. |
| `signals.network_families.named` | boolean | no | Whether it's a named cloud provider. |
| `signals.network_families.label` | string | no | What the console shows (`Amazon Web Services`, `Network 6f1c2a`). |
| `action` | enum | no | What the account's settings chose for this risk. One of `flag`, `step_up`, `suspend`, `lockdown`. |
| `shadow` | boolean | no | Recorded in shadow mode: nothing was enforced and nobody was notified. |
| `status` | enum | no | Where the event stands. One of `open`, `cleared`, `locked_down`, `recovered`. |
| `response` | enum | no | The owner's answer. One of `this_was_us`, `lock_it_down`. |
| `responded_at` | string \| null | no | When the owner answered. |
| `api_key_id` | string \| null | no | The API key that acted when the event opened. |
| `signing_key_id` | string \| null | no | The agent signing key that acted, for Identify traffic. |
| `compromised_key_ids` | array of strings | no | Keys a lockdown took out of service; they stay revoked. |
| `network_families` | array of objects | no | Every network the signals name. |
| `network_families.family` | string | no | `cloud:<provider>` or `net:<period>:<hash>`. |
| `network_families.named` | boolean | no | Whether it's a named cloud provider. |
| `network_families.label` | string | no | What the console shows (`Amazon Web Services`, `Network 6f1c2a`). |
| `console_url` | string | no | The event in the console. |
| `window_start` | string | no | When the first signal was raised. |
| `created_at` | string | no | When it was created. |
| `updated_at` | string | no | When it last changed. |

### Example

```json
{
  "id": "tko_01M5XPDJXQR46KYMS99XT98SBT",
  "object": "takeover_event",
  "agent_id": "agt_01M5XPDJXQR46KYMS99XT98SBT",
  "risk": "high",
  "reasons": [
    "new_network",
    "rate_spike"
  ],
  "signals": [
    {
      "signal": "new_network",
      "detail": "Activity from a network this agent hasn't used in the last 14 days.",
      "network_families": [
        {
          "family": "net:730:6f1c2a9be04d7713",
          "named": false,
          "label": "Network 6f1c2a"
        }
      ]
    },
    {
      "signal": "rate_spike",
      "detail": "25 authorizations this hour, against a usual 4 an hour."
    }
  ],
  "action": "step_up",
  "shadow": false,
  "status": "open",
  "response": null,
  "responded_at": null,
  "api_key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
  "signing_key_id": null,
  "compromised_key_ids": [],
  "network_families": [
    {
      "family": "net:730:6f1c2a9be04d7713",
      "named": false,
      "label": "Network 6f1c2a"
    }
  ],
  "console_url": "http://localhost:5173/mandate/agents?tab=takeover&event=tko_01M5XPDJXQR46KYMS99XT98SBT",
  "window_start": "2026-10-30T12:00:00.000Z",
  "created_at": "2026-10-30T12:00:00.000Z",
  "updated_at": "2026-10-30T12:04:00.000Z"
}
```

## Events

Sent to your [webhook endpoints](https://provenanceauth.com/docs/integrate/webhooks.md) when they subscribe:

- `mandate.agent.takeover_suspected`

## Read an agent's takeover verdict

`GET /v1/mandate/agents/{id}/takeover`

The agent's takeover risk and reasons, its learning period, a summary of its baseline, the keys earlier lockdowns took out of service, and its takeover history.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Your agent's ID. |

### Returns

The agent's verdict.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "invoice-bot" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/agents/$AGENT_ID/takeover" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "invoice-bot" }),
})).json();
const agentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents/${agentId}/takeover`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "invoice-bot"
}).json()
agent_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/agents/{agent_id}/takeover", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "agent_takeover",
  "agent_id": "agt_01M6VQBCJRRTR1RC0DXETH88Z7",
  "takeover_risk": "learning",
  "takeover_reasons": [],
  "learning_until": null,
  "active_event": null,
  "baseline": {
    "hours_observed": 0,
    "network_families": 0,
    "action_types": 0,
    "authorizations": 0
  },
  "compromised_key_ids": [],
  "history": []
}
```

## Read takeover protection settings

`GET /v1/mandate/settings/takeover_protection`

What happens when an agent looks taken over: the action per risk, enforce or shadow mode, and whether leaked live keys are revoked or only reported.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The settings.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/takeover_protection" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/takeover_protection`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/mandate/settings/takeover_protection", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "takeover_protection",
  "mode": "enforce",
  "elevated_action": "flag",
  "high_action": "step_up",
  "leaked_live_keys": "revoke",
  "updated_at": null
}
```

## Read a takeover event

`GET /v1/mandate/takeover_events/{id}`

One suspected takeover: the verdict, each signal with its network families, the action, and the owner's response.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The event's ID (`tko_…`). |

### Returns

The event. See [the takeover event object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "tko_01M5XPDJXQR46KYMS99XT98SBT",
  "object": "takeover_event",
  "agent_id": "agt_01M5XPDJXQR46KYMS99XT98SBT",
  "risk": "high",
  "reasons": [
    "new_network",
    "rate_spike"
  ],
  "signals": [
    {
      "signal": "new_network",
      "detail": "Activity from a network this agent hasn't used in the last 14 days.",
      "network_families": [
        {
          "family": "net:730:6f1c2a9be04d7713",
          "named": false,
          "label": "Network 6f1c2a"
        }
      ]
    },
    {
      "signal": "rate_spike",
      "detail": "25 authorizations this hour, against a usual 4 an hour."
    }
  ],
  "action": "step_up",
  "shadow": false,
  "status": "open",
  "response": null,
  "responded_at": null,
  "api_key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
  "signing_key_id": null,
  "compromised_key_ids": [],
  "network_families": [
    {
      "family": "net:730:6f1c2a9be04d7713",
      "named": false,
      "label": "Network 6f1c2a"
    }
  ],
  "console_url": "http://localhost:5173/mandate/agents?tab=takeover&event=tko_01M5XPDJXQR46KYMS99XT98SBT",
  "window_start": "2026-10-30T12:00:00.000Z",
  "created_at": "2026-10-30T12:00:00.000Z",
  "updated_at": "2026-10-30T12:04:00.000Z"
}
```

## Change takeover protection settings

`PUT /v1/mandate/settings/takeover_protection`

Owners and admins, from a console session (an API key is refused, so a stolen key can't turn protection off). Send only the fields to change.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | body | enum | no | `shadow` records what would have happened and changes nothing. One of `enforce`, `shadow`. |
| `elevated_action` | body | enum | no | What an `elevated` verdict does (default `flag`). One of `flag`, `step_up`. |
| `high_action` | body | enum | no | What a `high` verdict does (default `step_up`). One of `flag`, `step_up`, `suspend`, `lockdown`. |
| `leaked_live_keys` | body | enum | no | What a reported live API key does (default `revoke`). One of `revoke`, `notify_only`. |

### Returns

The settings.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`recent_two_factor_required`](https://provenanceauth.com/docs/platform/errors.md#recent_two_factor_required)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X PUT "$PROVENANCE_API/v1/mandate/settings/takeover_protection" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "shadow" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/takeover_protection`, {
  method: "PUT",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ "mode": "shadow" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/settings/takeover_protection", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
    "mode": "shadow"
}).json()
```

### Response 200

```json
{
  "object": "takeover_protection",
  "mode": "shadow",
  "elevated_action": "flag",
  "high_action": "step_up",
  "leaked_live_keys": "revoke",
  "updated_at": "2026-10-30T12:00:00.000Z"
}
```

## List takeover events

`GET /v1/mandate/takeover_events`

Suspected takeovers, newest first, including shadow-mode events (`shadow: true`).

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agent_id` | query | string | no | Only this agent's events. |
| `status` | query | string | no | Comma-separated statuses: open, cleared, locked_down, recovered. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |

### Returns

A page of takeover events.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/takeover_events" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/takeover_events`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/mandate/takeover_events", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## This was us

`POST /v1/mandate/takeover_events/{id}/clear`

Trust the event's networks, clear its other signals for 2 hours, resume an agent the event suspended, and record the answer in the ledger. Owners and admins, from a console session.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The event's ID (`tko_…`). |

### Returns

The cleared event. See [the takeover event object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`recent_two_factor_required`](https://provenanceauth.com/docs/platform/errors.md#recent_two_factor_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`takeover_event_closed`](https://provenanceauth.com/docs/platform/errors.md#takeover_event_closed)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/clear" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/clear`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/clear", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}).json()
```

### Response 200

```json
{
  "id": "tko_01M5XPDJXQR46KYMS99XT98SBT",
  "object": "takeover_event",
  "agent_id": "agt_01M5XPDJXQR46KYMS99XT98SBT",
  "risk": "high",
  "reasons": [
    "new_network",
    "rate_spike"
  ],
  "signals": [
    {
      "signal": "new_network",
      "detail": "Activity from a network this agent hasn't used in the last 14 days.",
      "network_families": [
        {
          "family": "net:730:6f1c2a9be04d7713",
          "named": false,
          "label": "Network 6f1c2a"
        }
      ]
    },
    {
      "signal": "rate_spike",
      "detail": "25 authorizations this hour, against a usual 4 an hour."
    }
  ],
  "action": "step_up",
  "shadow": false,
  "status": "cleared",
  "response": "this_was_us",
  "responded_at": "2026-10-30T12:06:00.000Z",
  "api_key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
  "signing_key_id": null,
  "compromised_key_ids": [],
  "network_families": [
    {
      "family": "net:730:6f1c2a9be04d7713",
      "named": false,
      "label": "Network 6f1c2a"
    }
  ],
  "console_url": "http://localhost:5173/mandate/agents?tab=takeover&event=tko_01M5XPDJXQR46KYMS99XT98SBT",
  "window_start": "2026-10-30T12:00:00.000Z",
  "created_at": "2026-10-30T12:00:00.000Z",
  "updated_at": "2026-10-30T12:04:00.000Z"
}
```

## Lock it down

`POST /v1/mandate/takeover_events/{id}/lock_down`

Suspend the agent, revoke its sessions and outstanding tokens, and list the API keys and signing keys to rotate (`rotation`). Counts as an owner-confirmed takeover on the agent's network record.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The event's ID (`tko_…`). |

### Returns

The locked-down event, what was revoked, and the keys to rotate.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`takeover_event_closed`](https://provenanceauth.com/docs/platform/errors.md#takeover_event_closed)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/lock_down" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/lock_down`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/lock_down", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}).json()
```

### Response 200

```json
{
  "id": "tko_01M5XPDJXQR46KYMS99XT98SBT",
  "object": "takeover_event",
  "agent_id": "agt_01M5XPDJXQR46KYMS99XT98SBT",
  "risk": "high",
  "reasons": [
    "new_network",
    "rate_spike"
  ],
  "signals": [
    {
      "signal": "new_network",
      "detail": "Activity from a network this agent hasn't used in the last 14 days.",
      "network_families": [
        {
          "family": "net:730:6f1c2a9be04d7713",
          "named": false,
          "label": "Network 6f1c2a"
        }
      ]
    },
    {
      "signal": "rate_spike",
      "detail": "25 authorizations this hour, against a usual 4 an hour."
    }
  ],
  "action": "step_up",
  "shadow": false,
  "status": "locked_down",
  "response": "lock_it_down",
  "responded_at": "2026-10-30T12:06:00.000Z",
  "api_key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
  "signing_key_id": null,
  "compromised_key_ids": [
    "key_2V1RD54F2D9SFRMTVWHPF0Y6HB"
  ],
  "network_families": [
    {
      "family": "net:730:6f1c2a9be04d7713",
      "named": false,
      "label": "Network 6f1c2a"
    }
  ],
  "console_url": "http://localhost:5173/mandate/agents?tab=takeover&event=tko_01M5XPDJXQR46KYMS99XT98SBT",
  "window_start": "2026-10-30T12:00:00.000Z",
  "created_at": "2026-10-30T12:00:00.000Z",
  "updated_at": "2026-10-30T12:04:00.000Z",
  "revoked": {
    "sessions": 3,
    "tokens": 25
  },
  "rotation": [
    {
      "key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
      "kind": "api_key",
      "rotated": false,
      "how": "POST /v1/account/keys/{id}/rotate_secret with this key id (Developers → API keys → Rotate)"
    }
  ]
}
```

## Resume a locked-down agent

`POST /v1/mandate/takeover_events/{id}/recover`

Once every key in `compromised_key_ids` is rotated or revoked: resume the agent with a fresh baseline (the hours since the first signal are dropped; older ones stay). The keys stay revoked.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The event's ID (`tko_…`). |

### Returns

The recovered event. See [the takeover event object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`recent_two_factor_required`](https://provenanceauth.com/docs/platform/errors.md#recent_two_factor_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`takeover_event_closed`](https://provenanceauth.com/docs/platform/errors.md#takeover_event_closed)
- [`takeover_rotation_incomplete`](https://provenanceauth.com/docs/platform/errors.md#takeover_rotation_incomplete)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/recover" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/recover`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/takeover_events/tko_01M5XPDJXQR46KYMS99XT98SBT/recover", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}).json()
```

### Response 200

```json
{
  "id": "tko_01M5XPDJXQR46KYMS99XT98SBT",
  "object": "takeover_event",
  "agent_id": "agt_01M5XPDJXQR46KYMS99XT98SBT",
  "risk": "high",
  "reasons": [
    "new_network",
    "rate_spike"
  ],
  "signals": [
    {
      "signal": "new_network",
      "detail": "Activity from a network this agent hasn't used in the last 14 days.",
      "network_families": [
        {
          "family": "net:730:6f1c2a9be04d7713",
          "named": false,
          "label": "Network 6f1c2a"
        }
      ]
    },
    {
      "signal": "rate_spike",
      "detail": "25 authorizations this hour, against a usual 4 an hour."
    }
  ],
  "action": "step_up",
  "shadow": false,
  "status": "recovered",
  "response": "lock_it_down",
  "responded_at": "2026-10-30T12:06:00.000Z",
  "api_key_id": "key_2V1RD54F2D9SFRMTVWHPF0Y6HB",
  "signing_key_id": null,
  "compromised_key_ids": [
    "key_2V1RD54F2D9SFRMTVWHPF0Y6HB"
  ],
  "network_families": [
    {
      "family": "net:730:6f1c2a9be04d7713",
      "named": false,
      "label": "Network 6f1c2a"
    }
  ],
  "console_url": "http://localhost:5173/mandate/agents?tab=takeover&event=tko_01M5XPDJXQR46KYMS99XT98SBT",
  "window_start": "2026-10-30T12:00:00.000Z",
  "created_at": "2026-10-30T12:00:00.000Z",
  "updated_at": "2026-10-30T12:04:00.000Z"
}
```
