My Client Wants My Source Code and Pre-Existing Tools. How Do I Protect Them?
Keep ownership of anything you built before the project and give the client a licence to use it, not an assignment. Clients need the right to run, maintain and modify what they paid for. They rarely need to own the reusable tools behind it, and a clear background-IP carve-out settles that.
Most developers, designers and consultants reuse their own work: code libraries, starter templates, scripts, component kits, design systems, automation tools. It is how you deliver quickly and keep your prices competitive. Then a client contract arrives saying the client owns "all work product, including all source code, tools and materials used in performing the services." Signed as written, that could hand over the toolkit your business runs on. This guide explains how to separate what the client is buying from what you are bringing, and how to phrase it so a reasonable client will agree.
Key takeaways
- Separate foreground IP (new work for the client) from background IP (your tools).
- Keep ownership of background IP and grant a non-exclusive, perpetual licence.
- List your pre-existing materials and keep dated records.
- Handle open-source components honestly and add a residual knowledge carve-out.
Two kinds of IP in every project
It helps to name the two categories clearly, because good contracts do.
Clients reasonably expect to own foreground IP, usually on payment. Background IP is where overbroad contracts cause trouble, because standard assignment language does not distinguish the two.
- Foreground IP: the new, project-specific work you create for this client, such as their custom features, their screens, their copy.
- Background IP: what you owned or developed before the project, or develop independently during it, such as your libraries, templates, frameworks and know-how.
| Question | Foreground IP | Background IP |
|---|---|---|
| What it is | New, project-specific work created for this client | What you owned before or develop independently |
| Examples | The client's custom features, screens and copy | Your libraries, templates, frameworks and know-how |
| Who should own it | The client, usually on payment | You |
| What the client gets | Ownership of the work | A non-exclusive, perpetual license to use it as part of the deliverables |
Why does standard assignment wording catch your tools?
Assignment clauses tend to use phrases like "all work product," "all materials developed or used in connection with the services," or "all intellectual property arising from the engagement." The words "used in" and "in connection with" are the danger. Your pre-existing library is used in the project, so the clause arguably assigns it. Even if a court would read it more narrowly, you do not want to find out in a dispute, and you may be unable to reuse your own code for the next client in the meantime.
The fix: a background IP carve-out plus a licence
The standard solution has two parts. First, a carve-out that says you keep ownership of your background IP. Second, a licence that lets the client use that background IP as part of the deliverables, so the client is not left with software it cannot legally run.
Most clients accept this once it is explained, because it gives them everything they actually need: the right to run, maintain and extend the product they paid for.
- The licence should be non-exclusive, so you can keep using the tools elsewhere.
- It should be perpetual and irrevocable for the delivered project, so the client is not at risk.
- It usually allows the client to modify the code as part of maintaining its product.
- It usually restricts the client from selling or distributing your tools on their own.
List what you are bringing
The strongest carve-out is specific. Attach a short schedule listing your background materials, such as "authentication module, admin dashboard starter, analytics utility library," or simply identify the repositories. Where a list is impractical, define background IP as anything you can show existed before the start date or was developed without using the client's confidential information. Keeping dated commits and version history makes that easy to prove.
Source code delivery and escrow
Owning foreground IP and receiving the source code are separate questions. A client that owns the product usually needs the source code to maintain it, and that is fair. Problems arise when contracts demand delivery of all source code, including background tools, in a form that lets the client reuse them outside the project. Deliver the full codebase for the product, with your background components included under the licence, rather than as separately assigned assets.
If a client wants assurance that it can maintain the product if you disappear, a source code escrow or a well-documented repository handover is the usual answer, not an assignment of your toolkit.
How should open-source components be handled in the contract?
Most modern projects include open-source libraries. You cannot assign what you do not own, so the contract should say that open-source components are provided under their own licences. Be careful with warranties promising that "all code is original" or "free of third-party components," which you cannot give honestly. Some clients also restrict certain licence types, such as copyleft licences, and it is better to agree that list upfront.
Which laws back up a licence of your code and tools?
Clients sometimes resist a licence because they worry about losing access if your business fails. Federal bankruptcy law addresses that worry. Under 11 U.S.C. § 365(n), if a licensor of intellectual property goes bankrupt and the trustee rejects the licence, the licensee can choose to keep its rights under the licence and any supplementary agreement for the full term, and can require the trustee to provide the intellectual property, including its embodiment, to the extent those agreements call for it. A source code escrow arrangement written into the deal can serve as that kind of supplementary agreement. Pointing a client to this protection is often more persuasive than offering to assign your toolkit.
Open-source licences are enforceable through copyright, not just contract. In Jacobsen v. Katzer, 535 F.3d 1373 (Fed. Cir. 2008), the Federal Circuit held that conditions in an open-source licence, such as requirements to credit the source and flag modifications, limit the scope of the licence, so a user who ignores them can be liable for copyright infringement. When you deliver code that includes open-source components, you and your client both have to respect those conditions, which is another reason not to promise that every line is original.
Copyright law also gives you the flexibility to split rights in the first place. Under 17 U.S.C. § 201(d), ownership of a copyright can be transferred in whole or in part, and any of the exclusive rights can be transferred and owned separately. Under § 204(a), any transfer of ownership needs a signed writing. A background IP carve-out plus a licence simply uses that flexibility deliberately: the client owns what was made for it, and you keep, and license, what you brought. Recording that split in a short schedule to the contract makes it easy to prove years later.
Can a client claim ownership of your know-how?
Some IP clauses go further and assign "ideas, methods, techniques and know-how" developed during the project. Your general skill and experience cannot sensibly belong to a client, and a clause that tries to claim it can operate like a non-compete, stopping you from building similar things for others. Ask for a residual knowledge carve-out: you can use general skills, ideas and experience retained in memory, as long as you do not use the client's confidential information.
A worked example
Marcus, a freelance developer, builds an e-commerce site for a retailer using his own checkout module and theme framework. The contract assigns "all code and materials used in the services." A year later, the retailer's new agency sees his checkout module in another client's site and claims it belongs to the retailer.
If Marcus had carved out his background IP and granted a non-exclusive licence, the retailer would have had full rights to use and modify its site, and Marcus would have kept his module. Instead, he faces an argument that he assigned it away, and has to rely on dated commits to show it pre-dated the project.
Sample wording you can propose
"Contractor retains all rights in materials it owned or developed before the Effective Date or develops independently of this Agreement (Background IP), including those listed in Schedule A. To the extent Background IP is incorporated in the Deliverables, Contractor grants Client a non-exclusive, perpetual, irrevocable, royalty-free licence to use, copy and modify it solely as part of the Deliverables. Open-source components are licensed under their own terms."
Common mistakes
- Accepting "used in connection with the services" wording without a carve-out.
- Relying on memory rather than dated records to prove what pre-dated the project.
- Promising all code is original when it includes open-source libraries.
- Letting know-how or "methods" clauses restrict future work.
- Forgetting that a revocable licence may scare the client; make it perpetual for the delivered project.
Quick checklist
- Does the assignment cover only foreground work created for this client?
- Is background IP defined, carved out and listed?
- Is the client's licence non-exclusive, perpetual and limited to the deliverables?
- Are open-source components dealt with honestly?
- Is there a residual knowledge carve-out for general skills?
- Do rights in foreground IP transfer on payment?
Key terms explained
These terms come up in almost every negotiation over source code and tools.
- Foreground IP: new work created specifically for the client under the contract.
- Background IP: pre-existing materials and independently developed tools you bring to the project.
- Non-exclusive licence: permission to use something while the owner can license it to others too.
- Source code escrow: a third party holds the code and releases it if agreed conditions occur.
- Copyleft: open-source licences that require derivative works to be shared under the same terms.
- Residuals: general knowledge retained in memory that you remain free to use.
Protect the toolkit before the project starts
Your reusable tools are part of your business value. It takes one paragraph to protect them, and it is far easier to add before work begins than to argue about after. If a client contract uses broad "used in connection with" language, upload it and have the IP clauses checked before you sign.
Check whether your tools are protected
Upload your freelance contract and we will flag IP assignment and background IP terms, plus every other risky clause, in plain English, tuned to your state, with a downloadable report and redline.
Free templates for this
Editable, plain-English starting points with the fair versions of these clauses.
Frequently asked questions
Should a client own the source code I write for them?
Usually yes for project-specific code, often on payment. Your pre-existing tools should be licensed, not assigned.
What is a background IP clause?
Wording that confirms you keep what you owned before the project and licenses it to the client as part of the deliverables.
Can I reuse code from a client project?
Code you assigned belongs to the client. Your carved-out background tools and general know-how remain yours to reuse.
What is source code escrow?
Source code escrow means a third party holds the code and releases it to the client if agreed conditions occur, such as the developer disappearing. It answers a client's real worry, being unable to maintain the product, without requiring you to assign your reusable toolkit. A well-documented repository handover can serve a similar purpose.
Can I promise a client that all my code is original?
Be careful. Most modern projects include open-source libraries, and you cannot assign or warrant what you do not own. Avoid warranties that all code is original or free of third-party components. Instead, state that open-source components are provided under their own licences, and agree up front any licence types the client wants to avoid, such as copyleft.
What is a residual knowledge carve-out?
It is a clause confirming you can keep using general skills, ideas and experience retained in memory after the project, as long as you do not use the client's confidential information. It matters because clauses assigning ideas, methods or know-how can work like a non-compete, stopping you from building similar things for other clients.
Related guides
- My Client Wants All Rights to My Work Before Paying. Should I Agree?Transferring ownership of your work before you are paid removes your leverage. Here is how to make rights transfer on payment instead, and what to offer clients who push back.
- Is My Freelance Contract Fair? A Pre-Signing Checklist for Independent WorkersClient contracts are written to protect the client. Here is the checklist our team runs on a freelance agreement before you sign, payment, ownership, scope, and the traps in between.
- Agency Subcontract: Who Owns the Work, Me, the Agency or the End Client?When you freelance for an agency that serves an end client, ownership of your work depends on the chain of written assignments. Here is how to read it and protect yourself.
- Upwork and Fiverr vs Direct Contracts: Which Terms Protect Me?Marketplace terms protect payment in specific ways but restrict taking clients off-platform. Here is how platform protection compares with a direct contract.
- Should a Freelance Contract Have a Non-Compete? Usually No, Here Is WhySome clients try to put a non-compete in a freelance agreement. As a contractor, you should almost always push back. Here is what makes freelance non-competes different and how to handle them.
- My Client Cancelled the Project Halfway and There Is No Kill Fee. Am I Owed Anything?A client cancels mid-project and your contract has no kill fee. You can usually still be paid for work done. Here is how to calculate it and make the claim.
This guide is general information from ClauseAudit, not legal advice. Laws vary by state and change, consult a qualified attorney for your situation. Published 2026-05-01; last reviewed 2026-10-09.