# Kill Switch

The **Kill Switch** is a security feature of Sodot MPC Infra. It enables you to **instantly freeze all key operations** across your infrastructure with a single API call.

## What Is the Kill Switch?

The Kill Switch provides a fast, centralized mechanism to respond to threats by halting all API key signing activity. It is especially useful during:

* Security incidents or risk scenarios
* Unexpected trading behavior
* Unverified alerts from monitoring systems

:::info[Why This Matters]
With the Kill Switch, **you can instantly freeze all actions across all private keys**, buying precious time to investigate and recover.
:::

## How It Works

The Kill Switch is exposed via an authenticated [API endpoint](https://docs.sodot.dev/vertex-api-reference/#tag/admin/POST/admin/keys/freeze). When triggered, it blocks all signing activity for trading and transfer operations, either globally or for specific keys.

Only API keys with the `KeysFreezer` (or `SystemAdmin`) role can trigger or revoke the Kill Switch, ensuring that only authorized users or systems can control this capability.

### Integration Best Practice

We recommend integrating the Kill Switch into your risk monitoring and automation pipelines, for example triggering it in response to:

* Anomalies detected by your trading systems
* Internal operator panic buttons

## API Examples

### Freeze All Keys Across the Vertex

Call the [`keys/freeze`](https://docs.sodot.dev/vertex-api-reference/#tag/admin/POST/admin/keys/freeze) endpoint of each Vertex in your cluster:

```sh
curl -X POST https://vertex-x.example.com/admin/keys/freeze \
    -H "Authorization: <API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"freeze": "all"}'
```

### Freeze Specific Keys

To freeze specific keys, you can provide their identifiers in the request body:

```sh
curl -X POST https://vertex-x.example.com/admin/keys/freeze \
    -H "Authorization: <API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"freeze": "keys", "keys": [{"key_name": "key_name_1"}, {"key_name": "key_name_2"}]}'
```

### Unfreeze All Keys

To unfreeze all keys and restore normal operations, use the [`keys/unfreeze`](https://docs.sodot.dev/vertex-api-reference/#tag/admin/POST/admin/keys/unfreeze) endpoint:

```sh
curl -X POST https://vertex-x.example.com/admin/keys/unfreeze \
    -H "Authorization: <API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"unfreeze": "all"}'
```

### Unfreeze Specific Keys

To unfreeze specific keys, you can specify them in the request body:

```sh
curl -X POST https://vertex-x.example.com/admin/keys/unfreeze \
    -H "Authorization: <API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"unfreeze": "keys", "keys": [{"key_name": "key_name_1"}, {"key_name": "key_name_2"}]}'
```

## Summary

The Kill Switch is a **simple but powerful defense mechanism** that helps your team:

* React quickly to threats
* Minimize damage during risk scenarios
* Maintain operational control over high-value private keys

By making it programmable and role-restricted, the Kill Switch fits naturally into automated risk scenario remediation workflows.
