Ethics, Copyright, and Intellectual Property in AI-Generated Code

Hi! Generative AI has become a full-fledged developer tool: it helps write functions, explain errors, create tests, refactor code, and rapidly build prototypes. But greater productivity also raises an important question: who owns AI-generated code, whether it can be used in a commercial project, and whether it infringes anyone else’s rights?

There is no single, universal answer. The rules depend on the jurisdiction, the terms of the AI service, the nature of the human contribution, the source of the code, dependency licenses, and company policies. WIPO notes that AI raises questions about authorship, ownership, compensation for rights holders, and the use of AI in the creative process and that legal approaches continue to evolve.

A safer approach for developers is not to treat AI as an “automatic owner” or “automatic author,” but as a tool in the software development process.

Contents:

Important: For critical commercial, licensing, or litigation matters, check the laws and contractual terms of the relevant country.

What to Manage When Using AI for Coding

AI code raises more than a single copyright question. In practice, several layers of risk need to be managed at once.

AreaKey questionPotential risk
AuthorshipWho created the output?Uncertainty over whether the code is protected
CopyrightIs this specific snippet protected?No rights, or limited rights
LicensingDoes the code carry license obligations?Breach of usage terms
Intellectual propertyDoes your company own the rights?Disputes between a developer and employer
ConfidentialityCan the code be submitted to an AI service?Disclosure of trade secrets
SecurityIs the generated code secure?Vulnerabilities and data leaks
ContractsWhat do internal policies allow?Contract breach
EthicsIs AI being used fairly?Reputational and professional risks

WIPO recommends that organizations assess generative AI-related IP risks holistically and put organizational and technical safeguards in place.

AI Is a Tool, Not a Substitute for Developer Accountability

One of the biggest mistakes is assuming that AI is responsible for the output.

In reality, the developer or company integrating the code into a product must assess whether:

  • the code works as intended;
  • it contains no vulnerabilities;
  • it fits the project architecture;
  • it complies with applicable licenses;
  • it includes no third-party protected material;
  • it can be used in the intended product;
  • its use does not conflict with a contract or company policy.

AI can suggest a solution, but the fact that code was generated does not automatically grant permission to use it.

This matters especially in commercial software, where a small function may become part of a product distributed to thousands or even millions of users.

This is one of the most difficult questions.

In many legal systems, copyright is tied to human creative contribution. WIPO notes that computer programs are generally protected by copyright as literary works, but the specific criteria for protection are determined by the relevant jurisdiction.

It is therefore important to distinguish between two scenarios.

When a Person Actively Works with AI

For example, a developer:

  1. defines the technical problem;
  2. sets the architecture;
  3. generates several alternatives;
  4. analyzes the output;
  5. modifies the code;
  6. integrates it with their own components;
  7. tests it;
  8. makes creative decisions about the final implementation.

In this case, AI is part of the developer’s toolkit, and the human contribution may matter when determining what parts of the output are protected.

When a Person Barely Intervenes

A different scenario is when a user gives a very broad prompt and inserts the output into a product without reviewing it.

In this situation, questions of authorship and protection for the specific output can be much more complicated.

For example, the U.S. Copyright Office emphasizes the principle of human authorship and separately considers cases where AI-generated material is combined with human creativity.

Practical takeaway: Do not build an IP strategy on the assumption that everything generated by AI automatically has the same status as code created entirely by a person.

Who Owns the Rights to Code in a Commercial Project?

Even if code may qualify for copyright protection, another question remains:

who has the right to use and distribute it?

Several sets of rules may apply to a real-world project at the same time:

  • copyright;
  • an employment agreement;
  • an agreement assigning economic rights;
  • an NDA;
  • license agreements;
  • the AI service’s terms of use;
  • the company’s AI policy;
  • third-party library licenses;
  • open-source project rules.

So saying “I wrote this code with AI” is not enough to determine who owns the rights.

Licenses Are One of the Biggest Issues with AI Code

AI may suggest a code snippet that is structurally or substantively similar to code in a public repository.

This does not automatically mean that infringement has occurred. It does mean, however, that the licensing risk needs to be assessed.

Open-source licenses may impose a range of conditions:

  • attribution requirements;
  • an obligation to retain license notices;
  • requirements for distributing derivative works;
  • conditions on making source code available;
  • restrictions on certain types of commercial use;
  • conditions relating to patent rights.

WIPO also warns that AI-generated code may carry open-source obligations, and incorporating it into a project could potentially pass those requirements on to the product.

Check More Than Just the AI Output

In a modern project, the chain may look like this:

AI → generated code → third-party library → transitive dependency → its license

That is why reviewing only the AI response is not enough.

How to Review AI-Generated Code Before Using It

It is useful to establish a straightforward review process.

StepWhat to check
1. OriginWhat the code was created to do
2. FunctionalityWhether the code meets the requirements
3. LicensesWhether it may contain third-party components
4. DependenciesWhich libraries and packages it uses
5. SecurityWhether there are any obvious vulnerabilities
6. QualityWhether the code meets project standards
7. TestsWhether it passes automated and manual checks
8. Human contributionWhat the developer changed and reviewed
9. DocumentationWhether AI use needs to be recorded
10. Final decisionWhether the output is approved for use in the product

The more critical the component, the more thorough the review should be.

Never Share Confidential Code with AI Without Authorization

Copyright is not the only risk.

A developer might accidentally submit to an AI:

  • product source code;
  • API keys;
  • passwords;
  • tokens;
  • internal documentation;
  • personal data;
  • proprietary algorithms;
  • trade secrets;
  • snippets of a client’s code.

Even if an AI service has safeguards in place, you still need to review its terms and your company’s internal policy.

A Simple Rule

If you are not allowed to share a snippet with a third party, do not paste it into an AI tool without first checking the applicable terms.

Replace real data with placeholders instead:

Real API key → TEST_API_KEY
Client name → CLIENT_A
Real table → USERS_TABLE
Internal domain → example.internal

AI in Enterprise Development: Who Is Responsible?

Responsibility should be clearly assigned across the team.

RolePrimary responsibility
DeveloperReviewing and using AI-generated code appropriately
Tech LeadArchitectural and technical assessment
SecuritySecurity review
Legal / IPLicensing and legal matters
DevOpsManaging secrets and infrastructure
CompanyAI usage policy and risk management

For larger projects, consider creating an AI Usage Policy — a concise internal document that defines permitted and prohibited use cases.

What an AI Usage Policy for Developers Should Cover

A good policy should do more than simply say “AI is prohibited” or “AI is allowed.”

It should explain the rules.

For example:

QuestionGuidance
Can AI be used to generate new code?Yes, if the policy allows it
Can proprietary code be submitted?Only under approved conditions
Does the output need to be reviewed?Yes
Do licenses need to be checked?Yes, especially for production code
Can security-sensitive code be generated?Only with additional review
Should AI use be documented?Recommended for critical projects
Who is responsible for the output?The person or team that approved it

This approach is far better than using AI without oversight.

The Ethical Question: How Much Is AI Really “Writing” the Code?

Ethics begin where legal formalities are no longer enough.

A developer might formally say:

“AI created this code.”

But if a person has:

  • defined the architecture;
  • set the requirements;
  • run dozens of iterations;
  • selected the best option;
  • rewritten part of the solution;
  • tested the output;
  • integrated it into the system,

then AI is effectively a tool, not an autonomous member of the team.

It is more accurate to evaluate the creation process rather than just the source of individual lines of code.

Authorship, Teams, and AI Use

A separate challenge arises when several developers work together.

For example, one engineer designs the architecture, another writes the prompts, a third edits the AI-generated code, and a fourth integrates it into the product.

In this situation, it is worth documenting:

  • who was responsible for the design;
  • who created the main implementation;
  • which parts were generated;
  • who reviewed them;
  • who approved their inclusion in production.

This is useful not only in legal disputes. A record like this also helps maintain the code years later, when no one remembers exactly how it was created.

Should You Disclose the Use of AI?

There is no universal rule for every project.

However, transparency is especially important when:

  • the client has explicitly prohibited AI;
  • the contract requires disclosure of how the work was created;
  • the product is undergoing a legal audit;
  • the company has an internal AI policy;
  • the code is used in a critical system;
  • the development provenance must be verified;
  • the project has specific authorship requirements.

At the same time, requiring disclosure of every AI suggestion may be excessive. A more practical approach is to record substantial use of AI, particularly for critical components.

How to Document the Provenance of AI-Generated Code

For important projects, you can keep a simple log:

FieldExample
ComponentAuthentication module
DateDevelopment date
AI usedYes
PurposeGenerate an initial implementation
Human changesSubstantial editing
ReviewCode review + tests
LicensesChecked
SecurityChecked
OwnerTeam member

This is not a universal legal requirement, but a practical way to build an evidentiary record of how the code was created.

When It Is Better Not to Use AI-Generated Code

Sometimes the safest choice is not to use AI-generated output.

Especially when:

  • the code’s origin cannot be adequately assessed;
  • there is a high risk of a licensing conflict;
  • the code handles critical secrets;
  • the component is security-critical;
  • the contract prohibits AI;
  • the provenance of every line must be controlled;
  • the legal risk outweighs the time saved.

WIPO notes that when avoiding open-source obligations is critical, an organization may consider restricting or prohibiting generative AI use on the relevant projects.

AI Code and Open Source: A Practical Checklist

Before including a substantial AI-generated snippet in an open-source or commercial project, ask:

  • Is the purpose of the code known?
  • Has a person reviewed the output?
  • Have the dependencies been checked?
  • Have the licenses been analyzed?
  • Is there any obvious copying of third-party code?
  • Has the code been tested?
  • Has security been reviewed?
  • Does the output comply with company policy?
  • Does the contract allow AI use?
  • Can the output legally be used in the relevant jurisdiction?
  • Does the use of AI need to be documented?

Why One Rule Cannot Be Applied Worldwide

Copyright, patent law, and rules governing software and AI differ across legal systems.

WIPO continues to examine AI and intellectual property, including authorship, inventorship, training data, AI outputs, and rights management. In 2026, these issues remain part of the international discussion.

Projects in Ukraine should take current Ukrainian law into account. For example, the current version of Ukraine’s Law on Copyright and Related Rights is available through WIPO Lex and was consolidated as of July 31, 2026.

An international product may therefore need a separate IP assessment for each market.

A Practical Model for Using AI Safely in Software Development

The simplest approach is to build a process around five steps:

1. Generate → 2. Review → 3. Sanitize → 4. Test → 5. Document

1️⃣ Generate

Use AI for:

  • prototyping;
  • generating boilerplate code;
  • writing tests;
  • documentation;
  • refactoring;
  • explaining complex sections of code.

2️⃣ Review

Review the:

  • logic;
  • architecture;
  • dependencies;
  • licenses;
  • security.

3️⃣ Sanitize

Remove:

  • secrets;
  • personal data;
  • internal names;
  • unnecessary dependencies;
  • questionable snippets.

4️⃣ Test

Run:

  • unit tests;
  • integration tests;
  • static analysis;
  • security checks;
  • code review.

5️⃣ Document

For important components, record:

  • that AI was used;
  • the nature of the human contribution;
  • the reviews performed;
  • the license analysis;
  • the developer responsible.

Best Practices for Developers

PracticeWhy it matters
Keep secrets out of promptsProtecting confidential information
Manually review AI-generated codeQuality control
Check dependenciesReducing licensing risks
Use automated testsDetecting functional errors
Conduct code reviewsIndependent review
Document substantial AI useTransparent provenance
Have an AI policyConsistent team-wide rules
Review contractsAvoiding contractual breaches
Review critical code separatelyReducing systemic risks
Keep the final decision with a personClear accountability

AI Does Not Remove Professional Responsibility

Generative AI can significantly speed up software development, but it should not turn developers into passive copy-and-pasters.

The safest model looks like this:

AI generates a suggestion → the developer analyzes it → the team reviews it → the system tests it → a person makes the final decision.

Human oversight is what helps reduce technical, legal, licensing, and ethical risks at the same time.

WIPO also emphasizes the need for a holistic approach to generative AI-related IP risks, including authorship, licensing, contracts, commercialization, and intangible asset management.

Conclusion

Using generative AI to write code does not, by itself, make that code “copyright-free” or automatically grant the right to use it commercially.

Consider the entire chain:

data → AI → generated code → human modifications → dependencies → licenses → product → contractual obligations.

The best strategy is not to avoid AI entirely, but to manage how it is used.

For developers, this means following three key rules:

  1. Never give AI information you are not authorized to disclose.
  2. Never use generated code without technical and license reviews.
  3. Never shift responsibility for the final output to AI.

With this approach, generative AI becomes a managed tool in modern engineering practice—not a legal liability.

Can AI-generated code be used in a commercial project?

In many cases, yes—but it depends on the circumstances. Consider the AI service’s terms, the law of the relevant country, licenses, contractual restrictions, and the source of the code.

Does the developer own AI-generated code?

Not necessarily. Using AI does not automatically determine authorship. The human creative contribution, jurisdiction, and specific circumstances of creation may all matter.

Can AI be considered the author of software code?

There is no universal legal status for AI as an author; the answer depends on the legal system. Some approaches recognize only people as authors, and the rules for protecting AI outputs continue to evolve.

Can AI generate code from an open-source project?

AI may produce code that matches or closely resembles existing snippets. For important components, review the code, dependencies, and any potential license obligations.

Do you need to tell a client that you used AI?

Not always. Disclosure may be required or advisable if the contract, the client’s policy, or the nature of the project calls for it.

Can proprietary company code be submitted to AI?

Only if the relevant policy, contract, and service settings permit it. Do not submit confidential code, secrets, or personal data to AI without checking first.

Who is responsible for an error in AI-generated code?

In practice, responsibility cannot simply be shifted to AI. If a developer or company incorporates code into a product, they must oversee its quality, security, and lawful use.

Should AI use be documented?

For small experiments, documentation may be unnecessary. For commercial, critical, or legally sensitive systems, recording the code’s provenance and human contribution can be very useful.

Is reviewing only the AI-generated code enough?

No. Also review dependencies, third-party libraries, licenses, security, and contractual restrictions. Integrating code into a larger system can create additional risks.

What is the most important rule for using AI in programming?

Never accept AI-generated code blindly. AI can speed up development, but the final technical, legal, and ethical decision must remain under human control.

Mykhailo Petrov
Mykhailo Petrov

Full-cycle WordPress website development, improvements, new features, bug fixes, maintenance, updates and migration to another domain or hosting.