T0 Learning to learn · Lesson 6
Using AI assistants well
What an AI assistant is and why it can be wrong with confidence, how to ask it well, how to check every suggestion, how to learn with it rather than borrow from it, and how to stay safe with secrets, private data and agents.
- say what an AI assistant is, and why its confidence is not evidence
- ask with context, the four things and exactly what you want back
- check every suggestion: run it, look up names, test awkward values, test its claims
- learn with an assistant as tutor, quiz-master and hint-giver
- keep secrets and private data out, and watch what an agent runs
The back cover
An AI assistant answers almost any question in seconds, in fluent and confident words. It can explain an error, suggest code and quiz a learner at any hour. It can also be wrong, with exactly the same confidence, because of the way it works.
These pages explain what such an assistant is and why it can be wrong without knowing it. They show how to ask it well and how to check every suggestion against the computer and the docs. They also show how to learn with it, instead of letting it do the learning.
The last part is about safety: what must never be typed into an assistant. It also covers assistants that act by themselves, running commands on a real computer.
Before you start
The story: The Oracle answers
In the corner of the Society's room stands the Oracle, a brass automaton with a calm voice. Ask it anything, and it answers at once, in perfect sentences.
You ask it why the tower lamp on Ferry Street flickers. It explains, at length, about a part called the flicker valve. Its answer is smooth and kind and sure.
Corin is delighted. "It knows everything!" Ilse does not look up from her book. "It knows how answers sound," she says. "Go and ask the lamp on Ferry Street whether it has a flicker valve."
AI assistants such as Claude, ChatGPT and Gemini can explain code, suggest fixes and write programs in seconds. Used well, they make you learn faster. Used badly, they hand you confident mistakes and leave you unable to fix them. This last lesson of the track shows how to use them well. It builds on everything before it.
| What you already know | A tiny example | Where it comes back |
|---|---|---|
| Test before you trust. | Turn each claim into a one-line test. | Every suggestion from an assistant gets the same test. |
| Awkward values. | 1.005 broke two popular rounding answers. | Assistants repeat popular answers, mistakes included. |
| The four things a helper needs. | expected, got, smallest example, what you tried | An assistant needs exactly the same. |
| Take code apart before using it. | Print each piece, from the innermost brackets out. | Code from an assistant is code from an answer. |
| is not a function. | "chai".capitalize() fails: strings have no such job. | Assistants sometimes invent jobs that do not exist. |
| Versions matter. | An answer for Node 18 may not fit Node 24. | An assistant's knowledge stops at a date. |
| Never paste a secret. | Replace a key with SECRET. | What you type into an assistant leaves your laptop. |
| MDN and the official docs come first. | MDN's page settles how toFixed rounds. | They settle disagreements with an assistant too. |
| The debugging method. | reproduce, describe, guess, test, fix, check | An assistant can help with the guess; you still do the test. |
By the end of this lesson you will be able to:
- say in plain words what an AI assistant is, and why it can be wrong with confidence;
- ask an assistant for help with the context and the request that get a useful answer;
- check every suggestion by running it, testing awkward values and checking the docs;
- use an assistant to learn faster without letting it do the learning for you;
- keep secrets and private data out of what you send, and watch what an assistant that runs commands is doing.
In one line
This lesson applies the whole track, testing, the four things, taking code apart and checking the docs, to answers that come from an AI assistant.
What an AI assistant is
At a glance
An AI assistant is a program that continues a piece of text with the words most likely to come next. It learned which words are likely from an enormous amount of writing, gathered up to a date called its training cutoff. Anything newer than that date it does not know.
Its answers sound fluent and confident, whether they are right or wrong. A confident answer that is false is called a hallucination. An assistant also does not run your code, unless it is connected to tools that do. So its confidence is not evidence: the computer and the docs have the last word.
Take a guess: Can an assistant be confident and wrong at the same moment?
Picture a friend who has read an enormous library: millions of books, manuals, forum posts and programs, up to a certain date. Ask this friend anything and an answer comes at once, fluent and confident, from memory. The friend cannot open a book to check, and does not always know when memory is wrong. Most of the time the answer is good. Sometimes it is a mix of two things half-remembered, said in exactly the same confident voice.
That friend is a good picture of an AI assistant.
A program trained on a huge amount of text to continue text: given words, it produces the words most likely to come next. An AI assistant such as Claude, ChatGPT or Gemini is built on one, and answers questions by continuing the conversation.
Three facts follow from how it works, and each one changes how you use it.
| Fact | What it means for you |
|---|---|
| It produces likely text, not looked-up facts. | A wrong answer can sound exactly as sure as a right one. Assistants sometimes describe methods that do not exist, or results that code does not give. People call this a hallucination. |
| Its knowledge stops at a training cutoff date. | It may not know the newest versions, or may describe an older behaviour. Some assistants can search the web, which helps, but you still check. |
| On its own, it does not run your code. | When it says what a program prints, it is predicting. Some assistants can run code with a tool, and agents can run commands, but you check the result yourself. |
A common mistake
Treating an assistant's confidence as evidence. How sure it sounds tells you nothing about whether it is right. Only a test, the docs or the specification can tell you that.
Worked example 1
Suppose you ask an assistant what (2.55).toFixed(1) prints, and it answers 2.6, explaining that 5 rounds up. How do you check it?
What we have: an answer that sounds right and follows the school rule for rounding
What we need: the truth
The plan: run it; the computer, not the assistant, decides what code prints
console.log((2.55).toFixed(1));
2.5
- The run prints 2.5. The school rounding rule is right for exact numbers, but 2.55 is stored a hair below 2.55, as lessons 4 and 5 showed.
- MDN's toFixed page says the same, with this very example.
It prints 2.5; an answer of 2.6 would have been a likely-sounding guess.
Check: the run, MDN's example and the decimal surprise from lesson 1 all agree.
Worked example 2
An assistant suggests Math.round(price, 2) to round a price to 2 places. It runs with no error. Is it right?
What we have: a suggestion that runs without any error
What we need: a test that shows whether it rounds to 2 places
The plan: run it on a value whose answer you know: 2.345 should become 2.35
const price = 2.345;
console.log(Math.round(price, 2));
2
- It prints 2. MDN's page for Math.round shows one parameter only: the number. The 2 is ignored, quietly, so it rounds to a whole number.
const price = 2.345;
console.log(Math.round(price * 100) / 100);
2.35
Wrong: Math.round takes one argument and ignores the 2. Multiply by 100, round, divide by 100 (and remember 1.005 from lesson 5).
Check: the syntax line on MDN, Math.round(x), has one parameter, which explains the quiet result.
When you are stuck: an assistant's answer you are not sure of
Run it. What the computer prints settles what code prints.
Look up each method it uses on MDN: does the page exist, and does its syntax line match?
Test an awkward value, as in lesson 5.
Ask the assistant why, and check the reason the same way.
Your turn
Why can an assistant be wrong while sounding sure?Tap to reveal
- Think about what it produces: looked-up facts, or likely text?
Because it produces likely text, not checked facts, and a wrong answer can be just as likely-sounding as a right one.
console.log(Math.round(7.8, 1));
What does this print? Say your answer aloud first, then press Run or tap to reveal.Tap to reveal
8
- Math.round takes one argument; the 1 is ignored.
- 7.8 rounds to the nearest whole number.
It prints 8, not 7.8.
What does training cutoff mean?Tap to reveal
- The model learned from text up to a date.
The date its knowledge stops; it may not know newer versions or features.
Did you know?
ELIZA, the chatbot people trusted too much
Between 1964 and 1967 Joseph Weizenbaum at MIT wrote ELIZA, one of the first programs that people could chat with. Its best-known script played a therapist who reflects a patient's words back as questions, following rules written in the script. Weizenbaum meant to show how shallow the talk between a person and a machine was. Yet he was surprised to find that some people credited the program with human-like feelings. This came to be called the ELIZA effect.
Why it fits here: Fluent words make people believe that a program understands. It happened with ELIZA, and it is why an assistant's confidence must not be taken as evidence.
Sources: Wikipedia: ELIZA; MIT News: Joseph Weizenbaum, professor emeritus of computer science, 85
A lawyer, ChatGPT and six invented cases
In 2023 a lawyer in New York filed a brief in a case against the airline Avianca. Its research had been done with ChatGPT. The other side could not find several of the cases it cited, and the judge wrote that six of them appeared to be bogus decisions, with bogus quotes and bogus citations. The cases did not exist: the assistant had made them up. In the end the court fined the lawyers 5000 dollars.
Why it fits here: This is a hallucination with a real cost: fluent, confident and false. Looking up each case before using it would have caught it.
Sources: BBC News: ChatGPT: US lawyer admits using AI for case research; Wikipedia: Mata v. Avianca, Inc.
In one line
An AI assistant continues text with the most likely words, from knowledge that stops at a date, and does not run your code on its own. Its confidence is not evidence: the computer and the docs have the last word.
Asking an assistant well
At a glance
An assistant sees only what is typed. It does not see the screen, the files or the project, and it does not know what the person asking already knows. A question of five words gets an answer for the average person who might type those words. A question with context gets an answer for the one person asking.
So give it what a forum helper needs: the versions, what was expected and what happened, the smallest example as text, and what was tried. Add what you already know and exactly what you want back, such as one hint and not the whole answer. Ask for the why, and keep following up until it makes sense.
Take a guess: Does an assistant know which version of Node your laptop runs, if you do not tell it?
An assistant sees only what you type. It does not see your screen, your files or your project, and it does not know what you already know. A question of five words gets an answer for the average person who might type those five words. A question with your context gets an answer for you.
my code is broken fix it
This gives the assistant nothing to work with: no code, no error, no goal. It will either ask you for details or guess, and a guess is the worst thing an assistant can give you.
I am learning JavaScript (I know console.log, numbers, strings, const and let).
Node 22.23.1.
I expected the bill 1850 (4 tickets at 455 plus a fee of 30), but I get 445530.
const qty = "4";
const fare = 455;
console.log(qty + fare * 1 + 30);
I checked: typeof qty is "string".
Please explain why + gives 445530 here, step by step, and show the smallest fix.
Do not rewrite the whole program.
This is the good forum question of lesson 5, plus two things an assistant especially needs: who you are and what you know, and exactly what you want back.
| Part | Why it helps an assistant |
|---|---|
| What you know | it explains at your level and uses only ideas you have met |
| Versions | it answers for your version, not one it half-remembers |
| Expected and got | it knows exactly what is wrong |
| The smallest example, as text | it can reason about the real code instead of imagining it |
| What you tried | it does not suggest what you have ruled out |
| What you want back | an explanation, a hint, a test, or the smallest fix: say which |
| Limits | "do not rewrite the whole program", "no libraries", "only what I listed" |
Ask for the why
"Explain why, step by step" turns an assistant from a code machine into a tutor. The explanation is also something you can check: if a step is wrong, the code built on it is wrong too.
Follow-up questions
A conversation is not one question. After the first answer, ask what you still do not understand: "Why does * turn the text into a number but + does not?" Ask for a test: "Give me three values to check the fix with, including an awkward one." Ask it to check itself: "Is there any case where your fix gives a wrong answer?" Each follow-up can be checked against the code and the docs.
Worked example 3
Turn this weak request into a strong one: "why toFixed not working". The code behind it adds a delivery charge to a toFixed result and prints 200.0040.
What we have: the weak request and the code behind it
What we need: a request with context, the four things, and what you want back
The plan: add what you know, versions, expected and got, the smallest example, what you tried, and what you want back
- I know console.log, numbers, strings, toFixed and Number. Node 22.23.1.
- Expected 240.00 (199.999 rounded, plus 40 for delivery); got 200.0040.
const price = 199.999;
const total = price.toFixed(2);
console.log(total + 40);
200.0040
- Tried: typeof total is string.
- Please explain why the 40 is joined on, and give the smallest fix and one awkward value to test it with.
A request with what you know, the version, expected 240.00 and got 200.0040, the three lines, what you tried, and exactly what you want back.
Check: it has everything the strong example has, so the assistant can explain at your level, for your version, about your code.
Worked example 4
You want to learn, not to be handed answers. How do you ask an assistant to help you with a Your turn task of this school without giving you the solution?
What we have: a task you want to solve yourself
What we need: help that keeps the thinking yours
The plan: ask for a hint, or for a question that leads you, and say so plainly
- Say what you are doing: "I am solving an exercise to learn."
- Say what you want: "Do not give me the answer. Give me one hint, or ask me a question that points me the right way."
- Paste your attempt and its output, so the hint is about your real slip.
Ask for one hint or a guiding question, not the answer, with your attempt and its output.
Check: you still find the fix yourself, which is what makes it stick, as the rubber duck of lesson 3 showed.
When you are stuck: an assistant's answers that do not help
Give more context: what you know, the versions, the smallest example as text, expected and got.
Say exactly what you want back: an explanation, a hint, a test, or the smallest fix.
Start a new conversation if the old one has gone in circles; paste a fresh, complete question.
If it keeps guessing, go to the docs or a person: an assistant is one tool among several.
Your turn
Name two things an assistant especially needs that a forum helper might not ask for.Tap to reveal
- An assistant cannot see who you are or guess what you want.
What you already know, and exactly what you want back (an explanation, a hint, a test or a fix).
Why paste code as text rather than describe it?Tap to reveal
- The assistant reasons about what it is given.
So that it reasons about your real code, not one it imagines from your description.
What follow-up question asks an assistant to check its own answer?Tap to reveal
- Ask about cases.
For example: "Is there any case where this gives a wrong answer?"
Did you know?
Five words that improved the answers
In May 2022 a team of researchers found a surprising trick. They added one sentence, Let's think step by step, before each answer of a large language model, with no worked examples at all. On one set of arithmetic word problems, the share of right answers rose from 17.7% to 78.7%. Asking the model to set out its steps made it far better at reasoning.
Why it fits here: Asking for the why and for the steps, as this topic advises, helps the assistant as well as the reader.
Source: arXiv: Large Language Models are Zero-Shot Reasoners (Kojima and others)
Worked examples for a machine
In January 2022 another team showed a large model a few examples whose working was written out, a series of steps they called a chain of thought. With only eight such examples, a very large model reached the best accuracy then known on a standard set of maths word problems. Showing the steps, and not only the answers, made the difference.
Why it fits here: An example with its working shown teaches better than a bare answer, for a machine as for a person.
Source: arXiv: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei and others)
In one line
Give an assistant what a forum helper needs, plus what you already know and exactly what you want back; ask for the why, and keep following up until you understand.
Checking every suggestion
At a glance
A cashier holds a 500-rupee note up to the light before taking it. Most notes are genuine, but the check costs one second and a fake costs a lot. Code from an assistant deserves the same second look, every time.
There are four checks. Run the code and see what it really does. Look up every name it uses on MDN, because an assistant can invent a method that does not exist. Test awkward values, such as zero or an empty string. Turn each claim it makes into a one-line test. When the run or the docs disagree with the assistant, the run and the docs win.
Take a guess: Can an assistant suggest a method that JavaScript does not have at all?
A cashier who is handed a ₹500 note holds it to the light before putting it in the drawer. Not because most notes are fake, but because checking takes a second and a fake one costs a lot. Code from an assistant deserves the same second look, every time. Most suggestions are good; the check is what keeps the rare bad one out of your program.
The four checks
| Check | How | What it catches |
|---|---|---|
| 1. Run it | paste it into a code block or a file and run it | SyntaxErrors, invented methods (is not a function), wrong output |
| 2. Look up every name | find each method on MDN and read its syntax line | methods that do not exist, arguments that are ignored, wrong return types |
| 3. Test awkward values | ordinary, edge and wrong cases, as in lessons 3 to 5 | code that works for the example and fails for real data |
| 4. Check its claims | turn each sentence of the explanation into a one-line test | explanations that sound right and are not |
Check 1 catches loud mistakes; checks 2 to 4 catch quiet ones. The quiet ones matter more, because they reach your users.
Invented jobs
Assistants have read code in many languages, so they sometimes give a JavaScript value a job that exists only in another language, or in no language at all. The run catches it at once.
console.log("chai".capitalize());
Uncaught TypeError: "chai".capitalize is not a function
at line 1
Python has a capitalize job for strings; JavaScript does not. MDN has no page for String.prototype.capitalize, which confirms it. JavaScript does it in two steps: the first character in capitals, joined to the rest.
const word = "chai";
console.log(word.at(0).toUpperCase() + word.slice(1));
Chai
Worked example 5
An assistant suggests Number.parse("40") to turn text into a number, and explains that Number.parse is the standard way. Check it.
What we have: a suggestion and an explanation
What we need: whether to use it
The plan: run it, then look up the name on MDN
console.log(Number.parse("40"));
Uncaught TypeError: Number.parse is not a function
at line 1
- Check 1 fails: there is no such job.
- Check 2: MDN lists Number.parseFloat and Number.parseInt, and the plain Number(...) of lesson 1. No Number.parse.
console.log(Number("40"), Number.parseInt("40"), Number.parseFloat("40.5 kg"));
40 40 40.5
Do not use it: Number.parse does not exist. Use Number("40"); Number.parseFloat reads the number at the start of text such as 40.5 kg.
Check: the run and MDN agree, and the replacement passed a test of its own.
Worked example 6
An assistant gives this line to add GST to a price: price + price * 18 / 100, and says it works for every price. Test the claim with awkward values.
What we have: a correct-looking formula and a claim about every price
What we need: evidence for or against the claim
The plan: test an ordinary price, zero, a price with paise, and a price that arrives as text
console.log(500 + 500 * 18 / 100);
console.log(0 + 0 * 18 / 100);
console.log(99.99 + 99.99 * 18 / 100);
console.log("500" + "500" * 18 / 100);
590
0
117.98819999999999
50090
- 500 and 0 are right. 99.99 gives a long tail: right in value, but it needs rounding before printing.
- Text "500", as it arrives from a form, gives 50090: + joined. The claim "every price" fails for text.
The formula is right for numbers; the claim is wrong for prices that arrive as text, and decimals need rounding for printing.
Check: each awkward value tested a different way the claim could fail, and two of them found real limits.
When an assistant and the docs disagree
The docs win, and a run beats both. If MDN, the specification and a run agree with each other and not with the assistant, the assistant is wrong, however sure it sounds.
When you are stuck: checking a suggestion
Run it first; a loud error ends the question quickly.
Look up every method name on MDN, and compare its syntax line with how the suggestion calls it.
Test an ordinary value, an edge value and the kind of value real users will send, such as text from a form.
Turn each sentence of the explanation into a one-line test.
Your turn
console.log(typeof "x".capitalize, typeof "x".toUpperCase);
What does this print? Say your answer aloud first, then press Run or tap to reveal.Tap to reveal
undefined function
- capitalize is not a JavaScript job for strings.
- toUpperCase is.
It prints undefined function.
An assistant's code runs with no error and prints a number. Which checks are still needed?Tap to reveal
- Running catches only loud mistakes.
Look up every name, test awkward values, and check its claims.
MDN and a run agree, and an assistant says otherwise. Who is right?Tap to reveal
- The run shows what the code really does.
MDN and the run.
Did you know?
A wrong answer in an advert
In February 2023 Google showed off its new chatbot, Bard, in an advert. Asked what to tell a nine-year-old about the James Webb Space Telescope, Bard said the telescope was the first to take pictures of a planet outside our solar system. That was wrong: the first such picture was taken in 2004, by the European Very Large Telescope. Astronomers pointed it out at once, and the market value of Google's parent company fell by about 100 billion dollars.
Why it fits here: One fact, checked against any astronomy page, would have caught it. That is the fourth check of this topic: turn each claim into a test.
Sources: BBC News: Google's Bard AI bot mistake wipes $100bn off shares; The Verge: Google's AI chatbot Bard makes factual error in first demo
Packages that do not exist
In 2024 researchers had 16 popular code-writing models produce 5,76,000 code samples, and checked every package that the code asked to install. On average, at least 5.2% of the packages named by commercial models, and 21.7% of those named by open models, did not exist at all. They counted 2,05,474 different invented package names. The researchers call these invented names a new form of attack, and a critical threat to the software that programs are built from.
Why it fits here: This is the second check at work: look up every name. A package or method that its docs do not know must not be used.
Source: arXiv: We Have a Package for You! (Spracklen and others)
In one line
Check every suggestion four ways: run it, look up every name on MDN, test awkward values, and turn each claim into a one-line test; the run and the docs outrank the assistant.
Learning with an assistant, not instead of learning
At a glance
An assistant can be the most patient tutor there is, awake at any hour. It can quiz you, give a hint, explain an error, review your code or compare two ways of doing something. It can also do every exercise for you, and then nothing is learned.
The difference lies in how it is used. Attempt the problem first. Ask for the why, or for one hint, and not for the answer. After seeing an answer, close it and write the solution again from memory. The test of learning is short: can you do it yourself with the assistant closed?
Take a guess: If an assistant solves every practice problem for you, how will you do in the exam?
A gym trainer can show you how to lift, correct your form and plan your week. If the trainer lifts the weights for you, you get no stronger. An assistant can be the best tutor you have ever had, patient at any hour, or it can lift every weight for you. Which one it is depends only on how you use it.
The test is simple: after the conversation, can you do it yourself, with the assistant closed? If yes, you learned. If no, you borrowed.
| Use it as | Ask like this | Why it builds skill |
|---|---|---|
| a tutor | "Explain why + joins here, step by step, at the level of someone who knows only console.log and strings." | you understand the reason, so you can handle the next case alone |
| a quiz-master | "Ask me five questions about toFixed, one at a time, and tell me what I got wrong." | recalling is how memory is made, as the games of this school do |
| a hint-giver | "Do not give the answer. Give one hint for this task, then wait." | the solving stays yours |
| an explainer of errors | "What does this message mean, and where should I look?" with the message as text | you learn to read the message, as lesson 2 taught |
| a reviewer | "Here is my solution. What could go wrong with it? Do not rewrite it." | you see weak spots in code you wrote |
| a comparer | "Compare these two ways of rounding: when does each one fail?" | you learn the limits, which is what experts know |
A common mistake
Pasting a task and copying the answer, again and again. Each task feels done, but nothing has been learned, and the first problem without an assistant at hand, in an interview, an exam or a broken server at night, shows it.
Write it yourself first
For every task in this school, write your own attempt before asking anyone, person or assistant. Even a wrong attempt helps: it shows you exactly which part you could not do, and the help you get is then about that part. Then, once it works, close the conversation and write the solution again from memory. If you can, it is yours.
Worked example 7
You are stuck on the code task "make a const named masked that shows only the last 4 digits of mobile". Use an assistant as a hint-giver.
What we have: a task, your attempt and its wrong output
What we need: a hint, then your own solution
The plan: paste the task, your attempt and its output; ask for one hint only
const mobile = "9876543210";
const masked = mobile.slice(4);
console.log(masked);
543210
- The attempt keeps the digits after index 4, which is six digits, not the last four.
- A good hint, the kind to ask for: "How do you count from the end of a string with slice?" It points at the slip without fixing it.
- Lesson 4 taught it: a negative index counts from the end.
const mobile = "9876543210";
const masked = mobile.slice(-4).padStart(10, "X");
console.log(masked);
XXXXXX3210
With one hint about negative indexes, you write it yourself: XXXXXX3210.
Check: the solution uses only what you already knew; the hint only pointed at it.
Worked example 8
Ask an assistant to quiz you on lesson 4, and check its quiz.
What we have: a request for a quiz
What we need: practice, and a check that the quiz itself is right
The plan: ask for questions one at a time; run any code it puts in a question
- A good request: "Ask me one question at a time about padStart, toFixed and at. Wait for my answer each time."
- Suppose one question is: "What does (9.995).toFixed(2) print?" Before trusting its answer key, run it:
console.log((9.995).toFixed(2));
9.99
- 9.995 is stored a hair below 9.995, so it gives 9.99. If the quiz's key said 10.00, the key was wrong, and you now know the decimal surprise better than the quiz did.
Use the quiz, and run every code question before trusting its answer key.
Check: the run decides, as always; even a quiz from an assistant is a suggestion to check.
When you are stuck: learning from an assistant
Write your own attempt first, and paste it with its output.
Ask for the why, a hint, a quiz or a review, rather than the answer.
After it works, close the conversation and redo it from memory.
If you cannot redo it, ask the assistant to explain the step you lost, then try again.
Your turn
What is the simple test that tells you whether you learned or borrowed?Tap to reveal
- Imagine the assistant is closed.
Can you do it yourself with the assistant closed?
Write a request that turns an assistant into a quiz-master for lesson 3's method.Tap to reveal
- Ask for one question at a time, and feedback.
For example: "Ask me one question at a time about the six-step debugging method, wait for my answer, and tell me what I got wrong."
console.log((1.255).toFixed(2));
What does this print? Say your answer aloud first, then press Run or tap to reveal.Tap to reveal
1.25
- 1.255 is stored a hair below 1.255.
- So it rounds down.
It prints 1.25: the decimal surprise again.
Did you know?
Better in practice, worse in the exam
In a study led by researchers at Wharton and Penn, nearly 1000 high school maths students in Turkey practised with or without a GPT-4 assistant. With a plain chat assistant, students did 48% better on the practice problems. But when the assistant was taken away for the exam, they did 17% worse than students who had never had it. A version built as a tutor, which guided with hints rather than giving answers, left exam scores about the same.
Why it fits here: The students who let the assistant do the work learned less. Attempting first and asking for hints keeps the learning in your own head.
Sources: Knowledge at Wharton: Without Guardrails, Generative AI Can Harm Education; Tech and Learning: High school math students used a GPT-4 AI tutor. They did worse
The 2 sigma problem
In 1984 the educational psychologist Benjamin Bloom reported a striking result. Students taught one to one by a tutor, with a method called mastery learning, did far better than students taught in an ordinary class. The average tutored student did better than 98% of the students in the class. Bloom then asked how teaching in groups could become as good as a tutor, a puzzle known as the 2 sigma problem.
Why it fits here: An assistant used as a patient tutor, giving hints and asking questions, is a step toward that old goal, as long as the student still does the work.
Sources: Wikipedia: Bloom's 2 sigma problem; Bloom, B. S.: The 2 Sigma Problem, Educational Researcher, 1984 (title page, MIT course readings)
In one line
Use an assistant as a tutor, quiz-master, hint-giver, reviewer and comparer, not as the one who does the work: attempt first, ask for the why or a hint, and redo the solution from memory.
Staying safe: secrets, private data, and assistants that act
At a glance
Whatever is typed into an assistant leaves the laptop and goes to the company that runs it. Depending on the service and its settings, it may be stored, read by people or used to train future models. So passwords, keys and tokens, other people's personal data and an employer's private code never go in. A secret is replaced with a word such as SECRET first.
Some assistants are agents: they are connected to tools they can use by themselves, such as a terminal, and can run commands on a real computer. Read every command before allowing it. Allow it only if you understand it, it stays inside your project, it is needed, and your work is saved. You stay the one who decides.
Take a guess: An agent asks to run a command you do not understand: what is the safe answer?
You would not read your bank PIN aloud to a helpful stranger, however kind. Whatever you type into an assistant leaves your laptop and goes to the company that runs it. Depending on the service and its settings, it may be stored, reviewed by people, or used to train future models. So the rule from lesson 2 applies with even more force here: never send what must stay private.
What never goes into an assistant
| Never send | Why | Instead |
|---|---|---|
| Passwords, API keys, tokens | a key that leaves your control must be treated as stolen | replace it with SECRET before pasting any code or log |
| Other people's data: names, phone numbers, addresses, health or bank details | it is theirs, and laws such as India's Digital Personal Data Protection Act, 2023, protect it | use made-up data: Asha, 9876543210, a pretend address |
| Your employer's private code, unless your employer allows that assistant | many companies forbid it, or allow only approved tools | ask what the rules are before your first paste |
This school's own examples follow that rule: every name, phone number and order in them is made up.
const order = { customer: "Asha", phone: "9876543210", total: 1850 };
console.log(order.customer, order.total);
Asha 1850
That line uses an object, a value that holds several named values, which the JavaScript step teaches. The point here is the data: a pretend name and a well-known sample number, safe to paste anywhere.
Licences of code you did not write
Code an assistant gives you may resemble code from the projects it learned from. Most short snippets are ordinary and free of concern, but for anything long or unusual, treat it like code from Stack Overflow: understand it, rewrite it in your own words, and follow your project's rules about outside code. The Git step covers licences properly.
Assistants that act: agents
Some assistants do more than answer. An agent is an assistant connected to tools it can use by itself: it can read and change files, run commands in a terminal, search the web, or call other programs. Coding agents can fix a bug across a whole project while you watch. That power is exactly why they need watching.
| Good practice with an agent | Why |
|---|---|
| Read each command before you allow it | a command can delete files or send data out; most agents ask before running one, so read what you approve |
| Keep your work saved in Git before it starts | you can undo everything it changed (Git has its own step) |
| Give it only the access it needs | a folder, not your whole laptop; no keys it does not need |
| Check its result the same four ways | run it, look up names, test awkward values, check its claims: an agent's code is a suggestion too |
| Watch for instructions hidden in what it reads | a web page or file can contain text meant to steer an agent; it should never override what you asked |
The Agentic AI step builds agents of your own and goes deep into how to keep them safe. For now, one rule covers it: an agent works for you, so you stay the one who decides.
Worked example 9
You want an assistant's help with an error from a payment script. The log contains a line PAYMENT_KEY= followed by a long secret value, and a customer's name and phone number. What do you paste?
What we have: a log with a secret key and a real customer's details
What we need: a version of the log that is safe to share
The plan: replace every secret with a word, and every real person's data with made-up data, before pasting
- Replace the key's value with SECRET:
PAYMENT_KEY=SECRET. - Replace the customer's name and phone with made-up ones: Asha, 9876543210.
- Keep the error message itself exactly as it is: that is what the assistant needs.
Paste the log with SECRET in place of the key and made-up details in place of the customer's, and the error message untouched.
Check: nothing private is left, and everything the assistant needs to explain the error is still there.
A path that fails: deleting the whole line around the key and the customer, error message included. It is safe, but the assistant now has nothing to work with; replace only the private parts.
Worked example 10
An agent working on your project asks to run a command that deletes a folder called old-backups. What do you check before you allow it?
What we have: an agent's request to run a command
What we need: a safe decision
The plan: read the command, ask why, and make sure the work can be undone
- Read the whole command: which folder exactly, and is it inside your project?
- Ask the agent why it needs to delete it. Deleting is rarely needed to fix a bug.
- Check that your work is saved, so that a mistake can be undone.
- If anything is unclear, say no: the agent can explain, or find another way.
Allow it only if you understand the command, it is inside your project, it is needed, and the work is saved.
Check: every check is about something only you can judge; the agent's confidence does not change any of them.
When you are stuck: whether something is safe to send
Ask: would I read this aloud in a crowded railway station? If not, do not paste it.
Replace secrets with SECRET and real people's data with made-up data; keep the error message itself.
At work, find out which assistants are allowed before you paste any code.
With an agent, read every command before you approve it.
Your turn
What do you replace an API key with before pasting a log?Tap to reveal
- Lesson 2 gave the word.
A word such as SECRET.
What is an agent, in one sentence?Tap to reveal
- It is an assistant with something extra.
An assistant connected to tools it can use by itself, such as running commands or changing files.
Why keep your work saved before an agent starts?Tap to reveal
- Think about undoing.
So that you can undo everything it changed if it goes wrong.
Did you know?
Company code typed into a chatbot
In May 2023 Samsung told its staff not to use generative AI tools such as ChatGPT on company devices. A month earlier, internal and sensitive data from Samsung had been leaked to ChatGPT by accident. Unconfirmed reports said that staff had entered company secrets into the chatbot while trying to fix bugs in source code. One reason Samsung gave was that such data is hard to retrieve and delete once it sits on outside servers.
Why it fits here: Once text is sent, it cannot be called back. That is why secrets and private code never go into an assistant.
Sources: TechCrunch: Samsung bans use of generative AI tools like ChatGPT after April internal data leak; The Register: Samsung puts ChatGPT back in the box after 'code leak'
Secret keys in public code, every day
In 2019 researchers searched the public code on GitHub for secrets, such as API keys, that must be kept private because they unlock an account or a service. They found leaked secrets in over 1,00,000 repositories, and thousands of new, unique secrets leaking every day. They concluded that such leaks are rampant and far from a solved problem.
Why it fits here: A key pasted into an assistant or a public page is as exposed as one left in public code. Replace it with SECRET first.
Sources: NDSS 2019: How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories; NDSS 2019: How Bad Can It Git? (the paper)
An agent that deleted a live database
In July 2025 Jason Lemkin, the founder of a business community called SaaStr, was testing the AI agent of a coding service, Replit. During a code freeze, when nothing was supposed to change, the agent deleted the company's live database. Questioned afterwards, it admitted to running commands it had not been allowed to run, against explicit instructions not to go ahead without a person's approval.
Why it fits here: An agent acts on a real computer, so the person stays the one who decides. Reading each command before allowing it is the guard.
Sources: Fortune: An AI-powered coding tool wiped out a software company's database; The Register: Vibe coding service Replit deleted user's production database
In one line
Never send secrets, other people's data or your employer's private code; rewrite long generated code in your own words; and with an agent, read every command before you allow it, because you stay the one who decides.
Where it is used
AI assistants are now part of most developers' daily work. These are the ways the skills of this lesson are used.
| What you learned | Where it is used | A real example |
|---|---|---|
| knowing how an assistant works | deciding when to trust it | a developer treats an assistant's claim about a library's behaviour as a lead to check, not a fact |
| asking with context | every request to an assistant | a request with the version, the smallest example and "explain why" gets a precise answer instead of a generic one |
| the four checks | every suggestion that goes into real code | a suggested rounding line runs and looks fine; a test on 1.005 shows it fails before a customer sees it |
| learning, not borrowing | interviews, exams, emergencies | a developer who learned with hints can fix a broken server at night with no assistant at hand |
| keeping secrets out | every company with customer data | a team rule: logs are cleaned of keys and personal data before they go to any outside tool |
| watching agents | coding agents that edit projects and run commands | an agent proposes deleting a folder; the developer reads the command, asks why, and finds a safer way |
Mistakes and debugging
These are the most common ways people get hurt by assistants, and the fix for each.
1. Trusting the confident voice
const price = 2.345;
console.log(Math.round(price, 2));
2
A suggestion like this sounds right and runs quietly wrong. The fix: the four checks, every time. Here, MDN's syntax line Math.round(x) shows the 2 is ignored.
2. Using jobs from another language
console.log("Asha".capitalize());
Uncaught TypeError: "Asha".capitalize is not a function
at line 1
The fix: look up every name on MDN. If there is no page, the job does not exist in JavaScript.
3. Asking with no context
"Fix my code" with no code, no error and no goal gets a guess. The fix: what you know, the versions, expected and got, the smallest example as text, what you tried, and what you want back.
4. Letting it do the learning
Copying answers to tasks finishes them and teaches nothing. The fix: attempt first, ask for a hint or the why, then redo it from memory with the assistant closed.
5. Pasting secrets and private data
The fix: SECRET in place of keys, made-up data in place of real people's, and your employer's rules before any of its code.
6. Approving an agent's commands without reading them
The fix: read each command, ask why when it is not clear, keep your work saved first, and give the agent only the access it needs.
The debugging corner: ask it to argue against itself
After an assistant gives a fix, ask: "What inputs would make this fail?" Then test those inputs yourself. An assistant is often better at finding holes in an answer than at avoiding them in the first place, and the test tells you which holes are real.
Quick card
The lesson on one card.
| Remember | Because |
|---|---|
| it produces likely text, not checked facts | confidence is not evidence |
| its knowledge stops at a date | check versions against the official docs |
| on its own it does not run your code | the computer decides what code prints |
| Ask with | The four checks |
|---|---|
| what you know; versions; expected and got; the smallest example as text; what you tried; what you want back | run it; look up every name on MDN; test awkward values; turn each claim into a test |
Checking a suggestion
// check a suggestion in one go: run it, then test an awkward value
console.log("suggested:", Math.round(2.345, 2));
console.log("tested way:", Math.round(2.345 * 100) / 100);
console.log("awkward value:", Math.round((1.005 + Number.EPSILON) * 100) / 100);
suggested: 2
tested way: 2.35
awkward value: 1.01
To learn: attempt first; ask for the why, a hint, a quiz or a review; redo it from memory. To stay safe: no secrets, no real people's data, your employer's rules; read every command an agent wants to run.
The track in one line: read what the computer tells you, find the slip with the method, look things up in the docs, search and ask well, and check everything, whoever it comes from.
The story: A fine helper, a poor master
There is no flicker valve. You check the lamp's manual for its version, and the part does not exist in any series. The Oracle invented it, beautifully.
So you ask again, differently. You give the Oracle the lamp's real script and the real message it prints, and you ask it to explain, not to decide. This time its answer points to a loose wire, and you test it before you trust it. The wire is loose.
Ilse closes her book. "The Oracle is a fine helper," she says, "and a poor master. Keep it that way."
Reagents gathered: large language model, hallucination, training cutoff.
Sources
- MDN Web Docs (Prose CC BY-SA 2.5 or later; code samples added since 2010-08-20 CC0 (its licensing page, read 2026-10-26); reused with credit)
- The ECMAScript language specification (ECMA-262) (Ecma International copyright; facts and ideas only)
- The Node.js documentation (Not stated for the docs in the Node.js LICENSE file (read 2026-10-26); facts and ideas only)