Add a kill switch
A kill switch is one of the simplest and most valuable feature flag patterns.
Basic pattern
Section titled “Basic pattern”Create a boolean entry such as:
- key:
Features:Checkout - value:
true - scope:
clientorall
When something goes wrong, set it to false.
For backend-only behavior, use server scope instead.
Why this is useful
Section titled “Why this is useful”Kill switches let you disable risky behavior without a redeploy, give operators one fast escape hatch, and fit naturally with Nona history and rollback.
Good first kill switch candidates
Section titled “Good first kill switch candidates”- new checkout logic
- a risky third-party integration
- a heavy background process
- a new navigation or onboarding flow
The best kill switches guard code paths that are valuable to disable quickly under real production pressure.
In admin
Section titled “In admin”- open
Projects - open the target project
- select the environment you want to protect, usually
production - click
Add Parameter - create a boolean parameter such as
Features:Checkout - set the initial value to
true - choose
client,server, orallbased on where the flag is evaluated - click
Create
When you need to disable the feature later:
- click the parameter row
- stay on the
Settingstab - change the boolean value to
false - click
Save
To review or undo a change:
- open the same parameter
- switch to the
Historytab - click
Rollback to v...on the version you want to restore
With the CLI
Section titled “With the CLI”Create the kill switch:
nona entries set \ --project storefront \ --environment production \ --key Features:Checkout \ --value true \ --scope client \ --content-type booleanDisable it during an incident:
nona entries set \ --project storefront \ --environment production \ --key Features:Checkout \ --value false \ --scope client \ --content-type booleanInspect history and roll back if needed:
nona entries history --project storefront --environment production --key Features:Checkoutnona entries rollback --project storefront --environment production --key Features:Checkout --version 2What a good kill switch does
Section titled “What a good kill switch does”A good kill switch should:
- be easy to understand
- default to a safe behavior when off
- be tested in both states
- be documented before the incident happens
If the application only works correctly in the true path, it is not really ready to benefit from a kill switch yet.
Kill switch FAQ
Section titled “Kill switch FAQ”What is the best first kill switch candidate?
Section titled “What is the best first kill switch candidate?”A risky but easy-to-disable feature path is usually best, such as new checkout logic or a third-party integration.
Should a kill switch always be boolean?
Section titled “Should a kill switch always be boolean?”Usually yes.
Boolean values are the clearest fit for kill switches because the operational action is typically just on or off.
Should the kill switch be client or server?
Section titled “Should the kill switch be client or server?”It depends on where the app evaluates the flag.
Use client for frontend or mobile checks, server for backend-only behavior, and all only when both sides genuinely need to read it.
What makes a kill switch operationally useful?
Section titled “What makes a kill switch operationally useful?”The off path must actually be safe and tested.
If disabling the flag still breaks the feature or the application, the kill switch is not doing the job you need during an incident.
Related docs: