Safeguard
Developer Tools•

How do you estimate the cost of leaving a dependency?

Estimate exit cost before you adopt a library or service: count call sites, data formats, and behavior you rely on. Here is a simple worksheet.

Safeguard Security Team
3 min read

Estimate exit cost by counting how many places call the dependency, which data formats or behaviors only it provides, and how long a replacement would take to test. Do it before adoption and again each year. The number is a roadmap input, not a precise forecast.

Why exit cost matters for the roadmap

Every dependency can become a problem later: the maintainer leaves, the license changes, a vulnerability goes unfixed, or the project is archived. The OpenSSF guide on evaluating open source software says plainly that every new dependency increases the attack surface, and it also asks you to check whether existing components can already do the job. Exit cost is the other half of that question. It tells you how painful the day will be when the answer changes.

A four part worksheet

FactorWhat to measureLow cost signHigh cost sign
SurfaceNumber of files and services that import itA handful, behind one moduleHundreds, spread everywhere
DataFormats it writes that other systems readStandard, documented formatsProprietary storage or wire formats
BehaviorQuirks your code depends onOnly documented behaviorUndocumented side effects
SubstitutesCredible alternatives that existSeveral with similar interfacesNone, or only a rewrite

Score each factor low, medium, or high. Two or more highs means the dependency deserves an owner, an abstraction layer, and a yearly review.

Steps to produce the numbers

  1. Pull the dependency inventory for the product. A software bill of materials lists the components, their versions, and relationships, which is the starting data. NTIA describes an SBOM as a formal record of the details and supply chain relationships of the components used to build software.
  2. Search the code for imports and calls. A count by module is enough.
  3. List stored data and exported files that depend on the library's format.
  4. Ask the team which behaviors they would be surprised to lose.
  5. Name one or two alternatives, even if you never plan to switch.

Turn the score into a decision

Low scores need nothing beyond normal updates. Medium scores warrant a note in the architecture decision record. High scores justify one of three actions: wrap the dependency behind your own interface, keep a vendored copy ready, or choose a lower risk alternative before adoption.

Put it on the roadmap honestly

Planning an exit does not mean planning to leave. A one page exit sketch with a rough effort range lets a product manager answer "what if this goes away" without a scramble. It also supports conversations with customers who ask about supplier risk.

Try it yourself

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

Look at how the inventory shows direct and indirect components. The direct ones are where your exit cost sits.

Quick check

Do we need an exit plan for every package?

No. Score them quickly and write plans only for the ones with several high factors.

How often should we redo the scores?

Yearly, and whenever a maintainer, license, or security posture changes.

Safeguard's SBOM and dependency scanning can produce the inventory this worksheet starts from, and there is a free scan at gold.safeguard.sh/scan.

Sources

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.