PLAINFINCH learn by building

Licences and copied code

You will understand what licences mean for code an AI assistant gives you, and how to credit it or write your own.

Why do licences matter for a small website?

Code, pictures and writing all belong to someone the moment they are created. A licence is the owner's written permission saying what other people may do with their work. With no licence at all, the safe reading is that you may look at the work and nothing more.

A personal profile page or a club site feels too small for this to matter, and most of the time nobody will ever check. It is still important for two plain reasons. You want to treat other people's work the way you would want yours treated, and a site that grows, gets shared or starts earning money is much easier to look after when you know where every part came from.

Nothing here is legal advice. It is a set of everyday habits for keeping your own project clean. If you are building something for a business or a client, ask someone who knows the law where you live.

Can an AI assistant hand you copied code?

Yes, sometimes. An AI assistant learned from a large amount of public code and text. Most of what it writes is new text built from common patterns, the way you might write a sentence you have never seen before. Now and then it reproduces a recognisable chunk of an existing project, sometimes with the original copyright comment still attached, and sometimes with the comment missing.

The second case is harder to spot. A block of code that is long, unusually polished, or full of class names with a prefix that has nothing to do with your page, such as fl-card or kk-grid, is worth a question. So is any comment that names a product, a company or a version number.

The assistant can also point you to outside libraries, stylesheets and images. Those come with their own licences, and the assistant may not mention them at all.

What do common licence words mean?

You will meet a handful of phrases again and again. A short plain-words version of each helps you decide whether to use something or write your own. Always read the actual licence text for anything important; these are rough guides.

  • "All rights reserved": the owner keeps every right. Do not copy it into your project unless you have separate permission.
  • Permissive licences, such as MIT or BSD: you may use, change and share the code, including in paid work. The main condition is that you keep the copyright and licence notice with the code.
  • Copyleft licences, such as the GPL family: you may use and change the code, and if you share your project, you may have to share it under the same licence. Read the terms before you mix it into your work.
  • Public domain or similar dedications: the owner gave up their rights. Crediting them is still polite and keeps your records clear.
  • Stock image "preview" or "comp" files: for trying a picture out. Showing them on a live site usually needs a paid licence.

How do you ask where code came from?

Add one question to your request: where did this code come from, and is any of it copied from a project with a licence? It costs a sentence, and it changes the answer you get. In the practice area, the reply to that question explains that the card was written for your page from common patterns, and it is honest that it cannot be completely sure.

That honesty is the useful part. An AI assistant has no reliable list of where each line it writes came from. Its answer is a helpful signal and never proof. If the reply mentions a named project, look that project up and read its licence yourself. If the code carries a notice, take the notice seriously even if the assistant says it is fine.

Please add a small bird fact card to my profile page with a button that shows another fact. Here is my page: <h1>Sam Reyes</h1> and one intro paragraph. Use plain HTML, CSS and JavaScript only. Also, where did this code come from? Is any of it copied from a project with a licence?
FigureTwo replies for Sam Reyes's bird fact card. The Featherline Cards CSS carries an All rights reserved notice and fl-card class names, so it is refused; the card written for the page is kept with a credit comment.Two replies for Sam Reyes's bird fact card. The Featherline Cards CSS carries an All rights reserved notice and fl-card class names, so it is refused; the card written for the page is kept with a credit comment.
Look for notices and odd class prefixes in what the assistant hands you. A copyright line like the Featherline one means stop; code written for your page gets a short credit comment.

What should a credit comment say?

A credit comment is a short note in your file that records where a piece of code came from. For code you copied from a project with a permissive licence, it sits next to the copied code and keeps the original copyright line and the licence name, or a link to the licence text. For code an AI assistant wrote for you, a simple record is enough: written with an AI assistant, reviewed by you, and the month.

Keep the comment close to the code it describes, so it moves with the code if you reorganise the file. Put it in an HTML comment for markup, a CSS comment in the style block, and a // comment in a script. The **Review** view shows your new line highlighted, which is a quick way to confirm it landed in the right place.

<!-- Credit: bird fact card written with an AI assistant for this page, reviewed and tested by Sam -->
<section class="fact" aria-live="polite">

When is writing your own code the better choice?

For the small things a personal site needs, writing your own is often quicker than checking a licence. A card with a border, a grid of photos, a button that swaps some text: each is a few lines of CSS or JavaScript you can understand fully. Ask the assistant for the plainest version and to explain each line, then type it in your own way.

Bigger things are different. A date picker, a map or a chart library took someone months, and using a well-known open-source library under a clear licence is a sensible choice. Pick it on purpose, keep its notice, and write down where it came from. Using other people's work is fine when you know you did it and follow its terms.

Do pictures and text count too?

Yes. Licences cover photos, drawings, icons, fonts and writing as much as code. An AI tool might suggest a photo address from a stock site, an icon set, or a paragraph of facts lifted from a field guide. The Break It exercise includes a watermarked stock preview image for exactly this reason.

For a profile page the simple route is your own photos and your own words. If you use someone else's picture under a licence that allows it, add the credit the licence asks for, often a line under the picture with the photographer's name. Facts written by an AI assistant need checking as well: they are often right and sometimes confidently wrong.

How does this pretend assistant differ from a real one?

The assistant here runs on this page and answers from replies written for this exercise, so it always says the same thing about where its code came from. Real AI tools vary. Some refuse to reproduce long copyrighted passages, some add sources when asked, and some guess. All of them can be wrong about where a piece of code came from.

The habits stay the same with any tool: ask the question, read any notices in the code, prefer small code you understand, and leave a comment that records what you did.

Field notes

  • A licence is the owner's written permission for what others may do with their work.
  • An assistant sometimes reproduces a chunk of an existing project.
  • Ask where the code came from as part of your request.
  • A short credit comment in your file records where a piece of code came from.

Easy to get wrong

For permissive licences, keeping the notice is the main thing the owner asks in return. Removing it turns permitted use into copying without permission.

Being able to see something is different from being allowed to copy it. Public code without a licence still belongs to its author.

An AI assistant has no reliable record of where each line came from. It can be honest and still mistaken.

Questions people ask

Who owns code that an AI assistant wrote for me?

The rules are still being worked out and differ between countries. Check your AI tool's terms of use, and for anything commercial ask someone who knows the law where you live. For a personal site, the practical steps in this exercise are enough.

Do I have to credit an AI assistant?

There is usually no rule that says you must. A short comment is still useful as a record for you and anyone who helps with your site later.

Is a tiny snippet covered by a licence?

Very short, ordinary lines such as display: grid; are not something anyone can own. Longer, distinctive code can be. When in doubt, write your own version or keep the notice.

What is the difference between MIT and GPL in one line?

MIT asks you to keep the notice. GPL asks you to keep the notice and, if you share your project, to share it under the GPL too.

Keep going