Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
kill
Emergency Kill Switch
curl --request POST \
  --url https://api.truthlocks.com/v1/agents/{agentId}/kill \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "reason": "<string>",
  "cascade": false
}
'
import requests

url = "https://api.truthlocks.com/v1/agents/{agentId}/kill"

payload = {
    "reason": "<string>",
    "cascade": False
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({reason: '<string>', cascade: false})
};

fetch('https://api.truthlocks.com/v1/agents/{agentId}/kill', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.truthlocks.com/v1/agents/{agentId}/kill",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'reason' => '<string>',
    'cascade' => false
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "X-API-Key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.truthlocks.com/v1/agents/{agentId}/kill"

	payload := strings.NewReader("{\n  \"reason\": \"<string>\",\n  \"cascade\": false\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/agents/{agentId}/kill")
  .header("X-API-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"<string>\",\n  \"cascade\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.truthlocks.com/v1/agents/{agentId}/kill")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"<string>\",\n  \"cascade\": false\n}"

response = http.request(request)
puts response.read_body
{
  "agent": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "display_name": "<string>",
    "description": "<string>",
    "scopes": [
      "<string>"
    ],
    "metadata": {},
    "trust_score": 0.5,
    "public_key": "<string>",
    "session_count": 123,
    "keys": [
      {
        "kid": "<string>",
        "algorithm": "<string>",
        "public_key": "<string>"
      }
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  },
  "terminated_sessions": 123
}
{
  "code": "AUTH_REQUIRED",
  "message": "Authentication required",
  "http_status": 401
}
{
  "code": "AUTH_REQUIRED",
  "message": "Authentication required",
  "http_status": 401
}
{
  "code": "AUTH_REQUIRED",
  "message": "Authentication required",
  "http_status": 401
}
{
  "code": "AUTH_REQUIRED",
  "message": "Authentication required",
  "http_status": 401
}
Activates the emergency kill switch for an agent. This is a destructive, irreversible operation that immediately:
  1. Revokes the agent — sets the agent status to revoked, preventing all future API calls
  2. Terminates all active sessions — forcibly ends every session associated with the agent
  3. Voids pending receipts — marks all unfinalized receipts as voided to prevent downstream reliance on incomplete data
The kill switch is designed for critical security incidents where an agent must be immediately neutralized — such as confirmed credential compromise, detected malicious behavior, or regulatory emergency shutdown orders.
Irreversible Operation. Agent revocation via kill switch cannot be undone. A new agent must be registered to resume operations. All voided receipts are permanently marked and cannot be restored.

Audit Trail

The kill switch activation generates a killswitch.activated event with full details, a transparency-log receipt anchoring the revocation, and notifications to all configured webhook endpoints and SIEM integrations.

Authentication

X-API-Key
string
required
API key with agents:kill scope. This is a privileged scope typically restricted to security team keys. Alternatively, pass a Bearer JWT token with the security-admin role.
X-Tenant-ID
string
required
Tenant identifier for multi-tenant isolation.

Path Parameters

id
string
required
Agent identifier to kill (e.g. maip-agent:01HXYZ9A1B2C3D4E5F).

Request

reason
string
required
Mandatory explanation for the kill switch activation. Recorded in the audit trail and included in all notifications.
operator_id
string
Identifier of the human operator or automated system that initiated the kill. If omitted, the API key identity is used.

Response

agent_id
string
The revoked agent identifier.
agent_status
string
Agent status after kill switch: revoked.
sessions_terminated
integer
Number of active sessions that were forcibly terminated.
receipts_voided
integer
Number of pending receipts that were voided.
reason
string
The reason provided for the kill switch activation.
operator_id
string
The operator who initiated the kill.
receipt_id
string
Transparency-log receipt anchoring the kill switch event.
killed_at
string
ISO 8601 timestamp of the kill switch activation.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Path Parameters

agentId
string<uuid>
required

Agent identifier

Body

application/json
reason
string
required

Reason for emergency kill

cascade
boolean
default:false

If true, also kill all agents this agent delegated to

Response

Agent killed

agent
object
terminated_sessions
integer

Number of sessions terminated