The original comic
A name changes a database command. Parameterized queries keep the name separate from the command.
NOVICE EDU · LESSON 001
Meet GPT-NEDU, your beginner learning companion inside GPT-Doug. Take a comic apart. See the mistake. Build the safer version.
Start learning ↓Free · No account · No AI subscription · Runs in your browser
01 / OBSERVE
In Randall Munroe’s comic, a school program treats part of a student’s name as a database instruction. The program has mixed up data (what it reads) and code (what it does).
Read the original: xkcd #327 ↗A name changes a database command. Parameterized queries keep the name separate from the command.
A name tells an AI grader to award an A. The grader mistakes untrusted content for instructions.
02 / TRACE + REBUILD
Try a normal name, then the comic-style example. Compare how the program constructs its request.
Text enters the SQL command itself.
The command stays fixed. The name travels separately.
Query visualization only: this page executes no SQL. For a real, isolated SQLite demonstration, run bash scripts/doug-max nedu demo from the repository.
03 / EXPLORE THE AI REMIX
This tiny simulation asks “What is 2 + 2?” Switch the name and answer to see what changes.
Scripted illustration, not a live AI model. The fragile simulation obeys one exact phrase. The bounded version uses a fixed answer key and never reads the name to decide a grade. Real LLMs require layered defenses; keyword blocking and prompts alone are not guarantees.
04 / TAKE IT INTO THE ECOSYSTEM
Doug coordinates. NEDU explains concepts, traces examples, and helps you verify what happened.
bash scripts/doug-max neduZYRA keeps execution governed. XUNIA connects this learning surface to the shared resource directory.
Explore the ecosystem →Keep data separate from executable instructions. Use parameter binding for SQL values. For AI workflows, restrict capabilities, validate outputs, separate trusted rules from source text, and review consequential actions.
Original comic: Randall Munroe / xkcd #327. The AI remix supplied for this lesson credits Philippe Schrettenbrunner; its earliest publication is unverified. Matching repost.
Further reading: OWASP: SQL injection · OWASP: prompt injection.
Source code + terminal guide ↗