Safeguard
Security Guides•

How fast should a rollback be? Set a time budget for dependency fixes

A fix is only as safe as your ability to undo it. How to set a rollback time budget per service, measure it with a drill and decide when to merge.

Safeguard Security Team
4 min read

A dependency fix is only as safe as your ability to undo it. Set a rollback time budget for each service, such as "back on the previous version within 15 minutes", test it with a drill, and refuse to merge fixes to services that miss the budget until the path is improved.

Why a budget, not a plan

Most teams have a rollback plan on paper. Few know how long it really takes. The first time you learn it is usually during an incident, when every minute is expensive.

A time budget turns a vague promise into a number. It tells reviewers how much risk a change can carry, tells on call engineers what to expect, and shows leadership which services need investment.

How to choose the number

Tie it to the cost of being broken. Ask how long the service can be degraded before customers or revenue are affected, and set the rollback budget below that.

Service typeExample budgetReasoning
Customer facing checkout or loginMinutesEvery minute is visible and costly
Internal tool used in business hoursAn hourUsers can wait briefly
Batch job that runs nightlyBefore the next runThe failure only matters at run time
Mobile or desktop app released to usersNot a simple rollbackPlan staged releases and a forward fix instead

Do not copy a number from another team. Pick one you can defend and test.

What a rollback includes

The budget has to cover the whole path, not just the button press.

  1. Detect the problem. Alerts, dashboards and a person who notices.
  2. Decide to roll back. Someone with authority must be reachable.
  3. Execute. Redeploy the previous artifact, revert the commit or flip a flag.
  4. Verify. Confirm the previous version is serving and the symptoms are gone.
  5. Handle data. If the new version wrote data the old one cannot read, rolling back code is not enough.

The slowest step is usually detection or the decision, not the redeploy. Time all of them in a drill.

Run a drill

Once a quarter, pick a low risk service and roll it back on purpose in a staging environment, or during a quiet window in production if you are confident. Time each step and write down what slowed you down: a missing permission, an artifact that had been deleted, a database migration with no way back, a runbook nobody could find.

Then fix the slowest thing and run it again. Our post on how rollback differs for OS patches and dependency updates is a useful companion.

Use the budget in merge decisions

Add one line to your fix pull request template: "Rollback tested within budget: yes or no, and how." If the answer is no, the reviewer should ask what makes this change safe to try, such as a canary release, a feature flag or a smaller step.

A service that cannot roll back inside its budget needs different handling: shipping behind a flag, rolling out to a small share of traffic first, or doing the expand then contract pattern for database changes so the old code still works.

Where tooling helps

Policies and gates can make the rollback requirement part of the merge conditions, and monitoring shortens detection. Safeguard provides policies, gates and guardrails, plus continuous monitoring, and you can run a free scan at gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen.

Click through the monitoring view and consider which signal would tell you first that a change went wrong.

Quick check

What is a reasonable first budget?

Measure your current rollback time with one drill, then set a budget slightly better than that and improve it over time. A tested number beats an ambitious guess.

Does every service need one?

Start with the services where a bad deploy would hurt most. Add the rest as you go.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.