AI coding agents: know what can act and what can change
Time to meet an AI that doesn't just talk, but acts. In the first course, you met the parts of an app: the frontend, the backend, the API between them, and the database. You also saw that a change to one part can affect others.
In this lesson, we'll:
- tell an AI tool that replies from one that acts;
- list what a coding agent can read, change and run;
- see how permissions decide what it is allowed to do;
- choose between using AI to learn and using it to build.
Why it matters: an AI tool that can edit your files and run commands can save you hours. It can also change things you never meant to change. Before you hand it any work, you need to know what it can reach, because whatever it changes becomes your responsibility.
How a reply is different from an action
Some AI tools only reply. You type a question in a chat window, and you get text back. Whatever happens next is up to you: you read it, copy part of it, or ignore it.
An editor may also offer code completion: as you type, it suggests the next few characters or lines. You still decide whether to accept each suggestion.
An AI coding agent works differently. You give it a task, and it takes steps to finish it. It can read files, edit them, run commands in a terminal, look at the results and try again. Claude Code and OpenCode are two well-known examples. You don't need either of them for this course.
Picture the committee program from the first course, the one that adds up what members have paid. You ask an agent to change it so that it also shows the amount still due. A typical run might look like this:
- It opens the program's file and reads the code.
- It edits two lines.
- It runs the program with a terminal command.
- It reads the output and tells you what it changed.
Every step there is an action, not a suggestion. The file on your computer is now different. That's the useful part, and it's also why the next sections matter.
Agentic AI is the general name for AI that plans steps and uses tools to finish a job like this.
Software built for AI to use
In the frontend and API lesson, you saw that an API is an agreed way for one program to ask another for something. AI tools need a similar agreement to reach outside tools and information.
MCP, the Model Context Protocol, is an open standard for that connection. An MCP server is a program that gives an AI app extra abilities: tools it can use, information it can read, and ready-made instructions. MCP describes how they connect. It doesn't decide what the AI is allowed to do, and it doesn't make the information trustworthy.
One caution: an MCP server running on your own computer may be able to do anything your user account can do. Install only servers you trust, and read what each one is allowed to do.
MCP is one example of how AI and software meet. This book uses the word AI-native for four ways they can meet:
- using AI;
- building AI;
- building software for AI to use, such as an MCP server;
- adding AI to software that wasn't AI before.
Decide what the agent is allowed to do
Coding agents ask for permission before certain actions, depending on their settings. A permission rule usually says one of three things about an action:
| Rule | What happens |
|---|---|
| Allow | The agent does it without asking you. |
| Ask | The agent stops and waits for your approval. |
| Deny | The agent is not allowed to do it. |
Tools start with different settings. When this lesson was written, Claude Code in its manual mode asked before editing files or running most commands, while OpenCode allowed most actions by default. Settings change, so check the tool you actually use.
A useful rule from security work is least privilege: give a person or a program only the access it needs for its task. If the agent only needs to change the committee program, it doesn't need access to the folder where the real records are kept.
Enforce a limit instead of only asking for it
Suppose you type: "Do not touch the members' records." That sentence is a request. The agent will usually follow it, but nothing stops it if it misunderstands or makes a mistake.
A limit that the system enforces is different. And you also need a way to recover if a limit fails:
- Deny the action. Set a permission rule so the agent cannot edit that folder.
- Keep practice separate. Let the agent work on sample records, never the real ones.
- Keep a copy elsewhere. Make a backup the agent cannot reach, so a mistake can be undone.
Even a deny rule has gaps. Claude Code's documentation points out that blocking the agent from reading a file doesn't stop a program the agent runs from reading it. For a stronger wall, the operating system itself has to block the access.
Access controls limit actions; a protected backup helps you recover. A backup doesn't stop an edit to the original. The more damage a mistake could do, the more you need both. How far a mistake's damage can spread is called its blast radius.
Choose learn mode or build mode
AI can help you learn, and it can help you build. These are different jobs.
In January 2026, Anthropic published a study of 52 software engineers learning a new Python library. (A library is ready-made code that programmers share.) On a quiz straight afterwards, the group that used AI averaged 50%, against 67% for the group that didn't. Inside the AI group, the people who asked the AI to explain things understood more than the people who handed all the thinking to it. It was one small study of one short task, so treat it as a warning sign, not the final answer.
So we can use AI in two modes:
- Learn mode: you predict a result, explain the lines in your own words, and try a question before checking the answer. AI can explain or show code, but you do the thinking.
- Build mode: the AI writes the code from a clear written description of what you want, and you check what it produced. You'll learn to write that description in the next chapter.
In this course, learn mode simply means reading the examples and trying the questions yourself.
Safety floor
Never give an AI agent access to real members' records, passwords or money while you are learning. Make sure the agent asks before it edits files or runs commands; some tools do both without asking unless you change their settings. Whatever the AI writes for you, it is not finished until you have checked it yourself. The AI can test its own work, but its tests can miss things, and it often sounds just as sure when it is wrong. If something breaks later, "the AI wrote it" is not an answer anyone will accept. The work is yours.
Check what you can now explain
Without looking back, answer these:
- What can a coding agent do that a chat reply cannot?
- Name the three permission rules, and what each one does.
- Give one way to enforce "do not touch the records" that doesn't rely on the agent obeying a sentence.
- Which mode should you use while learning Python, and what does the AI do in it?
Then go back to any section you were unsure about. In the next lesson, we'll read a program an AI wrote, and decide whether it answers the right question.