RedLectern topic

AI coding agents

Repository-aware agents · project instructions · edits · tests · review · execution boundaries.

For: Programmers · maintainers

After this page you can: Supervise a repository task and review the resulting changes.

Page reviewed

Part of: Artificial Intelligence › AI for coding

About AI coding agents

An AI coding agent can inspect repository context, modify files, and use tools to carry out a coding task. A useful task is a bounded repository change: describe the behavior you want, point to relevant project guidance, and ask for evidence you can review. Repository instruction files can explain architecture, conventions, and how a project builds and tests; AGENTS.md is one convention for giving agents that context.

Supervision continues after the edit. Compare the diff with the requested behavior, check whether tests were changed or skipped, and run the project’s relevant checks. Review generated commands before allowing them to run, especially when they may modify or delete files or access sensitive resources. Agent permissions and isolation differ across products and environments, so inspect the actual file, network, credential, and execution controls before delegating. Use human review when a change needs domain judgment, security scrutiny, or maintainer approval.

Start here

route

Practice reviewing generated code

Use a review checklist to examine intent, tests, security, and code that may look plausible but be wrong.

Start with: Review AI-generated code

Learn the foundations

1.Give the agent repository contextRepository-aware work starts with the project’s own conventions: architecture, file layout, build and test steps, and patterns that should be preserved.

Repository-aware work starts with the project’s own conventions: architecture, file layout, build and test steps, and patterns that should be preserved. Put durable guidance in repository instruction files, then make the task specific enough to connect that guidance to a requested behavior. Keep the request bounded: identify the outcome, relevant area, constraints, and how you will check the change. For unfamiliar or broad work, ask for a brief plan before edits and clarify assumptions that could affect behavior.

AGENTS.md is a repository-file convention for instructions intended for coding agents. Support and precedence can vary by tool, so verify how the agent you are using discovers and applies instruction files. Keep instructions concrete and current; they should describe how the repository works rather than prescribe patterns that are not actually used.

AGENTS.md

A repository-file convention for instructions intended for coding agents.

Try it

Write a three-sentence task request for an agent changing a repository feature. Include the desired behavior, one project constraint, and how you would verify the change.

Example: “Add an empty-state message to the saved-items view. Follow the existing component and localization patterns; do not change the saved-items API. Run the view’s tests and show the diff.”

2.Check edits, tests, and review feedbackTreat an agent’s changes as a proposal to evaluate against the task and the repository, not as proof that the task is complete.

Treat an agent’s changes as a proposal to evaluate against the task and the repository, not as proof that the task is complete. Read the diff for scope, behavior, and consistency with nearby code. Check that relevant tests exercise the requested behavior, and pay attention to tests that were removed, skipped, or weakened. Run the appropriate project checks and inspect failures rather than assuming a clean summary means they passed.

Review feedback from an agent is another input to verify. It can miss problems or misunderstand context, so validate specific claims against the code and tests. Security-sensitive or complex changes may need a teammate or maintainer to review them. The short practice below makes this concrete: compare the request, changed files, tests, and review comments before deciding what is ready.

Try it

An agent changes a validation function and removes a failing test. Name two checks you would make before accepting the change.

Check whether the new behavior still meets the task and repository rules, and inspect why the test was removed. Run the relevant tests and review the diff for unintended changes; ask for a fix or explanation if the test was deleted instead of corrected.

3.Set execution boundariesA coding agent may do more than suggest text: depending on the environment, it can edit files, run commands, use network access, or reach credentials.

A coding agent may do more than suggest text: depending on the environment, it can edit files, run commands, use network access, or reach credentials. Before delegating, understand which paths it can read or change, whether its commands run locally or in a remote environment, and what approval is needed for broader access. Use the narrowest permissions that still let the task proceed, and review commands that could alter or delete files.

Execution controls vary by product and configuration. A sandbox can limit filesystem, network, or credential access, but its actual policy and enforcement matter. Review workflow-file changes before enabling automation, since workflows may have access to sensitive secrets. Make approval a deliberate decision tied to the proposed action, not a habit of clicking through prompts.

Try it

A repository agent asks to run a command that writes files and needs network access. What two things should you inspect before approving?

Check what files the command can change and what network destinations it can reach. Confirm that both are needed for the task and that the execution environment’s permissions and sandbox policy match those limits.

Latest

No recent updates are available.

See the sources list

Books

Glossary

1 terms on this page.

Browse the AI glossary

Questions and comments