AI for Developers · Concept
AI Coding Assistants and Agents
Distinguish code suggestions, coding conversations, and agents that can inspect files and take actions.
On this page
A starting question
An editor suggests the rest of a line. A chat window explains a function. A third tool opens several files, changes them, and runs tests. Are these the same kind of help?
They all use AI, but they have different reach. The useful question is not whether a tool calls itself an “agent.” Ask what context it can see and what actions it can take.
Mental model
Three common modes
Autocomplete suggests code near the cursor. You decide whether to accept a suggestion. It may use nearby code or other available project context, depending on the product and settings.
Chat-based help responds to a question, pasted code, or attached files. It can explain an error or propose an approach. A chat answer is not evidence that the answer fits your application; the context you supplied may be incomplete.
A coding agent can work through multiple steps. Depending on its permissions, it may search a repository, edit files, run commands, and report the result. GitHub’s agent documentation describes concrete examples, while also warning that generated changes and commands need human review.The capabilities are examples, not a promise that every agent has the same access.1
A small example
Suppose a button fails to save a note. Autocomplete might suggest a missing function argument. Chat might ask you to check the click handler and API response. An agent with repository and terminal access might trace the handler, change a request, and run a test.
None of these steps proves the bug is fixed. You still need to inspect the change, reproduce the original failure, and check that saving works without breaking another path. A passing test helps, but only for the behavior it actually covers.
Why this matters at work
The more a tool can do, the more important its permission boundary becomes. Reading a file, editing a file, running a command, and deploying are different powers. A task that only needs an explanation does not need production credentials. The OWASP secure-coding guidance recommends limiting an agent’s tools and access to what its task requires.Least privilege reduces the damage possible from a mistaken or manipulated action.2
Tool names and interfaces will change. This boundary-based way of reasoning remains useful.
Recap and try it
Autocomplete suggests local code; chat discusses a problem; an agent may inspect and act across a project. Judge a tool by its actual context and permissions, then verify its result.
Reflect, then reveal each answer.
A tool only needs to explain a failing test. Would you grant it deployment access? Why?
No. Explaining a test does not require deployment permission. Give the tool only the context and capabilities needed for that task.
How this connects
- Reviewing AI-Generated Code
Next: inspect what a tool changed before accepting it.
- Security and Privacy When Using AI Tools
Later: decide which files, secrets, and permissions should be out of reach.
References & further reading
References & further reading2 sourcesPrimary standards and official documentation used for this lesson.
- Application card: GitHub Copilot Agents (opens in a new tab)
GitHub Docs
Concrete examples of chat, code review, file edits, commands, and agent limitations
- Secure Coding with AI Cheat Sheet (opens in a new tab)
OWASP Cheat Sheet Series
Risks that arise when coding tools can read files and use other tools