$KILLSWITCH Integration Guide

← Home

Quick Start

Install the SDK in your AI agent project:

pip install killswitch-fence

Python Integration

Wrap your AI agent with the killswitch fence:

from killswitch import RuntimeFence

# Initialize the fence with your API key
fence = RuntimeFence(
    api_key="your_api_key",
    agent_id="your_agent_id"
)

# Wrap your agent's main function
@fence.guard
async def my_agent_action(prompt: str):
    # Your AI logic here
    response = await ai.generate(prompt)
    return response

# The fence automatically:
# - Checks if agent is allowed to run
# - Logs all actions for audit
# - Enforces rate limits
# - Can be killed remotely via dashboard

TypeScript/JavaScript Integration

Install via npm:

npm install @killswitch/sdk

Usage:

import { KillswitchClient } from '@killswitch/sdk';

const client = new KillswitchClient({
  apiKey: process.env.KILLSWITCH_API_KEY,
  agentId: 'your-agent-id'
});

// Check if agent is allowed to run
const canRun = await client.checkStatus();

if (canRun) {
  // Execute your agent logic
  await runAgentTask();
  
  // Log the action
  await client.logAction('task_completed', { result: 'success' });
}

API Reference

GET/api/v1/agent/status

Check if an agent is allowed to run

Returns: { status: 'active' | 'paused' | 'killed' }

POST/api/v1/agent/log

Log an action for audit trail

Body: { action: string, metadata: object }

POST/api/v1/agent/kill

Immediately terminate an agent

Body: { agent_id: string, reason?: string }

Dashboard

Access the dashboard to monitor and control your agents in real-time:

  • View all registered agents and their status
  • Pause or kill agents instantly
  • Monitor API usage and rate limits
  • View audit logs and action history
  • Set up alerts and notifications
Open Dashboard →

Token Holder Benefits

Hold $KILLSWITCH tokens to unlock discounts:

10K

tokens

10% off

100K

tokens

20% off

1M

tokens

40% off

1M+

tokens

2x votes

Support