Quick answer
A kill switch is a control that turns a feature, service or system off quickly, without deploying new code. In software it is a setting a running program checks, flipped by a person or by a rule on a metric such as error rate. Its quality is measured in minutes from harm to off.
Formula: Trip when error rate ≥ threshold in N consecutive windows and events ≥ minimum (example: ≥ 2.0% twice, 200+ views each)
What is a kill switch?
A kill switch is a control that lets people turn a feature, a service or a whole system off quickly, without deploying new code. The term comes from machinery, where a big red button cuts power in an emergency. In software it is usually a switch in configuration that a running program checks, so that flipping it takes effect in seconds rather than after a new release.
Pete Hodgson's widely cited article on feature toggles puts kill switches in the family of operational toggles: switches that control how the system behaves in production, used to disable or degrade a feature quickly if its performance is unclear. Most operational toggles are short-lived and are removed once the feature is trusted; a small number of long-lived ones stay as permanent kill switches. The article also notes that changing such a toggle through a new release would be too slow, so the setting has to be reconfigurable while the system runs.
The test of a kill switch is one question: how many minutes pass between "this is hurting users" and "it is off"? Everything else in this entry is about shortening that time without turning the switch itself into a hazard.
Kill switch, feature flag, circuit breaker and rollback
The four are related and often confused.
| Mechanism | What it does | Who or what triggers it | Typical lifetime |
|---|---|---|---|
| Kill switch | Turns one feature or dependency off | A person, or a rule on a metric | Long-lived for risky features |
| Feature flag | Turns a feature on for some users | Product team, gradually | Short; removed after rollout |
| Circuit breaker | Stops calls to a failing dependency automatically | Code, on repeated errors | Permanent in the code |
| Rollback | Replaces the release with the previous one | A person, through the deploy system | One-time |
A kill switch is usually built from the same machinery as a feature flag, but with a different purpose: a flag is for releasing gradually, a kill switch is for stopping fast. A circuit breaker is a kill switch that the code pulls itself. Rollback is slower, because it redeploys, and it also removes good changes that shipped in the same release. For releasing in stages, see progressive delivery.
Manual and automatic kill switches
| Type | Trigger | Strength | Risk |
|---|---|---|---|
| Manual | A person with permission flips it | Human judgement; no false alarms | Depends on someone noticing and being reachable |
| Automatic | A rule on a metric trips it (error rate, latency, failed payments) | Acts in minutes, day or night | A badly set threshold switches off a healthy feature |
| Semi-automatic | A rule alerts a person who confirms | Balance of speed and judgement | Still depends on a person answering |
Automatic switches deserve extra care. A network-wide switch that trips by itself can cause an outage when the rule is wrong, so start with alert-only, then manual, and automate only a narrow, well-tested case.
A real case: 45 minutes without a switch
On 1 August 2012 Knight Capital Americas deployed new code to its order router while an old, unused function remained callable on some servers. According to the U.S. Securities and Exchange Commission's 2013 order, the router then sent millions of child orders, producing 4 million executions in 154 stocks for more than 397 million shares in about 45 minutes. The firm ended up with unintended positions of roughly $3.5 billion long and $3.15 billion short, and lost more than $460 million.
The order concerns the firm's risk controls, but the lesson for any system is the time arithmetic: damage accumulated for about 45 minutes before the orders stopped. A tested way to disable the faulty path quickly, together with a metric that rings an alarm when behaviour is far from normal, shortens that exposure.
What makes a good kill switch: a checklist
| Property | What to check | Why |
|---|---|---|
| Default state | If the switch store is unreachable, the system falls back to the safe state | A fail-safe default |
| Reach time | A flip takes effect in seconds on every server | A switch that needs a redeploy is a rollback |
| Scope | Turns off one feature or dependency, not the whole product | Smaller blast radius |
| Who can flip | A named on-call group, with an audit log | Fast but accountable |
| Tested | Flipped on and off in staging and in a periodic drill | A switch nobody has tried may not work |
| Visible | The state is shown on a dashboard and noted on charts | People know it is off |
| Owned | Each switch has an owner and a review date | Avoid a pile of forgotten switches |
| Graceful | The off state shows a clear fallback for users | No broken pages |
Worked example: a metric trigger for checkout
Sample data: a store's normal checkout error rate is 0.5% of checkout page views. The team sets this rule: trip the kill switch for the new payment widget if the error rate is at least 2.0% in two consecutive 5-minute windows, each with at least 200 checkout page views.
| Window | Checkout views | Errors | Error rate | Above 2.0%? |
|---|---|---|---|---|
| 14:00–14:05 | 1,200 | 7 | 0.6% | No |
| 14:05–14:10 | 1,150 | 13 | 1.1% | No |
| 14:10–14:15 | 1,200 | 36 | 3.0% | Yes (1st) |
| 14:15–14:20 | 1,180 | 40 | 3.4% | Yes (2nd): trip at 14:20 |
Why 2.0%? In a 5-minute window of 1,200 views at a 0.5% base rate the expected count is 6 errors with a standard deviation of about 2.4 (the square root of 6). A threshold of 2.0% is 24 errors, (24 − 6) ÷ 2.45 = 7.3 standard deviations above normal, so a normal fluctuation will not trip it, while the real incident clears it by a wide margin.
What delay costs: assume 8 orders per minute are lost during the fault at $60 each. If the switch trips at 14:20 (10 minutes after the first bad window starts at 14:10), the loss is 10 × 8 × $60 = $4,800. If a person notices and flips it at 14:35, 25 minutes in, the loss is 25 × 8 × $60 = $12,000. The automatic rule saves $7,200 in this example, which pays for the work of building it after a single incident.
Common mistakes
- Never testing it. A switch that has never been flipped may do nothing.
- A threshold with no minimum volume. At 3 a.m. one error in 10 views is 10%; always require a minimum number of events.
- Making it trip automatically before it is trusted. Start with alerts, then manual, then a narrow automatic rule.
- Putting the switch behind the thing that is broken. If the switch store depends on the failing service, you cannot flip it.
- Leaving old switches in place indefinitely. Retire short-lived ones; review long-lived ones.
- No record. Without a note of when it was flipped, nobody can explain the dip in the chart.
How TapCub fits around a kill switch
TapCub does not provide kill switches or feature flags; it only measures. Use it for the "metric" half of the example above and for checking that the switch worked.
- Watch the metric. In Monitoring › Errors, the errors card shows error count, error rate (errors divided by pageviews), affected visitors and affected sessions, with groups by status.
- Set an alert for slow-burn problems. In All-platform analytics › Operations › Monitors, create a monitor on the built-in
error_rateorerrorsmetric. Monitors check on an hour, day, week or month grain, so they cannot trip a 5-minute rule like the example; they catch problems that build over hours. Use a dry run to see how many times the last 30 days would have fired. The same alert is not repeated for about 60 minutes by default and three hits in a row pause the rule. - Let it notify, not act. Channels are email, WeCom, DingTalk, Feishu or a webhook. A monitor never changes anything itself; if you want a person or your own service to flip the switch, that decision is yours.
- Check the switch worked. Open Web analytics › Realtime after flipping, and compare the error rate in the hours before and after.
- Record the flip. Add a date annotation under Configuration › Annotations (for example "payment widget switched off, 14:20") so the dip is explained in every later chart.
Sources
- U.S. Securities and Exchange Commission (2013). In the Matter of Knight Capital Americas LLC, Release No. 34-70694 — 4 million executions, 154 stocks, 397 million shares in about 45 minutes; loss above $460 million.
- Hodgson, P. (2017). Feature Toggles (aka Feature Flags). martinfowler.com — operational toggles and kill switches.
- TapCub documentation: Monitors, Errors, Annotations. Checked 2026-11-22.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Product Experience Specialist
Explores usability, user journeys, and feature adoption through practical examples of onboarding and everyday product use.