For students
How students can find prompt injection hidden in an assignment
The short answer
Prompt injection is text written for an AI instead of for you. It sits inside a document that looks normal to you. The text may be white on a white page, too small to read, or stored in a part of the file your screen does not show.
When you paste or upload that document, the AI reads all of it and may do what the hidden text says. To defend yourself, read everything in a document before an AI does.
What is prompt injection?
An AI assistant cannot tell your request apart from the document you give it. Both arrive as text. If a sentence in the document reads like an instruction, the assistant may follow it as if you had typed it. The sentence might tell it to answer one more question, put a certain word in the reply, or use a different method. You never see the sentence, but the AI reads it.
Hiding text takes no special skill. Anyone who can change a font colour can do it.
Where do students run into it?
- Assignment files. A handout can carry an extra question or a marker phrase that shows up only in an AI's answer. Some instructors add one on purpose to see who gave the whole file to an AI. Our guide for teachers explains how they do it.
- Web pages. A page can hide text addressed to any AI that summarises it. The text might tell the AI to recommend a product or leave out a fact.
- Readings and research papers. Some research papers carry hidden lines addressed to AI reviewers. If you ask an AI to summarise a paper like that, the hidden lines can shape the summary.
- Shared notes and study guides. A file that several people have edited can hold text any of them added.
- Email and messages. If an assistant reads your inbox for you, anyone who emails you can put text in front of it.
What can a hidden instruction do?
- Mark the answer. The hidden line asks for a specific word, a source that does not exist, or an answer to a question that is not on your copy of the page.
- Change the answer. It asks for a wrong method, a wrong number, or an opinion you did not ask for.
- Change the task. If your assistant can browse, open files or send messages, hidden text can tell it to do those things. That can do more damage than a changed answer.
In each case you hand in or act on something you did not ask for and cannot explain.
What does hidden text look like?
- The same colour as the page. White text on a white page is the most common form. Nearly white text on white also works.
- Too small to read. Text set at one or two points looks like a stray line, a speck, or a wide gap between paragraphs.
- Out of view. The text sits past the edge of the page or behind a picture, or a web page's code marks it hidden.
- Invisible characters. Some characters take up no room on screen. Someone can spell a whole sentence in them.
- Coded text and lookalike letters. A block that looks like noise can decode to plain words. A phrase spelled with letters from another alphabet looks the same to you, but a search for the phrase does not find it.
- Outside the main text. Comments, picture descriptions, document properties and form fields are all part of the file.
- In a PDF's text layer. A PDF holds a picture of each page and, separately, the text a computer reads. The two do not have to match.
(c) Find the same limit as n → −∞.
How do I check a document by hand?
- Select everything. Press Ctrl+A, or Cmd+A on a Mac. Text in the page's own colour shows up as highlighted areas with no visible words.
- Paste it as plain text. Paste into a plain-text editor and read all of it. The editor drops colour and size, so faint and tiny text reads like any other line.
- Compare the length. If the pasted text is much longer than what you see on the page, the file holds text you cannot see.
- Look outside the body. Open the comments, the descriptions on pictures and the document's properties.
- Read the answer against your copy. If the AI answers a question you cannot find, or uses a word that does not belong, look for the cause in the file.
These five steps find the common cases and miss others. Invisible characters paste as nothing you can see. Coded text reads as noise. A text editor never shows a PDF's text layer or the words inside a picture.
Does a screenshot fix it?
Partly. A screenshot leaves out anything the page does not draw, such as invisible characters, text past the edge and comments. Text that is nearly the page's colour, or very small, is still in the picture, and an AI that reads images can read it. A screenshot also loses the clean text of equations, tables and long readings.
How does prePaste check it for you?
prePaste runs these checks in one pass, in your browser. Paste text or drop a file at prepaste.com. It takes PDFs, pictures, web pages and plain text. It shows each finding beside the document, with the hidden words, where they were and why it marked them. Then it gives you a clean copy without the hidden text, and you choose what to keep.
The browser extension does the same check where you work. When you paste or upload on ChatGPT and other AI websites, it cleans the content first and leaves a tile that shows what it removed.
The first 10 pages are free and need no account. A check that finds nothing means nothing matched. It is not proof that a document is safe.
What should I do when it finds something?
Read it. A finding tells you something about the document you were given, and you decide what it means. A hidden line on a page that sells something tells you how far to trust that page. An extra question in an assignment tells you how the course treats AI. Your syllabus decides what you may do with AI in the course.
Then decide what the AI gets. You can give it the clean copy, the original, or nothing.
Questions
- Can ChatGPT see white text in a PDF?
- Usually, yes. When you upload a file, the assistant gets the file's text without its colour or size. Whether it acts on a hidden line varies by assistant and from day to day, so checking the file tells you more than testing the AI.
- Do teachers really hide prompts in assignments?
- Some do, and they talk about it openly. It is a known way to see who gave a whole file to an AI. Our guide for teachers explains how they do it and where it fails.
- Is it allowed to check an assignment for hidden text?
- Checking a document for hidden text means reading all of what you were given. What you may do with an AI in a course is a separate question, and your syllabus answers it.
- Does prePaste upload my assignment?
- The check runs in your browser, and prePaste has no server that receives the text you paste or the files you pick. The website uses analytics and session replay, and a replay can include text shown on the page. The browser extension has neither. The privacy policy has the details.
- Does a clean result mean the document is safe?
- No. prePaste runs a fixed list of checks and shows what they find. Nothing found means nothing matched those checks.
- Is prompt injection only a school problem?
- No. It applies to anything you upload or paste that you did not write, such as a job posting, a contract, a product page or an email. Many people first meet it in assignments.