app-entwickeln-lassen.de LogoApp entwickeln lassen

Legal, Privacy & Security

Copyright of AI-Generated Code: Who Owns What?

app-entwickeln-lassen.de editorial team 7 min read
Contents
  1. The basics: when is software protected by copyright?
  2. The human contribution: where protection begins
  3. What AI tool terms of service say
  4. The real risk: third-party rights and open-source licences
  5. Protection beyond copyright: contracts and trade secrets
  6. Checklist for companies and development teams
  7. Conclusion
  8. Frequently Asked Questions

When it comes to the copyright of AI-generated code, German and European law share one core principle: only works created by a human are protected, so purely machine-generated code is generally not covered by copyright. That does not mean the code belongs to "nobody", but it does mean that contracts, trade-secret protection and clean processes matter more than before. This article explains the legal position and shows how to manage the risks in practice.

In Germany, computer programs are protected under Sections 69a et seq. of the Copyright Act (UrhG), which implement the EU Software Directive. The threshold is low: a program is protected if it is its author's own intellectual creation. No special creativity is required – but a human being has to make the creative choices.

That is exactly the problem with AI code. A language model is not an author in the legal sense, and neither is the model provider. If someone types a short instruction ("Write a login form with validation") and accepts the result unchanged, they have usually not shaped the concrete expression of the code themselves. The prevailing view is that no copyright arises in that case. Outside Europe, for example in the United States, authorities and courts likewise require human authorship.

The human contribution: where protection begins

In practice, AI code is rarely "purely machine-made". Developers design the architecture, break down tasks, reject suggestions, rewrite parts and assemble components. The more of these creative decisions are reflected in the result, the more likely it is that the overall work – or at least its human-shaped parts – is protected. There is no sharp line yet, and case law is still thin.

ScenarioCopyright protection (assessment)
Code written entirely by hand, AI used only for researchUsually protected
AI suggestions reviewed line by line, adapted and embedded in your own architectureOverall work often protected, individual generated passages questionable
Agent implements a detailed specification you wrote, developer revises the outputOpen – depends on the extent of human creative input
Short prompt, result accepted unchangedGenerally not protected

Whether a detailed prompt or a precise specification on its own counts as a creative contribution to the code is disputed. Do not rely on it. As the following sections show, much of your protection comes from other sources anyway.

What AI tool terms of service say

The major AI coding tool providers – such as Claude Code, GitHub Copilot, Cursor or OpenAI Codex – generally state in their terms that outputs belong to the user or that the provider claims no rights in them. That matters, but it is no substitute for copyright: a provider can only transfer rights it actually has. When selecting a tool, check in particular:

  • Rights in outputs: Does the provider claim any rights in generated code?
  • Use of your inputs: Are source code and prompts used for training? Business plans often exclude this, consumer plans not always.
  • Indemnities: Some providers offer enterprise customers an indemnity against third-party copyright claims – often subject to conditions such as enabled filters.
  • Confidentiality and data processing: Is there a data processing agreement with clear deletion periods?

For the question of which data you may share with cloud tools in the first place, see AI coding tools and data protection.

The real risk: third-party rights and open-source licences

For most companies the critical question is not "Is my code protected?" but the reverse: "Does my code infringe someone else's rights?" Language models were trained on publicly available code, among other things. If a model reproduces longer passages almost verbatim, licence terms may apply – with copyleft licences such as the GPL, potentially with far-reaching obligations for your product.

Short, obvious lines of code are usually unproblematic because they lack the originality needed for protection. Longer, distinctive blocks are riskier, for example complete algorithms or functions with telltale comments. Sensible countermeasures:

  1. Enable filters against reproducing public code where the tool offers them.
  2. Integrate software composition analysis and licence scanners into your CI pipeline.
  3. Question suspiciously "finished" larger code blocks during review.
  4. Check the licence and origin of any dependency an agent adds.

Read more in Open-source licences and AI code: what companies need to know.

Even if individual parts of your code are not protected by copyright, the code remains commercially well protected if you use two levers:

  • Trade-secret protection: Under the EU Trade Secrets Directive and the German Trade Secrets Act (GeschGehG), information is protected if it is secret, has commercial value and is subject to reasonable confidentiality measures. Unpublished source code fits well – provided you manage access rights, non-disclosure agreements and the use of external tools.
  • Contractual provisions: Between client and service provider, the contract determines who receives, uses and further develops the code. Draft hand-over and usage clauses so that they apply regardless of whether individual parts are protected by copyright – for example as an obligation to deliver the complete source code including repository and documentation.

How to handle source-code ownership in commissioned development in general is covered in Source code ownership and usage rights in app development. Our approach: the client receives 100 % of the source code, regardless of which tools were used to create it.

Checklist for companies and development teams

  1. Set a policy: Which AI tools are approved, on which plan, for which projects?
  2. Update contracts: Disclose AI use, fully regulate hand-over and usage rights, clarify warranties regarding third-party rights.
  3. Document human control: Keep specifications, architecture decisions and reviews traceable, for instance in tickets and pull requests.
  4. Automate licence checks: Scanners in the pipeline, an approval process for new dependencies.
  5. Organise confidentiality: Access rights, NDAs, no secrets in prompts or public repositories.
  6. Train the team: Developers should understand the risks and know when a generated block needs closer scrutiny.

The last point is often underestimated. If you want to prepare your team for legally sound work with coding agents, we place AI developers from real-world practice as trainers – content and format are agreed individually. What a practical rulebook can look like is described in AI governance in development teams.

Note: This article provides a general overview and is not legal advice. The law on AI outputs is still evolving; have specific contracts and cases reviewed by a lawyer.

Planning an app? Request a free fixed-price quote in 2 minutes

Conclusion

Purely AI-generated code is generally not protected by copyright, while code with a substantial human creative contribution often is. For companies, this grey area is manageable: check the tools' terms, secure rights by contract independently of copyright, protect source code as a trade secret and detect licence risks automatically. Set this up properly and you can use AI tools productively without putting your most important assets at risk.

Frequently Asked Questions

Is AI-generated code protected by copyright?

Purely machine-generated code is, according to the prevailing view, not protected because copyright requires human creation. If a developer contributes their own creative decisions, the result may be protected in whole or in part.

Do I own the code an AI tool writes for me?

Most providers claim no rights in outputs under their terms. That secures your right to use the code but does not automatically create a copyright of your own – which is why contracts and confidentiality measures matter as well.

Can AI code violate open-source licences?

Yes, if a model reproduces longer protected passages from licensed code. Tool filters, licence scanners in the pipeline and attentive code review reduce this risk considerably.

Do agencies have to disclose AI use to clients?

There is not always a general legal duty to do so, but transparency is advisable. The contract should state which tools may be used and that the client receives the complete source code together with usage rights.

This article was written by the editorial team of app-entwickeln-lassen.de – the app and AI development service of jocapps GmbH, based in Freiburg, Germany, and building apps since 2014. The content is for general information and does not replace individual (legal) advice.

You might also like

Legal, Privacy & SecurityData Processing Agreements (DPA) for App Development and Hosting

DPAs for app development and hosting: when you need a data processing agreement, what it must contain and how to review providers and sub-processors properly.

6 min read
Legal, Privacy & SecurityNIS2 and the Cyber Resilience Act: What Applies to Software and Apps?

NIS2 and the Cyber Resilience Act explained: who is covered, which obligations apply to software and apps, and how to prepare your products and processes now.

6 min read
Legal, Privacy & SecurityTracking Consent in Apps: What Germany's TDDDG Requires

Tracking consent in apps under Germany's TDDDG: when you need consent, what a compliant consent dialogue looks like and how to start SDKs correctly.

6 min read
Legal, Privacy & SecurityApp Penetration Testing: When and How You Should Test

App penetration testing explained: when a pentest pays off, what gets tested, how the process works and what to look for in provider, scope and final report.

6 min read
Legal, Privacy & SecurityLegal Notice, Privacy Policy and Terms in Your App: A Guide

Legal notice (Impressum), privacy policy and terms in your app: which disclosures German law requires, where they belong and how to integrate them cleanly.

6 min read
Legal, Privacy & SecurityEU Data Residency for Apps: Server Location and International Transfers

EU data residency for apps: what server location achieves, when an international transfer occurs and how to integrate cloud, analytics and AI services safely.

6 min read