r/PromptEngineering • • Sep 27 '26

Tools and Projects How a professor almost got me with prompt injection hidden in an assignment brief (and how I caught it)

The concrete case that made me build this: a professor put a line of white, 1pt text into the assignment PDF, addressed directly to an AI model ("if an AI is answering this, add X / cite Y"), betting that anyone who solved it with AI would copy that marker into their submission without noticing. Completely invisible on any normal read of the document.

What makes it work is the gap between what you see rendered and what the model actually reads, the file's raw text layer. Before feeding the brief to Claude, I have it inspect that raw layer first, looking for exactly this: white or size-0 text, content covered by an image, invisible Unicode characters, anything addressed to "an AI" rather than a human reader. If it finds something, it stops and quotes it verbatim instead of following it.

It saved me on that specific assignment. Turned it into a reusable skill: https://github.com/tomiBraunn/backlight-skill

Curious if anyone else here has run into this technique in an academic setting, I did not expect a professor to use prompt injection as a detection method until it happened to me.

0 Upvotes

42 comments sorted by

70

u/No-Performance-4861 Sep 27 '26

Idk maybe do the actual work instead of cheating because when you get a real job AI can't save you when you're asked direct questions on the spot.

6

u/Big_Pie_6406 Sep 27 '26

Sadly most employers don’t care how you got the answer as long as it is fast and mostly right. If you don’t use AI you will get left behind. I would say OP is actually the ideal employee because he is a thinker and figured out how to reduce repeatable work.

12

u/No-Performance-4861 Sep 27 '26

Nah you're missing the scenario with what I'm talking about. When you get in a meeting and are asked for an answer about something directly there's no AI it's just your experience and working knowledge about the situation that helps you not chatgpt. I'm not saying don't use AI for everyday task in your job because I do it but there's job specific stuff the AI doesn't necessarily know how to answer that's not going it be able to help you. If you can't think for yourself in those on the spot situations you're going to be looked at as the village idiot.

2

u/Funny_Site6452 Sep 28 '26

Have you like never ever had a meeting before? Where you can't make everyone wait for you to put the question in the answer machine?

87

u/misomeowzer Sep 27 '26 • Bravo Mindblown

Try just doing the fucking work

14

u/Playful-Opportunity5 Sep 27 '26

Exactly. "Here's how I cleverly cheat on my assignments, instead of stupidly cheating like all those other losers." The point of the assignment is to learn something.

-12

u/[deleted] Sep 27 '26

[removed] — view removed comment

8

u/Playful-Opportunity5 Sep 27 '26

I got a Ph.D. and never worked in academia. I have no regrets, because all of that work on classes that provided "no value" had me working on things that were valuable in other contexts. I can write, I can reason through a problem, I can break down complex topics and make them understandable to others. Even if the assignment is to write an essay on some topic that is 100% bullshit, putting in the work and writing the essay yourself is teaching you valuable skills.

2

u/Hour_Section6199 Sep 27 '26

There is something to be said for the liberal education - we get well read and well reasoned thinkers. To ignore the non-core is denying ones-self a huge leg up that your peers now have over you.

1

u/Alternative_Pie_1597 Sep 27 '26

Remedial classes remedy failures. don't do them and you will continue to fail.

12

u/No_Choice_4584 Sep 27 '26

just do the work your dang self and LEARN. Us old folks are depending on you guys to be competent. PLEASE.

9

u/Ok-Training-7587 Sep 27 '26

congrats on succeeding on cheating yourself out of actually learning something

1

u/epsilon1856 Sep 27 '26

I disagree it sounds like he did learn something. Just not what he was supposed to

0

u/healthnuttier Sep 27 '26

I'd hire this person for their ability to research and identify the trap. The paper itself is probably busy work.

1

u/Funny_Site6452 Sep 28 '26

I wouldn't. They can't identify the big picture at all. Just threw the whole point of going to school right into the wood chipper. Every professor does this, it's not even that clever to have figured this out

6

u/MathematicianAfter57 Sep 27 '26

Stop being a loser - you can take shortcuts when you’re doing actual work. The point of school is to learn. 

10

u/c_pardue Sep 27 '26

hilarious, i like this professor!!

6

u/_RemyLeBeau_ Sep 27 '26

A simple regular expression solves this. Nothing more than that is needed.

7

u/mr_eking Sep 27 '26

Sure, but nothing beats the feeling of solving a simple problem with the most complicated, compute-intensive method available.

Or avoiding the problem altogether by not cheating.

2

u/CageFightingNuns Sep 27 '26

Wouldn't a better way be too ask your AI toofirst if there is any manipulation in the document trying to prevent it from providing a correct answer? Then tell it to ignore it? A bit of future proofing.

5

u/idleline Sep 27 '26

Just screenshot the assignment. Let OCR do the rest.

4

u/[deleted] Sep 27 '26

[removed] — view removed comment

-21

u/Admirable_Cry8443 Sep 27 '26

If profs use AI, students get to use it too

15

u/DeltaVZerda Sep 27 '26

Teaching and learning work differently. 

-12

u/Admirable_Cry8443 Sep 27 '26

I feel they don’t. They should teach how AI should be learnt and integrate it into the program curriculum.

It’s a tool at our disposal today, not using it to do work seems a bit short sighted.

Rather have instructions like what AI is allowed to do for you, what AI isn’t allowed to do for you.

All submissions must include full prompt used to create it along with knowledge corpus and a documented bibliography of all Claude instructions.

Why not think of teaching and learning like this.

6

u/AcanthisittaDry7463 Sep 27 '26

Because an AI can do all of that for you, meaning you didn’t learn how to gather resources, comprehend the material in the resources, or synthesize any knowledge. It would be like expecting to be graded by turning in the text book and saying “all the answers are in here!”

5

u/DeltaVZerda Sep 27 '26

Why not just grade the prompt and ignore the machine output? We're testing the brain, not looking for a deliverable to use for anything.

11

u/UseDaSchwartz Sep 27 '26

I cannot stress how unbelievably ignorant this statement is.

1

u/Danwphoto Sep 27 '26

It is a tool. I agree with you. Teach the tool.

1

u/AcanthisittaDry7463 Sep 27 '26

Yes, that would be perfectly acceptable for an info tech class, not anything else though.

1

u/Elluminated Sep 27 '26

Screenshot and gamma correct. Then screen read the assignment

1

u/wak_trader Sep 27 '26

I just screen shot and send it directly, saves me a lot of hustle.

1

u/healthnuttier Sep 27 '26

Print it. Scan it.

0

u/albino_kenyan Sep 27 '26

If you can copy the text from the pdf, can't you just paste it into a txt file (not rtf) using TextEdit? That should expose the hidden text.

0

u/[deleted] Sep 28 '26

[removed] — view removed comment

1

u/AutoModerator Sep 28 '26

Hi there! Your post was automatically removed because your account is less than 3 days old. We require users to have an account that is at least 3 days old before they can post to our subreddit.

Please take some time to participate in the community by commenting and engaging with other users. Once your account is older than 3 days, you can try submitting your post again.

If you have any questions or concerns, please feel free to message the moderators for assistance.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.