The platform exposes 5 admin-only kill switches as KV keys. Every write path (NS push, drainer, email pipeline, public portal, high-risk action) checks them before proceeding. Switches have 3 states (off / armed / on) and auto-expire after 24h as a safety net so we never permanently brick ourselves. Every flip lands in chat_decision_audit. Cite R547.
NS_PUSH_QUEUE producer AND drain. When ON, no writes leave the Worker toward NetSuite; every NS-bound mutation buffers in proposed_actions instead.kill:ns_writesPOST /api/ns-push/drainproposed_actions drain handler EVEN if Mike has approved a row. Stronger than ns_writes — also prevents D1-side commits, not just NS push.kill:proposed_applysrc/email.ts). Mail bounces with 5xx so senders see it.kill:email_intakekill:external_portalskill:high_risk_ops| method | endpoint | body | headers | response |
|---|---|---|---|---|
| GET | /api/kill-switches | — | X-Edit-Token | { ok, kill_switches: { key: boolean, ... }, hint } |
| POST | /api/kill-switches/flip | { key, on } | X-Edit-Token | { ok, key, on, expires_in_hours } |
# Example: arm + flip on ns_writes for 24h
curl -X POST https://api.ai-globalfoodsolutions.co/api/kill-switches/flip \
-H "X-Edit-Token: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"key":"kill:ns_writes","on":true}'
# → { "ok":true, "key":"kill:ns_writes", "on":true, "expires_in_hours":24 }
# Recover: flip off
curl -X POST https://api.ai-globalfoodsolutions.co/api/kill-switches/flip \
-H "X-Edit-Token: $TOKEN" -H "Content-Type: application/json" \
-d '{"key":"kill:ns_writes","on":false}'
Source: src/index.ts:14208-14245 · R547
docs/KILL_SWITCH_RUNBOOK.md is referenced in the alert path but does not exist.