Yes, but only if the contract assigns the rights instead of licensing them, and the transfer happens as the work is created rather than at final delivery. Check that it covers source code, prompts, evaluation sets, configuration, documentation and your data, not just the code. Keep the repository and every cloud and model-provider account in your own name, ask for a list of third-party components and their licences, and test the handover with another engineer before the engagement ends. This is not legal advice.
Can you really own the code an AI agency builds for you?
Yes, but only if the contract says so in the right words. "You own the deliverables" in a sales deck is a promise; a signed clause that assigns the rights is what makes it true. By default the person who writes code, or the firm that employs them, holds the copyright. Ownership reaches you only through an agreement.
With AI work, the code is only part of what you are buying. The prompts, the evaluation sets, the configuration and the accounts the system runs in matter just as much. This is a practical checklist from the builder's side, not legal advice; have a lawyer read the contract you actually sign.
What is the difference between owning code and licensing it?
This is the first thing to check, because the two look identical until you leave.
| Term | What it gives you | What to watch for |
|---|---|---|
| Assignment ("hereby assigns") | The rights move to you. You can change it, sell it, or hand it to another team | Whether it covers everything, including prompts and evaluation data, and when it takes effect |
| Exclusive licence | Only you may use it, but the agency still owns it | Termination clauses, restrictions on modifying or transferring, and what happens if the agency closes |
| Non-exclusive licence | You may use it; so may others, including your competitors | Almost never what a client thinks they bought |
| Work made for hire | Treated as yours from creation, where the law allows it | Rules vary by country, and an assignment clause is usually added as a backstop |
Look for language that assigns rights in all deliverables and in work in progress, and ask when the transfer happens. If it waits until final delivery or full payment, you have no claim on a half-built system if the relationship ends early.
What should your AI agency contract say you own?
- Source code: the application, the integrations, the infrastructure scripts and the tests.
- Prompts and system instructions, including their version history. For an agent, these are the logic.
- The evaluation set and scoring scripts. Without them nobody can tell whether a change made things better, as explained in our post on the evaluation harness.
- Configuration and workflow definitions, such as n8n flows, tool schemas and retrieval settings.
- Documentation and runbooks, so another engineer can run it.
- Your data, and anything derived from it: embeddings, fine-tuned weights if any were trained on it, and logs.
Fine-tuned model weights deserve their own line. If a tuned model was trained on your data, say who holds it and whether the agency may reuse it for anyone else.
What can an agency legitimately keep, and what should worry you?
Pre-existing tools and open-source components
Agencies often reuse internal libraries and frameworks. That is normal and often makes the build cheaper. What matters is that the contract names them, gives you a perpetual licence to use them inside what you were delivered, and does not make the system unusable without them. Ask for a bill of materials listing every third-party package and its licence.
Model providers' terms
The underlying models belong to their providers, and their terms govern how you may use the output. Make sure the accounts and API keys are in your name, or that you can move them to your name, so the system does not stop working when the agency does.
Code written with AI assistance
Many teams, including us, use AI coding tools. Copyright protection for output with little human authorship is unsettled and differs by country, so ask how the agency uses these tools, and what it will warrant about the origin of the code. See our approach to building with AI coding tools.
Red flags
- Rights that transfer only at the end of the project, or only after final payment.
- Hosting, repositories or model accounts held in the agency's name.
- A licence that ends if you stop paying a support fee.
- A refusal to list the third-party components.
- Wording that lets the agency reuse your prompts, data or tuned models for other clients.
How do you check you own what you were promised?
- 01
Ask for the clause before you sign
Read the intellectual property section yourself. Look for assignment language, the timing of the transfer and the list of what is covered.
- 02
Keep the repository in your own account
Have the agency work in a repository you own and administer, from the first commit. Then there is nothing to hand over at the end.
- 03
Hold the accounts
Cloud, model provider, vector database, monitoring and domain accounts should be under your organisation with the agency added as users.
- 04
Get the component list
A list of third-party packages and their licences, so you can spot anything that restricts commercial use.
- 05
Test the handover early
Ask another engineer to build and deploy it from the documentation alone, ideally before the contract ends. What they cannot do from the instructions is something you do not really own yet.
If you are comparing partners, add ownership to your evaluation; our checklist for hiring an AI development partner covers it. If you might change partners later, read what switching AI vendors mid-project costs.
Can you really own code built by an AI agency?
Yes, if the contract assigns the rights rather than licensing them, and does so as the work is created and not when the project ends. Make sure it covers prompts, evaluation data and configuration as well as source code, keep the repository and accounts in your name, and get a list of third-party components. Test the handover while you still have leverage.
Our own position is that clients own every line, prompt and evaluation from the first commit. See how we work on our AI product development page.
