Skip to content
Blogs

Designing Kill Switches for AI Features

· 20 min read

If you cannot disable an AI capability within minutes without redeploying, you are not ready for irreversible actions. Staff engineers wire kill switches into model routes, tool writes, and queues; define propagation SLAs; test the dark path in CI; and pair switches with tripwires that fail toward safety.

A flag is not a kill switch until it stops blast radius

Feature flags that only hide a button leave model calls, tool invocations, webhooks, and queued side effects running. A true kill switch disables the capability path: no new generations, no tool writes, no outbound messages, and a deterministic non-AI path for checkout, auth, and export.

Design the switch before launch, not during the first incident. Name the owner, default safe state, propagation SLA, and user-facing copy when AI is off. If flipping the switch requires a redeploy, you have a hope—not a control plane.

Kill state must be readable at the edge Worker, API gateway, background job consumer, and mobile client feature bundle. Expo apps that cache assistant availability locally need a remote config or polling hook so kills propagate without waiting for App Store review.

Document which dependencies ignore your switch. Third-party model routes, Zapier-style integrations, and cron reconcilers are common leaks. Each leak gets its own sub-switch or an explicit "not killable" risk acceptance signed by product.

Audit logs should record actor, scope, previous state, and reason code. Post-incident reviews fail when teams cannot tell whether AI was actually off or only invisible in the UI.

Supabase edge functions and Cloudflare Workers should read kill state on every AI route—not only the Next.js origin. Static export hosting means there is no long-lived server process; the switch lives in config your Worker fetches or caches with a short TTL tied to the SLA.

Scope by risk, not vanity granularity

Prefer a small number of well-tested switches over dozens of half-wired toggles. Useful scopes include: all AI for a tenant, a single high-stakes action type, model route A versus fallback B, and tool writes versus read-only assistance. Each switch maps to a blast radius you can explain in an incident channel in one sentence.

Avoid per-prompt switches unless operations can reason about them under stress. Incident commanders need coarse levers first; fine-grained toggles come after stabilization.

| Scope | Typical use | Fail-safe default | | --- | --- | --- | | Global AI off | Provider outage, policy emergency | Hard stop | | Tenant AI off | Abuse, contract suspension | Hard stop | | Write tools off | Grounding incident | Soft degrade reads | | Model route B | Quality regression on route A | Soft degrade |

Map scopes to on-call runbooks. If a scope lacks a runbook section, it is not production-ready regardless of how clever the flag UI looks.

Review scopes quarterly when new tools ship. Copilots accumulate capabilities faster than flags unless platform owners prune the matrix deliberately.

During incidents, prefer one coarse flip that definitely works over three uncertain fine toggles. You can re-enable granularity after metrics stabilize and eval samples return green.

Soft degrade versus hard stop

Soft degrade increases refusal rate, forces retrieval-only answers, routes to a smaller model, or removes write tools while keeping read assistance. Hard stop removes AI from the critical path entirely—users finish work through classic UI, search, or human support.

Operators under stress need both modes with defaults that fail toward safety for irreversible actions. Payment capture, account deletion, and bulk messaging should default to hard stop when signals are ambiguous.

Soft degrade preserves revenue on low-risk surfaces during partial outages. The mistake is using soft degrade everywhere to avoid admitting AI is off—users then receive confident wrong answers at scale.

Define measurable entry and exit criteria for each mode. Re-enable soft degrade only when eval health and cost metrics pass agreed thresholds; promote to full AI only after a canary cohort succeeds.

Pair degrade modes with visible product copy so support knows what users see. Internal "degraded" without UX differentiation creates duplicate tickets and retry storms.

Measure degrade duration and user completion rate on non-AI paths. If soft degrade lasts days with falling completion, escalate to hard stop until root cause is fixed—partial AI is not free indefinitely.

Propagation SLA and client behavior

Publish a propagation SLA: how quickly every tier must observe kill state after the authoritative store flips. Edge caches, CDN config, mobile clients, and regional Workers should converge within minutes—not hours.

Authoritative kill state belongs in a low-latency store your team controls: feature flag service, D1 row, or signed config blob—not only the model vendor dashboard. Provider status pages are informational; your switch must work when the provider is up but your product is misbehaving.

Mobile clients should stop initiating new AI requests immediately when kill is true, cancel in-flight streams when safe, and surface cached non-AI flows. Never leave spinning assistants that hammer a disabled backend.

Server-side enforcement is mandatory. Client-only kills are bypassed by older app versions, modified builds, and API scripts. Treat client flags as UX hints; APIs and workers enforce capability denial.

Test propagation with synthetic flips in staging weekly. Measure time-to-convergence per region and client version bucket; alert when SLA drifts.

Version skew is normal on mobile: kill must be enforced server-side so vN-2 clients cannot trigger write tools after a safety flip. Rate-limit and deny with a clear error code instead of silently accepting toxic work.

Tripwires and automation

Pair manual switches with automatic tripwires: cost burn rate, groundedness collapse, policy violation spikes, elevated human escalation, or error budgets on tool failures. Automation can execute soft degrade; hard stops on customer-facing writes usually need human confirm unless risk is catastrophic.

Tripwires should be idempotent and logged. Flapping metrics must not oscillate user experience between on and off every few minutes—use hysteresis and minimum dwell time in degraded mode.

Connect tripwires to paging policies distinct from generic API alerts. AI incidents need eval context, recent prompt changes, and model route—not only 5xx rates.

Allow automation to propose switches in chat with one-click confirm for on-call. Full auto hard-stop is justified when spend or safety metrics cross pre-approved catastrophic thresholds documented in the runbook.

Review false positive rates monthly. Over-sensitive tripwires train teams to disable automation—the opposite of resilience.

Document tripwire thresholds in the same repo as eval gates so changes ride pull requests with review—not silent dashboard edits during panic.

Test the dark path like a release gate

Staging should regularly run with AI killed. Verify empty states, support macros, analytics events, and that in-flight jobs do not complete dangerous work after the switch flips. Include E2E specs tagged `@ai-killed` in CI on a nightly schedule.

Chaos days that only test latency miss the failure mode customers fear: confident wrong actions after a partial kill. Simulate kill mid-stream during tool execution and assert idempotent recovery or explicit failure—not silent success.

Gate releases on a checklist: kill flipped, critical journeys complete without AI, no orphaned webhooks, metrics dashboards still sane. Block launch if any high-stakes journey has no non-AI path.

Record dark-path drill dates in release notes for enterprise buyers who ask about operational maturity. Kill switches nobody exercises are inventory, not controls.

Add one Playwright flow that completes checkout or data export with AI killed—same suite that guards SEO invariants, tagged so PRs touching flags always run it.

Communicate the outage as product, not apology spam

When AI is off, say what still works and how to complete the task. Vague "assistant unavailable" copy drives retries that hammer a stressed system. Localize fallback copy in every shipped locale; do not English-fallback under `lang="tr"`.

Support macros should mirror in-product messaging so agents do not promise capabilities the kill switch removed. Align status page language with in-app banners when incidents are public.

Offer deterministic alternatives: search, forms, PDF export, or human chat with context preserved from the partial AI session when privacy policy allows. Preserving user input across the fallback boundary reduces abandonment.

Re-enable messaging should explain what improved—eval pass, cost normalization, provider stability—without overpromising. Trust returns faster with specifics than with generic "we fixed it" banners.

Banner copy should name the fallback path users already have—search, form, or human chat—so retries do not queue behind a disabled model endpoint. Localize banners in every locale you ship; English-only incident text undermines trust on Turkish or Japanese routes.

Operational checklist for kill switches

Before launch: switches scoped, owner named, SLA measured in staging, dark-path E2E green, runbook section linked from pager. Before irreversible tools ship: hard-stop default verified, audit logging sampled, tripwire thresholds signed by product and security.

During incident: flip coarse scope first, confirm propagation metrics, update support macros, capture eval snapshot for postmortem. After recovery: staged re-enable through soft degrade, canary tenant, full restore; add golden rows from the incident.

Kill switches are staff-level infrastructure for AI products. They turn model uncertainty into an operable control plane—you ship ambitious features because you can stop them cleanly when reality diverges from the demo.

Fold kill drills into quarterly game days alongside backup restores. Teams that only practice happy-path rollouts discover kill gaps during real outages at the worst traffic moment.

Link kill switches to eval health from your production evaluation suite: re-enable AI only when blocking properties pass on a fresh golden sample, not when executives ask for the demo sparkle back. Operations and quality gates should agree on the same green definition. Document that linkage in the runbook so on-call does not debate whether eval green is required before restore. Keep a single pager with flip order, SLA chart, and support macro links pinned in the incident channel template. Update that pager whenever scopes or owners change.

Frequently asked questions

Is a feature flag enough for AI safety?
Not if it only hides UI. A kill switch must stop server-side generation, tool writes, and async jobs while preserving non-AI completion paths. Client-only flags are bypassed by older mobile builds and direct API use. Treat visibility flags as UX; enforce capability denial on the server and worker tier.
When should we hard stop instead of soft degrade?
Hard stop when actions are irreversible, legally sensitive, or when grounding trust is broken. Soft degrade suits read-only assistance during partial model outages. Default irreversible flows to hard stop when signals are ambiguous; document exit criteria before re-enabling full AI so on-call is not guessing under pressure.
What propagation SLA is reasonable?
Aim for under five minutes worldwide for authoritative kill state on APIs and workers, faster for write tools when safety incidents fire. Measure convergence in staging drills; alert when caches or mobile clients exceed SLA. Provider dashboards do not substitute for your own kill store under your control.
Should tripwires auto-flip kill switches?
Soft degrade automation helps contain cost and quality incidents; hard stop on customer writes usually needs human confirm unless thresholds are pre-approved as catastrophic. Log every automatic flip with metric snapshots. Review false positives monthly so teams do not disable tripwires and lose the safety net entirely.

Sources

Related service

Ship AI features to production: tooling, retrieval, evaluation, safety boundaries, and operable backends.

View hire details


Published on September 7, 2026 by Berktug Berke Ates.