Skip to main content

· iWork Technologies Team · AI Governance

A Governance Framework for AI-Assisted Development: Seven Layers, One Checklist

Governing AI products and governing the AI that writes your code are different jobs. This framework covers the second one in seven layers, from access and change control to incident response and the metrics worth watching.

Governing AI products and governing the AI that writes your code are different jobs. This framework covers the second one in seven layers, from access and change control to incident response and the metrics worth watching.

Most AI governance writing is about the AI inside your product: model risk, bias, data use, regulation. We covered that in operationalizing an integrated AI governance framework.

This post is about a different problem. Your engineers now work with AI coding agents such as Claude Code, OpenAI Codex, Cursor and GitHub Copilot. Those tools read your code, propose changes and, in some setups, push commits. The question is no longer only “is our AI product safe?” It is also “who controls the AI that writes our software, and can we prove it?”

You do not need a new bureaucracy to answer that. You need the controls you already have for human engineers, extended to agents and written down so they can be checked. Below is the framework we use, in seven layers.

The framework at a glance

Layer The question it answers Core controls Evidence you can show
1. Access What can an agent reach? Dedicated agent identity, least-privilege repo access, no production secrets, access removed at exit Access list per repo, app or user permissions, offboarding record
2. Change control How does agent work enter the codebase? Agents open PRs, people merge; protected branches; required checks Branch protection or ruleset config, PR history
3. Review standard What does “reviewed” mean? Named senior reviewer, written review checklist, no self-approval Approvals on each PR, review comments, checklist in the repo
4. Evidence and audit trail Can you trace a line of code to a decision? Agent labels, commit trailers, ticket links, CI logs retained Query of agent-authored PRs with reviewer and checks
5. Data handling What may agents see, and where does it go? Approved tools list, business accounts only, secret files excluded, no production data in prompts Approved tools register, vendor terms, agent ignore config
6. Incident response What happens when something goes wrong? Revoke path, rollback path, agent-specific playbook entries Runbook, post-incident reviews
7. Metrics Is the system working? A small set of measures reviewed on a schedule Dashboard or monthly report

Each layer has an owner. In most teams that is the engineering lead for layers 1 to 4 and 7, the security lead for 5 and 6, with both signing off on changes to the framework itself.

1. Access: start from zero and add

Agents should begin with no access and gain only what a task needs.

  • Agents run under a dedicated identity (a GitHub App, service account or machine user), never an engineer’s personal token.
  • Access is granted per repository, not organization-wide.
  • Permissions are limited to reading code and opening pull requests. No admin rights, no ability to change CI workflows or branch rules.
  • Agents have no production credentials. Secrets live in a secrets manager, not in the repository or the agent’s environment.
  • Access is reviewed when scope changes and removed when the task or engagement ends.

The test for this layer: could you list, today, every repository each agent identity can write to?

2. Change control: one path into main

There should be exactly one way for agent-written code to reach your main branch: a pull request that passes required checks and is approved by a person.

  • Direct pushes to protected branches are blocked for everyone, admins included.
  • Required status checks cover tests, lint, static analysis, dependency review and secret scanning.
  • Approvals are dismissed when new commits arrive, and the last pusher cannot approve.
  • Changes to CI, infrastructure and authentication code need a code owner’s approval.
  • Branch protection is managed as code, so loosening it is itself a reviewed change.

We go deeper on the pipeline side, with an illustrative GitHub Actions workflow, in governing Claude Code and Codex in CI pipelines.

3. Review standard: write down what “reviewed” means

“Every PR is reviewed” is easy to claim and hard to verify. Agent output makes the gap worse, because agent code often looks clean while being subtly wrong. Write the standard down.

A review of agent-authored code should confirm:

  • The change does what the ticket asked, and nothing it did not ask.
  • The tests check behavior, not just that code runs. Agents sometimes write tests that pass by asserting what the code already does.
  • No new dependency was added without a reason in the PR description.
  • Error handling, input validation and authorization are present where the change touches them.
  • The diff is small enough to review properly. Large agent PRs get split, not skimmed.

Keep the checklist in the repository, for example in the PR template, so reviewers see it every time.

The reviewer should be someone senior enough to reject the change. A review by someone who cannot say no is not a control.

4. Evidence and audit trail: make the answer a query

When an auditor or incident responder asks which changes an agent wrote and who approved them, you want to run a search, not hold a meeting.

  • Agent work happens on recognizable branches (for example agent/...).
  • Agent PRs carry a label such as agent-authored, enforced in CI.
  • Commits carry a trailer naming the tool and the directing engineer.
  • Every PR links to a ticket.
  • CI logs and review records are retained for as long as your compliance obligations require.

With those in place, one query returns the full chain: ticket, agent, branch, checks, reviewer, merge.

5. Data handling: decide what agents may see

This is the layer that worries security teams most, and it deserves explicit rules rather than assumptions.

Agents may see: the source code in repositories you granted, documentation, test fixtures with synthetic data, and the project’s own agent instruction files.

Agents should not see: production databases, customer records, secrets and keys, .env files, or data your policies classify as restricted.

Controls for this layer:

  • An approved tools list, agreed before work starts. Anything not on it is not used on your code.
  • Business, team, enterprise or API accounts only, under terms that exclude your code from model training. Privacy modes on where the tool offers them.
  • Agent configuration that ignores secret files and credential stores.
  • Synthetic or masked data in test fixtures.
  • A clear statement of vendor retention, so you know how long prompts and code may be held for abuse monitoring.
  • If your policies require it, agents run under your own AI accounts or API keys, so your agreements with those vendors apply.

6. Incident response: plan for the agent-specific cases

Your existing incident process mostly works. Add the cases that are specific to agents:

  • A secret is exposed in an agent session or commit. Rotate it first, then investigate. Secret scanning should have caught it; find out why it did not.
  • An agent-authored change causes a production defect. Roll back through the normal path, then check the review record: what did the reviewer see, and what would have caught it?
  • An agent identity is over-permissioned or compromised. Revoke the app or user in one step. Because access lives in your organization, you should not need anyone outside it to do this.
  • A tool’s terms or behavior change. Re-check the approved tools list and the vendor terms, and pause the tool if needed.

Post-incident reviews should ask whether a control in layers 1 to 5 failed or was missing, and update the framework when one was.

7. Metrics: a few numbers, reviewed on a schedule

You cannot govern what you do not look at. You also do not need a large dashboard. A handful of measures, reviewed monthly, tells you whether the framework is holding:

  • Share of merged PRs that were agent-authored. Tells you how much of your codebase this framework actually covers.
  • Review time per agent PR. Very short review times on large PRs suggest skimming.
  • Revert and hotfix rate for agent-authored changes, compared with human-authored ones. A gap in either direction is worth understanding.
  • Required-check failures on agent PRs, by check. Repeated SAST or dependency failures point at instructions or tooling that need adjusting.
  • Secret-scan hits. Ideally zero. Any hit is an incident under layer 6.
  • Open agent access grants versus active tasks. Grants that outlive their task are access you forgot to remove.

Set your own thresholds once you have a few months of baseline. Avoid targets that reward speed alone, because review quality is the first thing to slip.

How to roll it out

Do not try to implement all seven layers at once across every repository.

  1. Pick one active repository where agents already work.
  2. Run the checklists above against it and note the gaps.
  3. Close the access and change-control gaps first. They are the cheapest and they block the worst outcomes.
  4. Add the labelling and trailers so evidence accumulates from now on.
  5. Write the review standard and data-handling rules, then extend to the next repository.

Governance done this way does not slow agents down much. It moves the checks into the pipeline, where they run on every PR without anyone having to remember them.

Where to start

If you want an outside view of where your teams stand across these seven layers, book a Free AI Readiness Audit. We will look at how AI coding tools are used today and which controls to put in first. For the specific protections we apply on client code, see our security page.

Need more shipped work from your team?

AI Velocity Pods put four senior engineers and a tech lead, directing AI coding agents, inside your codebase. Start with a free 30-minute AI Readiness Audit with a senior engineer.

Related Posts

View All Posts »
Operationalizing an Integrated AI Governance Framework

Operationalizing an Integrated AI Governance Framework

Many view AI Governance purely through the lens of compliance and risk mitigation. While crucial, the real power lies in implementing an integrated governance framework that fosters innovation while ensuring ethical and responsible AI development.

Before you go: the free guide

The Ultimate Guide to Agentic Product Development, as an instant PDF download.

No spam. See our Privacy Policy.