Guide
Soft Kill: degrade gracefully before the bill does
October 21, 2026 · 4 min read
Instead of switching the whole project off, let your app turn off its expensive parts when spend crosses a threshold. What to degrade and how to wire it.
The idea
A kill switch that disconnects billing protects your wallet by taking your whole app offline, and Google warns it can leave resources "irretrievably deleted" (details). A Soft Kill is the step before that: when spend crosses a threshold, your own app is told to turn off its expensive parts and keep the rest running.
Users might lose AI features, image processing or live updates for a while. They don't lose the app, and you don't lose your data.
What to degrade, step by step
Pick a few levels and attach each to a budget threshold:
- 50%: pause batch jobs, heavy exports and anything that can run tomorrow.
- 80%: switch off the features that cost the most per user (AI calls, video transcoding, real-time listeners), behind a friendly message.
- 100%: read-only or maintenance mode.
- Above that: the Hard Kill, for when degrading wasn't enough.
How to implement it
The usual pattern is a flag your app reads (Remote Config, a Firestore document or an environment value) and a small, authenticated endpoint that flips it. Whatever sends the signal must be verifiable, or anyone could switch your features off.
With FireShield, the signal is a webhook signed with HMAC-SHA256. Your endpoint checks the timestamp and signature, then degrades by level:
const event = JSON.parse(rawBody); // after verifying X-FireShield-Signature
if (event.event === "soft_kill") {
if (event.thresholdPercent >= 100) await setMode("maintenance");
else if (event.thresholdPercent >= 80) await setMode("no-ai");
else await setMode("pause-batch");
}The full guide, with verification code for Node, Python, Go, Java and PHP, is in Soft Kill webhooks.
Why it beats a single kill switch
- You can set it low. Because it doesn't take the app down, a Soft Kill can fire at 50% without anyone dreading it.
- It buys time. The reporting delay is still there, but the expensive part of the traffic stops while you investigate.
- It works on spikes, not just budgets. On Pro and Enterprise, a usage spike rule (say, Firestore reads at 10 times their normal level) can send the same webhook minutes after the spike starts, with the service that spiked in the payload.
