Skip to main content
The kill switch lets you immediately block an agent from making any LLM requests through the MeshAI proxy. Blocks are cached in Redis for instant enforcement - the proxy returns 403 Forbidden for any request from a blocked agent.

How It Works

  1. You call POST /agents/{id}/block with a reason.
  2. The API writes the block to the database and publishes it to Redis.
  3. The proxy checks Redis on every incoming request - blocked agents get an immediate 403.
  4. An agent.blocked audit event is emitted automatically.
  5. To restore access, call POST /agents/{id}/unblock - an agent.unblocked event is emitted.

Block an Agent

Unblock an Agent

What the Agent Sees

When a blocked agent sends a request through the proxy, it receives:
This is compatible with all LLM SDK error handling - OpenAI, Anthropic, and other clients will raise their standard authentication/permission errors.

Audit Trail

Every block and unblock action emits an audit event: Query block-related audit events:

Enforcement Architecture

The kill switch uses Redis for sub-millisecond enforcement:
  • Write path: API writes block to PostgreSQL and publishes to Redis.
  • Read path: Proxy checks Redis on every request (before policy evaluation).
  • Fail-open: If Redis is unavailable, the proxy falls back to allowing the request (same as policy cache behavior).
  • Latency: Block takes effect within milliseconds of the API call.

Use Cases

  • Incident response - Immediately stop a compromised or malfunctioning agent.
  • Cost containment - Block an agent that is burning through budget unexpectedly.
  • Compliance - Emergency shutdown to satisfy regulatory requirements (EU AI Act Article 14).
  • Anomaly response - Automated block triggered by anomaly detection (coming soon).