Guide
AI Governance for Coding Agents: A Practical Guide
Last updated: November 23, 2026
AI governance is the set of rules, roles and controls that decide how an organisation builds and uses AI. For AI coding agents, it comes down to a practical question: what may the agent do alone, what needs a person, and can you prove what happened afterwards?
Most AI governance advice is written for models that make decisions about people, such as credit or hiring. Coding agents raise a different problem. They write to your codebase, run commands and open pull requests. This guide covers the risks that are specific to them and the controls that deal with those risks without slowing your engineers down.
This guide is general information and not legal advice.
Why coding agents need their own governance
A chat assistant gives an answer and a person decides what to do with it. An agent takes the action itself. That changes the risk in three ways.
- Volume. An agent can produce more code in an hour than a team can read carefully. Review that worked for human pace stops working.
- Access. To be useful, an agent needs your code and often your tools. Whatever it can reach, a mistake or a malicious instruction can reach too.
- Accountability. When a bad change ships, someone will ask who decided it. “The agent did it” is not an answer an auditor or a customer will accept.
The main risks
| Risk | What it looks like | Control |
|---|---|---|
| Wrong software | The agent guesses a business rule | A signed-off spec before any code |
| Leaked secrets | A key lands in a commit | A secret scan that blocks the commit |
| Excess access | An agent holds long-lived credentials | Throwaway environments, short-lived keys |
| Prompt injection | A file or web page instructs the agent | Limited tools, review of every change |
| False reports | The agent says tests passed when they did not | Re-run the checks outside the agent |
| Unreviewed changes | An agent merges its own work | Branch protection and a human merge |
| No audit trail | Nobody can say why a change exists | Link each pull request to its requirement |
Five controls that cover most of the risk
1. Approve the intent
Before an agent starts, a person approves what it is meant to build, in writing, with testable acceptance criteria. This is the cheapest control you have. Spec-driven development turns it into a normal part of the work.
2. Limit the access
Give each agent the least it needs for the task. Run it in a branch or a disposable container. Use short-lived credentials with a spending cap, and keep production keys out of its reach.
3. Verify outside the agent
An agent’s summary of its own work is not evidence. Re-run the tests in a system the agent does not control, and let that result decide. A second reviewer, ideally from another vendor, then reads the diff against the criteria.
4. Keep the decision with people
Agents can open pull requests. People merge them. Turn on branch protection so this holds even when someone is in a hurry, and require approval for releases to production.
5. Record what happened
For every change, keep the requirement it came from, the agent that wrote it, the checks that ran and the person who approved it. If you can answer “why does this line exist?” six months later, your audit is mostly done.
Who is responsible for what
Governance fails when everyone assumes someone else holds it. Keep the roles simple:
- The business owner approves what gets built and accepts the result.
- The engineer stays accountable for any code they merge, whoever or whatever wrote it.
- The CTO or head of engineering sets which agents are allowed and what they can reach.
- Security and compliance define the controls and check that they are working.
A short AI coding policy you can adopt
A policy nobody reads protects nobody. One page is enough to begin:
- Only approved agents may be used on company code.
- Agents do not receive production credentials.
- Every agent task starts from a written, approved requirement.
- Tests are re-run outside the agent before review.
- Commits are scanned for secrets, and a hit blocks the commit.
- A person reviews and merges every change.
- The engineer who merges is accountable for the code.
- Each pull request links to the requirement it serves.
Enforce as much of this as you can in tooling. A rule that lives in a pipeline holds on a busy Friday. A rule that lives in a wiki does not.
How this maps to AI governance frameworks
You do not need a separate program for coding agents. These controls produce evidence for the frameworks your organisation may already follow.
- NIST AI Risk Management Framework. Its four functions are Govern, Map, Measure and Manage. Roles and policy fit Govern, the risk table fits Map, and verified checks fit Measure.
- ISO/IEC 42001. The international standard for an AI management system. It expects defined responsibilities, controls and records, which is what the five controls produce.
- EU AI Act. Its duties depend on what the AI system is used for and your role. If the software you build falls into a regulated category, ask your legal team what it requires.
Common governance mistakes
Banning agents outright. Engineers then use them anyway on personal accounts, where you have no visibility at all. An approved path with controls is safer.
Relying on a policy document alone. If nothing enforces the rule, it will be skipped the first time a deadline is close.
Reviewing only at the end. By the time a large pull request arrives, the wrong decision is already built. Put the first gate before the code.
Letting governance become a queue. If each change waits days for sign-off, people route around it. Automate the checks and save human attention for real decisions.
How nTra helps you govern coding agents
nTra is a spec-driven product engineering platform: every task your AI coding agents build traces back to a requirement your business signed off. The process has four sign-offs: brief, design, plan and merge.
Approved intent. Every line of the requirements document cites its source, and approved documents cannot be edited, so a revision is a new version. Design approval is pinned to the exact saved version, and any later change withdraws it.
Verified work. nTra re-runs the agent’s own checks and the re-run decides. Each acceptance criterion needs proof, and a secret scan blocks the commit if a key leaks.
Limited access. Cloud runs use throwaway containers with no standing secrets and a capped model key for each run.
People decide. The agent never merges and never pushes to main. A person approves every merge, and each pull request traces back to the requirement behind it.
See how nTra works, read about AI agent orchestration, or book a demo.
FAQ
What is AI governance?
AI governance is the set of rules, roles and controls that decide how an organisation builds and uses AI. It answers who may use which system, for what, under which checks, and who is accountable when something goes wrong.
What is AI agent governance?
AI agent governance applies those rules to systems that act on their own. Because an agent can change files, run commands and call services, governance has to cover what it is allowed to do and which of its actions need a person’s approval.
How do you govern AI coding agents?
Approve the requirement before the agent starts, limit what the agent can access, verify its work outside the agent, keep merging with people, and record who approved what. These five controls cover most of the risk.
Should AI coding agents have access to production?
As a default, no. Agents should work in branches or throwaway environments with short-lived credentials. Production changes should go through your normal pipeline, with a person approving the release.
Which frameworks apply to AI governance?
Common references are the NIST AI Risk Management Framework, the ISO/IEC 42001 standard for AI management systems, and the EU AI Act where it applies to you. Ask your legal or compliance team which ones bind your organisation.