Kill Switch
The kill switch provides an emergency mechanism to instantly disable a feature flag in a specific environment.
When to Use
- A feature is causing errors or degraded performance in production
- A security vulnerability is discovered in a new feature
- An A/B experiment is producing unexpected negative results
- A dependent service is down and the feature should be disabled
How It Works
The kill switch:
- Sets
enabled: falseon the flag state for the specified environment - Creates an audit entry with action
flag.killed - Triggers cache invalidation → SSE notification to connected SDKs
The change propagates to SDKs within seconds (SSE) or the next poll interval.
Usage
Via API
curl -X POST http://localhost:8080/v1/projects/$PROJECT_ID/flags/my-flag/kill \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"env_id": "production-env-uuid"}'
Via Dashboard
- Open the flag detail page
- Navigate to the target environment tab
- Click the Kill button
After Killing
After resolving the issue:
- Re-enable the flag via the toggle switch or API
- Consider a gradual re-rollout (e.g., start at 10% instead of 100%)
- Review the audit log to understand the timeline
Audit Trail
Kill switch activations are prominently logged:
{
"action": "flag.killed",
"actor_type": "user",
"actor_id": "user-uuid",
"resource_type": "flag_state",
"before_state": {"enabled": true},
"after_state": {"enabled": false}
}