The short answer
Tools.
A tool is a job the model is allowed to ask for. Common ones: read a file, write a file,
run a command, search the project, open a web page.
How it actually works
This surprises people, so read it slowly.
The model still only produces text. That never changes. It cannot do anything.
What changed is that the program around it, the harness, now watches the text for
requests. When the model writes something that means “read the file src/db.ts“, the
harness stops, actually reads that file, and puts the contents into the context window.
Then the model carries on with the file now in front of it.
Step by step:
1. You: "Why is the login test failing?"
2. Model: "I need to see the test." → asks for: read_file("tests/login.test.ts")
3. Harness: reads the file, puts the contents in the context window
4. Model: now sees the test. "I need the login code too." → read_file("src/login.ts")
5. Harness: reads it, puts it in the context window
6. Model: "Line 14 compares the password before trimming spaces."
The model never touched your disk. The harness did, every time, on request.
Why this matters
Go back to the desk picture from Lesson 1.2. Before, you had to put every paper on the desk
yourself. Now the assistant can ask for papers, and someone fetches them.
That is the entire difference between chat and agent. Same assistant, same desk. It can now
ask for things.
The useful result
Remember Lesson 1.3, where the model invented a function that did not exist? It did that
because it had to guess what was in your project.
An agent does not have to guess. It can open the file and look.
An agent hallucinates less because it can check instead of guessing.
This is the real reason agents produce better code than chat windows. Not intelligence.
Access.
And it tells you something you will use every day: an agent that has not read your files
is guessing, exactly like a chat window. If you watch it start editing before it has read
anything, you already know the output is a guess.
Try this before the next lesson
- Write down five tools you would give an agent if you were designing one. Which one is
the most dangerous? - In a chat window, ask what is inside a file in your project. Watch it be unable to look.
- Why can an agent tell you about a library released last week, when the model was trained
long before that?