When you hire an agency, the agency owns the code it writes until a signed, written assignment transfers it to you. Paying the invoice doesn’t move ownership in the US, the UK, the EU, or Pakistan, so the contract has to say it, and the repository should sit in your account from the first commit.
This guide explains the default rules with links to the laws themselves, then gives clause wording you can hand to your lawyer and a list of red flags.
This is not legal advice. We’re a software agency, not a law firm. The clauses below are plain-English starting points, written so you know what to ask for. Have a lawyer in your own country review any contract before you sign it, especially if the agency and your company are in different countries.
Who this is for: founders and business owners hiring an agency or freelancer, onshore or offshore, to build software they want to own outright. Who should read something else: if you’re licensing an existing product, like a SaaS tool or a white-label app, you won’t own that code and shouldn’t expect to. You need a licence and, sometimes, escrow. See the escrow section below.
The default rule, country by country
The pattern is the same almost everywhere. The person who writes the code is its author. If that person is an employee, the employer usually owns it. An agency’s developers work for the agency. So the agency owns the code by default, and only a signed writing moves it.
| Where | Who owns code by default | What moves it to you | Primary source |
|---|---|---|---|
| United States | The author. For employees, the employer. | A written transfer signed by the owner | 17 U.S.C. 201, 204 |
| United Kingdom | The author. For employees, the employer. | An assignment in writing, signed by the assignor | CDPA 1988 s.11, s.90 |
| European Union | For employees, the employer holds the economic rights | A contract (check national law for form) | Directive 2009/24/EC, Art. 2 |
| Pakistan | The author. For employees, the employer. | An assignment in writing, signed by the assignor | Copyright Ordinance 1962, s.13 and s.15 |
All four sources opened and read on 2026-10-13. Each country has exceptions we don’t cover here.
United States
US law starts with the author: copyright “vests initially in the author or authors of the work” (17 U.S.C. 201(a)). For a work made for hire, “the employer or other person for whom the work was prepared is considered the author.”
Many buyers think “work made for hire” in the contract solves everything. It often doesn’t. For a contractor’s work, the label only applies to nine listed kinds of work, and only if “the parties expressly agree in a written instrument signed by them that the work shall be considered a work made for hire” (17 U.S.C. 101). The nine are a contribution to a collective work, part of a film, a translation, a supplementary work, a compilation, an instructional text, a test, answers to a test, and an atlas. Custom software isn’t on the list.
The Supreme Court showed how this plays out in CCNV v. Reid (1989). A charity commissioned a sculpture, paid for it, and directed the work. The sculptor was still an independent contractor, the sculpture wasn’t a work made for hire, and the charity wasn’t its author under those rules. An agency is in the same position as that sculptor.
What does work is a transfer. It “is not valid unless an instrument of conveyance” is in writing and signed by the owner (17 U.S.C. 204(a)).
United Kingdom
“The author of a work is the first owner of any copyright in it” (CDPA 1988, s.11). When an employee writes it in the course of their job, “his employer is the first owner of any copyright in the work subject to any agreement to the contrary.” The agency is that employer. To move it: “An assignment of copyright is not effective unless it is in writing signed by or on behalf of the assignor” (s.90(3)).
European Union
The Software Directive says that when an employee writes a program in their job, “the employer exclusively shall be entitled to exercise all economic rights in the program so created”, unless a contract says otherwise (Directive 2009/24/EC, Article 2(3)). Again, that employer is the agency. How the transfer to you must be written depends on the member state.
Pakistan
Many offshore teams, including ours, work under Pakistan law. Section 13 of the Copyright Ordinance 1962 makes the author the first owner. For a work made under a contract of service, “the employer shall, in the absence of any agreement to the contrary be the first owner of the copyright therein.” Section 15 sets the form of a transfer: “No assignment of the copyright in any work shall be valid unless it is in writing signed by the assignor.”
So with a Pakistan agency, the agency owns the code its staff write, and a signed written assignment is what moves it to you. If a freelancer works for the agency as a contractor rather than an employee, the freelancer may own their part, which is why the subcontractor clause below matters.
Why the wording matters: “agree to assign” vs “hereby assign”
A contract can promise a future transfer or make one now. Those are different.
In Stanford v. Roche (2011), a researcher signed two forms. Stanford’s said he “agree[d] to assign” his rights. A form for the company Cetus said he “will assign and do[es] hereby assign” them. The rights ended up with Cetus, and through it with Roche. Stanford lost. That was a patent case, but the lesson carries over: ask for words that transfer now, such as “hereby assigns”. A promise to assign later is weaker.
Clauses to ask for
Plain-English starting points. Not legal advice. Your lawyer will adapt the wording to your country and contract.
1. Present assignment of the work
The Developer hereby assigns to the Client all right, title, and interest, including copyright and all other intellectual property rights, in the Deliverables, as each part is created.
“Deliverables” should be defined widely: source code, designs, documentation, database schemas, build scripts, and test code made for this project.
Many agencies ask for the assignment to take effect on payment. That’s a fair request, since it protects them from a client who takes the code and doesn’t pay. If you agree, tie it to each milestone (“on payment for each milestone, the Deliverables of that milestone”) instead of the final invoice. Otherwise one disputed invoice can leave you owning nothing.
2. Backup for US contracts
To the extent any Deliverable is a work made for hire under US law, it is made for hire for the Client. To the extent it is not, the Developer hereby assigns it to the Client under clause 1.
This covers both routes. The assignment does the real work.
3. The agency’s existing tools
The Developer keeps ownership of the Pre-existing Materials listed in Schedule B. The Developer grants the Client a perpetual, irrevocable, worldwide, royalty-free licence to use, copy, modify, and distribute them as part of the Deliverables, including through any future developer.
Agencies reuse their own libraries, and that’s normal. What you need is the list, by name, before you sign, and a licence wide enough that another team can keep working on your product.
4. Staff and subcontractors
The Developer confirms that every person who works on the Deliverables has assigned their rights to the Developer in writing. The Developer will not subcontract any part of the work without the Client’s written approval.
This closes the gap where a freelancer hired by the agency still owns their part.
5. Source access from day one
All source code is committed to a repository owned by the Client, at least at the end of each working day. The Client may grant and remove access to it at any time.
This is the clause that matters most in practice. An assignment gives you the right to the code. A repository in your account gives you the code itself. On GitHub, moving an existing repository keeps its history: “Git information about commits, including contributions, is preserved” (GitHub docs).
6. Accounts in your name
The hosting, domain, app store, payment, email, and analytics accounts used by the product are registered to the Client. The Developer works in them through access the Client grants.
Whoever holds these accounts can switch the product off, so the contract should make them yours.
7. Open-source licences
At each milestone, the Developer provides a list of third-party and open-source components and their licences. The Developer will not include components under a licence that requires releasing the Client’s source code without the Client’s written approval.
Open source is normal and good. Its licences still apply after the assignment, because the agency can’t assign what it doesn’t own. Most are simple. The MIT licence asks that “the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software” (MIT licence). The GPL goes further. If you ship GPL code in object form, its section 6 says you may do so “provided that you also convey the machine-readable Corresponding Source” (GPL v3). You want to know which kind you have before you ship.
8. Handover
On completion, or on termination for any reason, the Developer delivers the documentation needed for a competent developer to build, deploy, and run the product, and all credentials it holds for the Client.
“For any reason” matters. A handover clause that only applies at the happy end of a project helps least when you need it most.
9. Confidentiality and portfolio use
The Developer keeps the Client’s code and data confidential. The Developer may name the Client as a customer only with the Client’s written consent.
An NDA protects secrets. It doesn’t transfer ownership, so you need both.
When source code escrow makes sense
Escrow means the vendor deposits source code with an independent agent. The agent releases it to you if agreed events happen, such as the vendor going out of business or stopping support. The escrow agreement lists those events, so read them closely.
Escrow fits software you license and don’t own, like a vendor’s platform your business depends on. For custom work, a repository in your own account does the same job better and costs nothing. If you own the repository, you don’t need escrow.
10 red flags in an agency contract
- No assignment clause at all. The agency keeps the code by default.
- “Agrees to assign” with no “hereby assigns”. That’s a promise to transfer later. Ownership hasn’t moved yet.
- “Work made for hire” as the only ownership language, in a contract with a non-employee. For software, that label usually doesn’t do the job on its own under US law.
- Assignment only on final payment. One dispute at the end and you own nothing. Ask for it per milestone.
- “Reusable components” with no list. You can’t tell which parts of your product you’ll never own.
- No licence to the agency’s existing tools, or one that ends with the contract.
- The repository stays in the agency’s account “until handover”.
- Hosting, domain, or store accounts registered to the agency.
- Subcontracting allowed without your approval, with no promise that subcontractors assigned their rights.
- Handover only at successful completion, with nothing on termination.
Any one of these is fixable with a sentence. A vendor that refuses to fix any of them is telling you how the end of the project will go.
What we do
The repository, the hosting account, the domain, and the documentation are set up under the client’s name while we build, so nothing changes hands at the end that wasn’t already theirs. That’s written in our handbook chapter on how projects run, and our comparison with hiring in-house covers code ownership too. Prices are fixed from a written scope with milestone payments, as set out on our pricing page.
If you’re comparing vendors, our software quote checker flags a missing IP clause and a vendor-owned repository as must-fix items. For the rest of the vetting process, read how to vet an offshore development team before you send money, is this software quote fair?, and the best software companies in Pakistan for small projects.
FAQ
Do I own the code if I paid for it?
Not automatically. In the US, UK, EU, and Pakistan, the author or the author’s employer owns it first. A signed written assignment is what moves it to you. Payment alone doesn’t.
Does a “work for hire” clause give me the code?
For an employee’s work, yes. For an agency or freelancer, US law only treats nine kinds of commissioned work as made for hire, and software isn’t one of them. Use an assignment clause, with work-for-hire wording as a backup if you like.
Can a developer reuse my code for other clients?
If they still own it, yes. After a full assignment, no, though they can usually keep using their own pre-existing tools and general know-how. If reuse worries you, ask for the pre-existing materials list and a confidentiality clause.
Who owns the code if the agency is in Pakistan?
Under the Copyright Ordinance 1962, the agency owns what its employees write, unless an agreement says otherwise. A transfer to you must be in writing and signed by the agency. Check which law governs your contract, and have a lawyer review it.
What happens to my code if the agency goes out of business?
If the repository and accounts are in your name, you keep working with another team. If they’re in the agency’s name, you may have to get them back from an insolvency process, which is slow and uncertain. That’s the main reason to own the repository from day one.