Allodial Build, borrow or buy
Internal only

Engineering guide · Small teams · Revision 1 · 7 October 2026

Build, borrow or buy.

When a small dev team should use open source, pay for proprietary software, or write its own, and how the answer changes as the team grows.

Written for
A two-person team, both new to coding, building with Claude Code as the main author of their code.
Covers
The three options and their trade-offs, the security question, a decision method, how to vet a package or a vendor, AI-specific risks, and how every one of these answers shifts from 2 to 200+ engineers.
Evidence
Public incident record (Heartbleed, left-pad, Log4Shell, xz, Shai-Hulud), Black Duck OSSRA 2025, and peer-reviewed research on AI package hallucination. Sources in Appendix B.

What is in this guide?

The question is never whether to use open source, only which and how.

97%

Of commercial codebases audited contain open source. The question is never whether to use it, only which and how.

Black Duck OSSRA 2025

86%

Of those codebases carry at least one known-vulnerable open-source component. Most risk is unpatched, not exotic.

Black Duck OSSRA 2025

19.7%

Of packages suggested in 576,000 AI-generated code samples did not exist. Attackers register those names.

Spracklen et al. · USENIX Sec. 2025

What is in this guide

  1. 01The short answerFive rules that settle most decisions on day one.
  2. 02The three optionsWhat open source, proprietary and in-house actually mean, and what each really costs.
  3. 03Is open source safe?The many-eyes argument, where it fails, and why home-built code is usually the bigger risk.
  4. 04The trade-offs in depthCost, speed, control, lock-in, licensing, people, longevity and compliance.
  5. 05A decision methodTwo questions, one matrix, and lists of what to never build, usually buy, and usually borrow.
  6. 06Vetting an open-source packageA scorecard, red flags, free tools, and a licence cheat sheet.
  7. 07Vetting a vendorWhat to check before your data and your uptime depend on someone else.
  8. 08Building with Claude CodeThe AI-specific failure modes and the guardrails that stop them.
  9. 09How the answer changes with scaleFive team-size stages, what shifts at each, and the signals that it is time to revisit a decision.
  10. 10Customers, investors and regulatorsSBOMs, SOC 2, the EU Cyber Resilience Act, and licence diligence in a fundraise or sale.
  11. 11Worked examplesTwelve common components with a call for today and a call at scale.
  12. 12ChecklistsBefore you add a package, before you buy, before you build.

Appendices: A · glossary and B · sources.

What should a two-person team do?

Build what makes you different. Buy what can sink you. Borrow the rest.

For a small team that is new to coding, using well-established open source is much safer than writing your own. The danger in open source is choosing the wrong package and failing to keep it updated, not open source as a category. Code you write yourselves has the same kinds of flaws, and nobody else is reading it. A popular library like Django, Postgres or OpenSSL has had thousands of people find and fix the bugs you would otherwise write.

Proprietary software is the third option, and for a small team it is often the safest of all for the few components where a mistake is catastrophic: logins, payments, secrets and anything holding regulated data. You are paying a vendor to own the security work you cannot yet do.

Five rules that settle most decisions

  1. Build only what makes your product different.

    The logic customers pay for is the one thing nobody can sell you. Everything else you build is a liability you have to maintain.

  2. Never build security primitives.

    No home-made encryption, password hashing, login or session handling, or input sanitisation. These are where breaches come from.

  3. Buy where failure is catastrophic and the domain is regulated.

    Payments (Stripe), authentication (Clerk, Auth0, Supabase Auth), secrets management, email delivery.

  4. Borrow everything in between, carefully.

    Frameworks, utilities, UI components and data handling come from popular, maintained open-source projects that a human has checked.

  5. Every new dependency is a decision a human signs off.

    Claude can propose a package; one of you verifies it exists, is the real one, and is maintained before it goes in.

What are we choosing between?

Three ways to get software, and none of them is free.

Borrow

Open source

Code published under a licence that lets anyone use, read and modify it. It costs nothing to download, but you pay in attention: choosing it, updating it, and understanding it well enough to debug it. Licences differ sharply (section 06): permissive licences (MIT, Apache 2.0, BSD) ask almost nothing of you; copyleft licences (GPL, AGPL) can require you to publish your own code if you distribute or, for AGPL, serve it over a network. Source-available licences (BSL, SSPL, Elastic) look like open source but restrict commercial use.

Buy

Proprietary

Software you pay for and cannot see inside. For a small team it mostly arrives as a managed service or SaaS (Stripe, Auth0, Vercel, Datadog), sometimes as a licensed SDK. You trade money and control for someone else’s security team, uptime and compliance certificates. The hidden costs are lock-in, pricing that grows with you, and the vendor’s own roadmap and survival.

Build

Built in-house

Code your team writes and owns. It fits exactly, carries no licence or vendor risk, and can become a real competitive asset. It is also the most expensive option over time: every line has to be designed, tested, secured, documented and maintained, and with a two-person team the bus factor is one.

Side by side

DimensionOpen sourceProprietaryDefault for a 2-person team
Upfront costFreeSubscription or licenceFree tiers of managed services, plus open source
Ongoing costYour time: updates, debuggingRises with usage and seatsTime is scarcer than money; spend money to save it
SecurityStrong if popular and patched; weak if obscureVendor’s responsibility, verified by auditsBuy for auth, payments, secrets; borrow popular OSS
Speed to shipFastFastestNever build what you can install
Control and fitHigh: read it, fork itLow: their roadmapAccept imperfect fit outside your core
Lock-inLowMedium to highChoose vendors with data export and open standards
Legal riskLicence obligationsContract termsStick to MIT, Apache 2.0, BSD unless reviewed
Skill requiredEnough to evaluate and debugEnough to integrateIntegration is the skill you have
Exit costLow to mediumMedium to highKnow the exit before you sign

Built in-house is left out of the default column on purpose: for a team at this stage it is the right answer only for the product’s own logic.

Is open source safe?

The many-eyes argument is true for popular projects, and false for the long tail.

The case for open-source security is that anyone can read the code, so flaws get found and fixed. That holds for heavily used, well-funded projects. It breaks down in three places, and the public record shows all three.

IncidentYearWhat it shows
Heartbleed (OpenSSL)2014Critical infrastructure can rest on a tiny, underfunded team. A two-year-old bug exposed server memory across much of the web.
left-pad (npm)2016An 11-line package was unpublished and broke thousands of builds. Trivial dependencies are still dependencies.
event-stream (npm)2018A tired maintainer handed a popular package to a stranger, who added code to steal cryptocurrency wallets.
Log4Shell (Log4j)2021One flaw in a ubiquitous logging library allowed remote code execution almost everywhere. Teams that knew what they ran patched in hours; others took months.
xz Utils backdoor2024An attacker spent about two years earning maintainer trust, then hid a backdoor aimed at SSH. A Microsoft engineer caught it by noticing a half-second login delay.
tj-actions/changed-files2025A compromised GitHub Action leaked CI secrets from thousands of repositories. Build tooling is part of the supply chain.
Shai-Hulud (npm)2025A self-replicating worm stole maintainer tokens and republished itself into hundreds of packages, including some from large vendors.

What the record says

  1. Most damage comes from not updating.

    Black Duck found 86% of audited codebases carried a known-vulnerable open-source component. The fix existed; it was not installed.

  2. Supply-chain attacks target the install step.

    Typosquatted names, hijacked maintainer accounts, malicious updates and, now, hallucinated names that AI tools suggest. The defence is controlling what gets installed and when.

  3. Eyes concentrate on popular projects.

    A package with millions of weekly downloads and a funded foundation is scrutinised. One with a single anonymous maintainer is not.

  4. Proprietary software is not immune.

    Closed vendors have breaches too (SolarWinds, Okta, MOVEit). You simply cannot see the code, and you depend on their disclosure.

Why home-built code is usually the bigger risk

Code your team writes gets exactly two reviewers, both new to the work. Code Claude writes is fluent and confident, and it can still be wrong in ways that pass a quick read: a missing authorisation check, an injectable query, a token stored in the browser. A mature library has already met those attacks. The safe ranking for a beginner team, in security-critical areas, is managed service first, popular open source second, home-built last. In non-critical areas, popular open source comes first.

RiskOpen sourceProprietaryBuilt in-house
Known vulnerabilitiesPublic; patch availableVendor patches; you may not hearUnknown until exploited
Malicious codeSupply-chain attacksRare; vendor compromiseInsider or AI-introduced
AbandonmentMaintainer quitsVendor fails or pivotsYour team leaves
ReviewersMany, if popularVendor’s team and auditorsYou two
VisibilityFullNoneFull

What are we actually trading?

Eight trade-offs, each with the question that settles it.

  1. Total cost of ownership.

    Free software is not free and paid software is not just its price. Count engineer hours for integration, updates, incidents and eventual migration.

    Settling questionWhat would one of us spend in hours per month to own this, and what is that hour worth against shipping product?

  2. Speed.

    Installing beats building almost every time early on. The cost of speed shows up later as integration debt.

    Settling questionDoes shipping two weeks sooner matter more than a perfect fit?

  3. Control and fit.

    In-house fits exactly; open source can be forked; proprietary fits only as far as the vendor allows.

    Settling questionWill we need behaviour this tool cannot give us within the next year?

  4. Lock-in and exit.

    Every choice has an exit cost. Vendors raise prices, change terms or shut down; open-source projects relicense (HashiCorp Terraform moved to the Business Source License in 2023; Redis went source-available in 2024 before adding AGPL in 2025).

    Settling questionIf this disappeared in 90 days, how hard would leaving be?

  5. Licensing and legal.

    Permissive licences are nearly frictionless. Copyleft can oblige you to publish your code. Source-available licences can bar competing uses.

    Settling questionHave we read the licence of everything that ships, including transitive dependencies?

  6. People and knowledge.

    Popular tools have documentation, Stack Overflow answers and engineers you can hire who already know them, and Claude knows them well. Home-built tools exist only in your heads.

    Settling questionCould a new hire be productive with this in a week?

  7. Longevity and bus factor.

    Check whether the project or vendor will outlive your need for it.

    Settling questionHow many maintainers, how much funding, how long in production?

  8. Compliance.

    Customers and regulators increasingly ask what is in your software and who is responsible for it. Vendors with SOC 2 or ISO 27001 reports transfer some of that burden.

    Settling questionWill this choice appear in a security questionnaire, and can we answer it?

How do we decide, component by component?

Ask whether it differentiates you, then what happens if it fails.

Two questions sort almost every component. Does this make our product different? (Would a customer notice or care if we did it the same way as everyone else?) How bad is it if this is wrong? (A leaked password database is catastrophic; a misaligned button is not.)

Low consequence if wrong

High consequence if wrong

Differentiating

Differentiating · low consequence

Build.

Move fast, use Claude freely, iterate with customers.

Differentiating · high consequence

Build carefully.

Build on top of proven primitives. Get outside review before launch.

Not differentiating

Not differentiating · low consequence

Borrow.

Popular open source, minimal time spent choosing.

Not differentiating · high consequence

Buy.

A managed service with audits, or the most battle-tested open source with expert configuration.

The decision sequence

For any new component, ask in order and stop at the first clear answer:

  1. Does the language or framework already do this?

    The standard library is the safest dependency you have. Prefer it.

  2. Is it a security primitive or regulated data?

    If yes: buy a managed service, or use the single most established library with its documented defaults. Never write it.

  3. Is it our core differentiator?

    If yes: build it, composed from proven parts.

  4. Is there a popular, maintained, permissively licensed open-source option?

    If yes and it passes the scorecard in section 06: borrow it.

  5. Is there a reputable vendor with a free or affordable tier and a clean exit?

    If yes and it passes section 07: buy it.

  6. Otherwise

    Build the smallest version that works, write it down, and revisit in six months.

Quick reference

Never build

  • Cryptography
  • Password hashing
  • Login, sessions and tokens
  • Payment card handling
  • Input sanitisation and HTML escaping
  • Date, time-zone and currency maths
  • CSV, PDF and image parsers

Usually buy

  • Authentication
  • Payments and billing
  • Transactional email
  • Secrets management
  • Error tracking
  • Hosting and managed databases
  • Backups

Usually borrow

  • Web and app frameworks
  • ORMs and database drivers
  • UI component libraries
  • Testing tools
  • HTTP clients
  • Validation
  • Logging
  • Charting

Usually build

  • Your domain model and business rules
  • The workflows customers pay for
  • Integrations that encode your know-how
  • Internal glue scripts

Is this package safe to install?

Five minutes of checking before every new dependency.

CheckGood signRed flag
Exists and is realName matches the project’s official site or GitHub exactlyName differs by one letter; no linked repository; registered recently
UsageHundreds of thousands to millions of weekly downloads; used by projects you recogniseHundreds of downloads; no dependents
MaintenanceRelease in the last few months; issues answered; several maintainersNo commits in a year; one anonymous maintainer; pile of unanswered security issues
BackingFoundation or company sponsor (Linux Foundation, Apache, OpenJS, a funded company)Personal side project with no succession
Security postureSecurity policy file; published advisories handled promptly; good OpenSSF ScorecardNo way to report vulnerabilities; install scripts that download code
LicenceMIT, Apache 2.0, BSD, ISCGPL or AGPL in a closed product; BSL, SSPL or no licence at all
Size and footprintDoes one job; few dependencies of its ownPulls in dozens of transitive packages to save you ten lines

Free tools that do most of this for you: OpenSSF Scorecard and deps.dev (maintenance and security signals), Socket (flags malicious and suspicious packages, not just known CVEs), GitHub Dependabot (alerts and update pull requests), and npm audit or pip-audit (known vulnerabilities).

Licence cheat sheet

LicenceTypeWhat it means for a closed commercial product
MIT, BSD, ISCPermissiveUse freely. Keep the copyright notice.
Apache 2.0PermissiveUse freely. Keep notices; includes an explicit patent grant, which is a plus.
MPL 2.0Weak copyleftFine to use. Changes to MPL files themselves must be shared.
LGPLWeak copyleftUsually fine if dynamically linked and unmodified. Check with counsel for mobile or static builds.
GPL v2 / v3Strong copyleftIf you distribute software that includes it, your code may have to be released under GPL. Server-only use is generally not distribution.
AGPL v3Network copyleftServing it over a network counts. Avoid in a closed SaaS product without legal review.
BSL, SSPL, ElasticSource-availableNot open source. Usually bars offering it as a competing service. Read the terms.
No licenceAll rights reservedYou have no right to use it. Do not install it.

This is orientation, not legal advice. Before a fundraise or sale, have counsel review a full licence report (section 10).

Is this vendor safe to depend on?

Check the exit before you check the features.

CheckWhat to look for
Security evidenceA SOC 2 Type II or ISO 27001 report, a public security page, a history of honest breach disclosure.
Data exitA documented, complete export in an open format. Test it once before you rely on it.
StandardsBuilt on open standards (OAuth/OIDC, SQL, S3-compatible storage, SMTP) so a replacement can slot in.
Pricing curveWhat the bill looks like at 10× and 100× your usage. Per-seat and per-event pricing can overtake an engineer’s salary.
ReliabilityPublished uptime history and status page. An SLA with credits if you are on a paid tier.
ViabilityFunding, revenue and customer base. A startup vendor is a risk to price in, not a reason to refuse.
TermsWho owns your data, whether they may train models on it, notice periods for price and term changes.
Free tier limitsExactly where the free tier stops, and what happens to you when you hit it.

What changes when Claude writes the code?

AI makes building cheap and judgement scarce.

Claude Code makes writing code nearly free, which makes “just build it” tempting. The cost of software was never mostly the writing. It is the owning: understanding, securing, testing and maintaining. AI lowers the first cost and leaves the others where they were, so for a beginner team it tilts the right answer further toward proven components, not away from them.

Failure modes to watch for

Failure modeWhat happensGuardrail
Hallucinated packagesClaude suggests a plausible package name that does not exist. Attackers register those names (“slopsquatting”).Verify every new package name against its official site before install.
Outdated APIsCode uses a deprecated function or an old major version with known flaws.Pin current versions; ask Claude to check the library’s current docs.
Dependency sprawlA new package for every small task.Prefer the standard library; require a stated reason for each dependency.
Reinvented securityHand-written auth, crypto or sanitisation that looks right and is not.Ban it in CLAUDE.md; use the vendor or framework feature.
Secrets in codeAPI keys pasted into source or committed to Git.Environment variables, a secrets manager, and GitHub secret scanning.
Confident wrong codeCode passes a read and fails an attack.Tests, a second human reviewer, and automated scanning in CI.

Add this to CLAUDE.md

CLAUDE.md

## Dependencies and security

- Do not add a new dependency without listing it, explaining why the
  standard library or an existing dependency will not do, and linking
  its official repository.
- Prefer the standard library. Prefer packages we already use.
- Never implement cryptography, password hashing, authentication,
  session handling or input sanitisation. Use <our auth provider> and
  the framework's built-in protections.
- Never put secrets in code. Read them from environment variables.
- Pin exact versions. Commit the lockfile.

Guardrails to set up once

  1. Lockfiles, committed.

    package-lock.json, pnpm-lock.yaml, uv.lock or poetry.lock. Builds install exactly what you tested.

  2. Automated update pull requests.

    Dependabot or Renovate, with security updates on. Merge them weekly.

  3. A waiting period for new releases.

    Renovate’s minimumReleaseAge (and similar settings in pnpm and uv) delays brand-new versions by a few days, which is when most hijacked releases are caught.

  4. Scanning in CI.

    npm audit or pip-audit for known flaws; Socket for malicious packages; GitHub secret scanning and push protection.

  5. Branch protection.

    Nothing reaches main without the other person’s review, including dependency changes.

  6. Pin CI actions by commit hash.

    Not by tag, which can be moved (the tj-actions lesson).

How does the answer change as we grow?

The defaults hold; the economics and the obligations move.

The core rule (build the differentiator, buy the dangerous, borrow the rest) holds at every size. What changes is the cost of engineer time against vendor bills, the team’s ability to own complex systems safely, and how much customers and regulators demand to know. Five stages:

TeamDefault postureWhat changesProcess
2–5 We are hereBuy heavily, borrow freely, build only the productEngineer time is the scarcest resource; vendor bills are smallTwo-person review of dependencies; guardrails in section 08
5–15Same, with first cost reviewsSeat and usage pricing starts to bite; first enterprise customers send security questionnairesAn approved-dependency list; one person owns dependency hygiene; first SOC 2 work
15–50Selectively bring in-house what is core or very expensiveYou can staff a platform owner; vendor bills can exceed an engineer’s costWritten decision records for build-buy calls; SBOMs generated in CI; licence scanning
50–200Platform team; contribute upstream; fork when neededInternal tools become products; you depend on open-source projects enough to fund or help maintain themAn internal registry or proxy; security team reviews new dependencies; vendor-management process
200+Open-source programme office; strategic in-housingScale makes custom infrastructure economic; your own open-source releases become a hiring and reputation toolFormal OSPO; policies for contribution and release; continuous supply-chain monitoring

What drives the shift

  1. The cost curve crosses.

    Vendors are cheap at small scale and can become the largest line after payroll. When a bill reaches the fully loaded cost of the engineers it would take to build and run a replacement, and the component is core or strategic, a build becomes worth costing. Count maintenance, on-call and migration, not just the initial build.

  2. Capability arrives.

    A team with a dedicated platform or security engineer can safely run what a two-person team cannot: self-hosted databases, internal auth gateways, forks of upstream projects.

  3. Obligations arrive.

    Enterprise customers, auditors and regulators ask for SBOMs, licence reports and vulnerability-handling processes (section 10). That pushes toward fewer, better-known dependencies and vendors with audit reports.

  4. Leverage arrives.

    Larger teams can negotiate vendor contracts, sponsor maintainers, contribute fixes upstream instead of waiting for them, and influence the projects they rely on.

  5. The cost of a wrong choice rises.

    Migrating a component at 200 engineers is a quarter-long project. Lock-in and licensing deserve more scrutiny the bigger you get.

Signals to revisit a decision

Revisit a buy when…Revisit a borrow when…
The bill is growing faster than revenueThe project goes quiet or loses its main maintainer
You keep working around missing featuresIt relicenses to source-available or copyleft
The vendor changes terms, pricing or ownershipA serious vulnerability takes weeks to patch
A customer or regulator requires something they cannot provideYou maintain a pile of local patches against it
It has become central to what makes you differentYou need behaviour it will never support

Who else will ask what is inside our software?

Customers, investors and regulators turn dependency hygiene into paperwork.

Source of pressureWhat it asks for
Enterprise customersSecurity questionnaires, a SOC 2 Type II report, a software bill of materials (SBOM), named sub-processors, a vulnerability-disclosure policy.
US government buyersSince Executive Order 14028 (2021), federal software suppliers attest to secure development practices and provide SBOMs on request.
EU Cyber Resilience ActFor products with digital elements sold in the EU: vulnerability and incident reporting obligations apply from 11 September 2026, and the full security and documentation requirements from 11 December 2027. Manufacturers are responsible for the open-source components they ship.
Investors and acquirersTechnical due diligence includes a licence and vulnerability scan of the codebase. Copyleft code in a closed product, unlicensed code, or a long list of critical vulnerabilities can delay or reprice a round or a sale.
Data-protection lawGDPR and similar laws make you responsible for where vendors store and process personal data. Each vendor is a sub-processor to document.

The cheap way to be ready

Generate an SBOM in CI from day one (Syft, cyclonedx-npm or GitHub’s dependency-graph export), keep licences to the permissive list, and keep a one-page register of vendors, what data each holds, and where.

What would we choose for the usual parts?

Twelve components, decided today and at scale.

ComponentTwo-person team todayAt 50+ engineers
AuthenticationBuy: Clerk, Auth0 or Supabase AuthOften still buy; some move to self-hosted Keycloak or Ory with a security team
PaymentsBuy: StripeBuy. Almost nobody should hold card data
DatabaseManaged Postgres (Supabase, Neon, RDS)Managed or self-run Postgres with a dedicated owner
HostingBuy: Vercel, Render, Fly.io, RailwayCloud provider directly, with infrastructure as code
Email deliveryBuy: Postmark, Resend, SESBuy
File storageBuy: S3 or S3-compatibleBuy
Web frameworkBorrow: Next.js, Django, Rails, FastAPIBorrow; contribute fixes upstream
UI componentsBorrow: shadcn/ui, Radix, MUIBorrow, wrapped in an internal design system
Error tracking and logsBuy free tier: SentryBuy, or self-host when the bill justifies it
SearchPostgres full-text search firstBorrow (OpenSearch, Meilisearch) or buy (Algolia)
LLM inferenceBuy an APIMix: APIs plus self-hosted open-weight models where cost or data control demands
Core business logicBuildBuild, with a dedicated team

Named products are common examples, not endorsements. Check current pricing and terms before choosing.

What do we check before we commit?

Three short checklists.

Tick items as you go. Ticks are saved in this browser only, so each person keeps their own.

Before adding an open-source package

Before buying a service

Before building it ourselves

What do these words mean?

Glossary

TermMeaning
DependencyAny external code your software needs to run or build.
Transitive dependencyA dependency of a dependency. Most of your installed code is transitive.
LockfileA file recording the exact version of every installed package, so every build is identical.
Supply-chain attackCompromising software by attacking something it depends on, rather than the software itself.
TyposquattingPublishing a malicious package under a name one typo away from a popular one.
SlopsquattingPublishing a malicious package under a name AI tools tend to hallucinate.
CVEA public identifier for a known vulnerability, such as CVE-2021-44228 (Log4Shell).
SBOMSoftware bill of materials: a machine-readable list of every component in your software.
CopyleftA licence that requires derived work to be released under the same licence.
Source-availableCode you can read but cannot freely use commercially. Not open source.
Bus factorHow many people would have to leave before nobody understands a system.
OSPOOpen-source programme office: the team that sets policy for using and releasing open source.
SOC 2 Type IIAn independent audit of a vendor’s security controls over a period of time.

Where does this come from?

Sources