AI code governance is an engineering system, not a policy document: written rules, named owners and automated checks that decide how code written with AI tools reaches production. The rules apply whether the code comes from an AI coding assistant in the editor, an AI app builder or a coding agent that opens pull requests on its own. The CTO owns that system, even when tool budgets and sign-off sit with the business.

In the Stack Overflow Developer Survey 2025, 84% of developers said they use or plan to use AI tools, and about 31% already use AI agents at work. This guide covers the components and policy decisions, the controls AI adds at each delivery gate and for coding agents, ownership by team size, the EU requirements that matter and a 30-day rollout. For the full route from AI-built prototype to live product, see our guide to AI-generated code in production.

TL;DR

AI code governance is the set of written rules, named owners and automated checks that control how code written with AI tools enters a product and is maintained there. AI code governance sits above code review and DevSecOps: it decides which tools, data, approvals and evidence apply to AI-written changes.

  • AI code governance has five components, starting with the AI coding policy: the AI coding policy, automated controls, human review, provenance and monitoring with evidence; the AI coding policy makes six decisions on tools, prompt data, merge rights, review depth, dependencies and traceability.
  • AI adds controls at six delivery gates and for every coding agent: editor, commit, pull request, CI, release and production, plus a separate identity, least privilege and a human approver for each agent.
  • The CTO is accountable for AI code governance at every team size: a solo founder needs three rules, a team of 2–5 developers needs the six decisions on one page, and teams running coding agents need all five components.
  • EU requirements set obligations, not a template: EU AI Act Article 4, GDPR Article 28 and NIS2 Article 20 apply depending on scope, while ISO/IEC 27001 is a voluntary standard customers can require by contract.

What is AI code governance?

AI code governance is the set of written rules, named owners and automated checks that control how code written with AI tools enters a product and is maintained there. The scope covers code, tests, configuration and infrastructure-as-code, prompts and the data in them, and coding agents that open changes on their own.

Google’s DORA research treats a written position on AI use as an engineering capability: “clear and communicated AI stance” is the first of seven capabilities in the DORA AI Capabilities Model, published on 10 December 2025, next to strong version control and working in small batches.

TermWhat it governsTypical owner
AI code governanceHow AI-written code enters the product, who approves it, what evidence is keptCTO (accountable), management (policy sign-off)
AI governanceWhich AI systems the company builds, buys or uses, and their business risksManagement team with legal or compliance
DevSecOpsSecurity built into every stage of the delivery pipeline, for all codeEngineering and platform teams
Code reviewWhether one change is correct and safe — one control inside AI code governanceDevelopers and reviewers
EU AI Act complianceObligations for AI systems placed on the market or used, by risk categoryLegal or compliance owner
Table 1. AI code governance compared with AI governance, DevSecOps, code review and EU AI Act compliance.

AI code governance is one part of a company’s wider AI governance. AI governance sets company-wide rules for every AI system the company builds, buys or uses; AI code governance applies them to AI tools that write the company’s own software and adds the engineering controls that use needs. On the engineering side, it is a layer on top of DevSecOps, not a replacement.

Why does AI-written code need its own rules?

AI-written code needs its own rules because AI tools change four assumptions a classic review process relied on: code volume, authorship, data flow and dependencies. In the Stack Overflow Developer Survey 2025, 46% of respondents said they distrust the accuracy of AI tools, against 33% who trust it, and 66% named “AI solutions that are almost right, but not quite” as their biggest frustration.

Volume. One developer with an AI assistant produces more diff per day than one reviewer can read with care. Without a rule on review depth by risk, review quality drops exactly where the code changes fastest.

Authorship. Six months later, nobody can tell which lines came from a prompt unless AI-assisted changes were marked at merge time.

Data flow. Where prompt data goes depends on the type of tool. A cloud AI assistant sends prompts and code context to the vendor’s servers, and the vendor’s plan and contract decide retention, storage region and whether the data may train its models. Business plans can add a data processing agreement and a training opt-out — check the terms, not the plan name. A local or self-hosted model keeps prompts in-house but still needs rules for logs, access and the model licence. Our guide to leaked API keys shows how keys end up in AI-built products and how to remove them.

Dependencies. AI tools suggest open-source packages nobody chose on purpose, and sometimes packages that do not exist. Without an approval step, the product collects licences and maintenance risk by accident.

What are the components of AI code governance?

AI code governance has five components: a written AI coding policy, automated controls that enforce it, human review where judgement is needed, provenance of AI-assisted changes, and monitoring that produces evidence. The components map onto the four practice groups of the NIST Secure Software Development Framework (SSDF), SP 800-218 version 1.1 — Prepare the Organization (PO), Protect the Software (PS), Produce Well-Secured Software (PW) and Respond to Vulnerabilities (RV) — so an existing SSDF or ISO-aligned process can absorb them.

ComponentWhat it doesExample controlSSDF groupOwner
1. AI coding policyStates what is allowed and who decidesOne page with the six decisions in the next sectionPOCTO drafts; management signs off
2. Automated controlsEnforces the policy without relying on memoryRequired approvers, secret scanning, dependency and licence checksPW · PSPlatform or tech lead
3. Human reviewJudges what tools cannot: business rules, data boundaries, designSecond reviewer on payment, login and personal-data codePWDevelopers + independent reviewer
4. ProvenanceRecords which changes AI tools or agents producedAI-assistance line in every pull request; agent commits under their own identityPSEach developer; platform for agents
5. Monitoring and evidenceShows over time that the controls workMonthly metrics, review records, merge historyRV · POCTO reports; management reviews
Table 2. The five components of AI code governance mapped to NIST SSDF v1.1 practice groups.

Build the components in that order. Buying a governance tool before writing the policy means enforcing rules nobody agreed on.

Six decisions an AI coding policy must make

The AI coding policy — the first of the five components — must make six decisions: which tools are approved, which data may go into prompts, who may merge changes, how deep review goes by risk, how new dependencies are approved, and how AI-assisted changes are recorded. Six one-sentence rules fit on one page that a 10-developer team can follow from the next working day.

DecisionWhat to decideExample rule for a 10-developer team
1. Approved toolsWhich tools, where they process data, on which terms“Only listed tools: cloud tools with a data processing agreement and training switched off; self-hosted models on company infrastructure only.”
2. Data in promptsWhich data never goes into a prompt“No personal data, production logs, keys or passwords in cloud tools; no client code without written permission.”
3. Merge rightsWho approves production changes“One human approver who did not write the change; agents never approve their own work.”
4. Review depth by riskWhich code gets extra review“Payments, authentication, permissions and personal data get a second reviewer.”
5. Dependencies and licencesHow new packages get in“New packages need tech-lead approval, an existence check and a licence check.”
6. TraceabilityHow AI-assisted changes are marked“The pull request names the AI tool or agent used and for which part.”
Table 3. The six decisions of a one-page AI coding policy, with example rules for a 10-developer team.

Decision 2 has a legal edge. When a cloud AI tool provider processes personal data on your behalf, GDPR Article 28 requires a contract with that processor; pasting customer data into a tool without such terms creates a processing relationship nobody signed.

Decisions 3 and 4 set two levels of human review. Baseline review applies to every change: one human approver who did not write it. Additional review applies only to high-risk code: a second reviewer for payments, authentication, permissions and personal data. How to review AI-generated code layer by layer, and what evidence a pull request needs before merge, is covered in our guide to AI code review.

None of the six rules bans AI tools; each one tells developers where AI use is safe. We’d recommend publishing all six before the first coding agent gets write access, because rules added after habits form are harder to enforce.

Which controls does AI-written code need at each delivery gate?

controls does AI-written code need at each delivery gate

AI-written code needs one extra control at each of six delivery gates — editor, commit, pull request, CI, release and production — on top of the security checks an existing DevSecOps pipeline already runs. The base pipeline stays as it is; Table 4 lists only what AI changes.

GateAdd when AI writes the codeWhy
EditorApproved tool settings; a project rules file that gives the assistant the team’s conventions and forbidden patternsAI output follows the codebase instead of generic examples
CommitSecret scanning on AI-suggested configuration and example codeAssistants copy placeholder keys and real keys from context
Pull requestAI-assistance line; required human approver who is neither the author nor an agentProvenance and separation of duties on every change
CIExistence and licence check for newly added packages; tests for the change not written by the same AI sessionCatches invented packages and tests that only confirm the code
ReleaseChange record that flags AI-assisted changes in high-risk areasRelease approver sees where review depth matters
ProductionChange fail rate tracked separately for AI-heavy servicesShows whether the controls hold after release
Table 4. Controls AI-written code adds at each delivery gate, on top of an existing DevSecOps pipeline.

Google’s DORA AI Capabilities Model (10 December 2025) lists strong version control practices and working in small batches among its seven capabilities; both make gate controls cheap to run. Automate every rule a machine can test objectively — package existence, licence lists, required approvers — and keep human review for rules that need product context, such as whether customer A can see customer B’s data.

Before you scale AI tools and agents, know what is already in the codebase.

Controls govern the next change; they say nothing about the code AI tools have already written. An AI-built product review gives you that baseline: a reviewer who did not write the code checks it across code, product behaviour and technical set-up, and returns findings in plain English with a prioritised action plan — so you know which controls to switch on first.

→ See what the AI-built product review covers

How do you govern AI coding agents?

ai-code-governance-agent-controls

Govern AI coding agents as non-human contributors: each agent gets its own identity, the least privilege it needs, a limited scope and a human approver for every change. In the Stack Overflow Developer Survey 2025, 81% of respondents said they have concerns about the security and privacy of data when using AI agents, and 87% were concerned about the accuracy of agent output.

ControlRule
IdentityEach agent runs under its own service account, never a developer’s personal token.
PermissionsLeast privilege on repositories and environments; no admin or bypass rights (ISO/IEC 27001:2022 Annex A 8.2, privileged access rights).
ScopeAllowed repositories and directories are listed; payment, authentication and permission code only with a human pairing.
ApprovalAn agent never approves or merges its own pull request; a named human approves.
ExecutionAgents run in a sandbox without production secrets or production data.
VolumeA cap on open pull requests per agent keeps review queues within reviewer capacity.
AuditEvery agent action — branch, commit, tool call — is logged and kept with the merge history.
Table 5. Seven controls for governing AI coding agents.

Start agents on low-risk work such as test scaffolding, documentation and dependency updates. Widen their scope when agent pull requests show a change fail rate no higher than the team’s own over a review period you fix in advance. We’d recommend two monthly metric reviews as a starting point, because one month rarely holds enough agent changes to separate trend from noise; adjust the period to your release frequency. A failed agent change in payment, authentication or personal-data code is an incident, not a trend: roll it back and pause the agent in that area straight away.

Who owns AI code governance?

The CTO is accountable for AI code governance: management signs off the AI coding policy, team leads run the controls, a security lead advises where the company has one, each developer answers for their own changes, and an independent reviewer gives the verdict before major releases. The split follows segregation of duties in ISO/IEC 27001:2022 Annex A 5.3: whoever makes a change is not the only one who approves it.

ActivityCOO / founderCTOSecurity leadTeam leadsDevelopersIndep. reviewer
Approve the AI coding policyARCCIC
Keep the approved-tool listCACRI–
Configure gate and agent controlsIACRI–
Approve changes to production code–I–AR–
Follow the data-in-prompt ruleIACCR–
Review before a major releaseIACRCR
Answer customer security questionnairesCARC–C
Table 6. Who owns AI code governance. R = responsible, A = accountable, C = consulted, I = informed. Without a security lead, the CTO takes that column.

When one person is founder, CTO and only developer, the independent reviewer is the only separation of duties available — schedule that review before the first paying customers, not after the first incident.

How much AI code governance does your team need?

The right amount of AI code governance follows three triggers: team size, customer type and data type. Move up a row in Table 7 when any one changes — a second developer, an enterprise customer, personal or payment data, or the first coding agent. In the Stack Overflow Developer Survey 2025, 13.8% of respondents used AI only in copilot or autocomplete mode, while 14.1% used AI agents daily.

StageTypical set-upMinimum governanceMove up when
Solo founderOne person, AI app builder or assistantApproved tool, data-in-prompt rule, independent review before launchFirst paying customers or personal data
2–5 developersDaily AI assistant useSix decisions on one page, required approver, secret scanningEnterprise customer or external team
6–50 developers or an external teamSeveral teams or suppliers on one productAll five components, gate controls, ownership table, monthly metricsFirst coding agent gets write access
Coding agents in production useAgents open pull requests themselvesAgent controls from Table 5 on top of all five components—
Table 7. Minimum AI code governance by team stage.

Vibe coding governance for a solo founder

Vibe coding governance is the minimum rule set for a founder who builds with an AI app builder and does not read the code. Three rules cover it: a tool whose data terms you have checked, no customer data or keys in prompts, and an independent review before real users arrive — the only check that does not rely on the founder’s own judgement.

Common AI code governance challenges and how to solve them

Five challenges come up in most engineering teams that introduce AI code governance: shadow AI, developer friction, missing provenance, missing context in AI output, and agents that outpace review. Missing context is the most underestimated: in the Stack Overflow Developer Survey 2025, 45% of developers said debugging AI-generated code is more time-consuming.

ChallengeSignFix
Shadow AITools in use that are not on the approved list; personal accounts on company codeApprove a tool developers want to use, on checked terms; a ban only moves use out of sight
Developer frictionReview queues grow; developers bypass checks to shipAutomate objective checks so the baseline reviewer can focus on logic; add the second, additional review only for high-risk code (decision 4)
Missing provenanceNobody can say how a defect entered the codeAI-assistance line enforced by the pull request template; agents under their own identity
Missing contextAI code passes tests but breaks a business rule or an architecture boundaryProject rules file for the assistant; a reviewer who knows the domain checks business logic
Agents outpace reviewAgent pull requests wait for days or are merged unreadCap open pull requests per agent; limit agents to low-risk scope
Table 8. Common AI code governance challenges, how to recognise them and how to fix them.

If two or more signs in Table 8 apply at once, fix shadow AI first: governance cannot cover tools the company does not know about.

Which EU requirements and security standards matter?

No EU law regulates AI-written code as such. Three EU laws and one voluntary standard are relevant to AI code governance, and whether each applies depends on your company’s role, sector and data, not on how the code was written. The laws set obligations but prescribe no evidence format; Table 9 keeps the requirement apart from the governance evidence companies often choose to keep.

RequirementTypeWhen it appliesWhat it requiresGovernance evidence companies often keep
EU AI Act Article 4 (AI literacy)EU regulationSince 2 February 2025, for providers and deployers of AI systems; a company using AI tools at work is generally a deployer. Amended by the Digital Omnibus on AI in 2026Take measures to support the AI literacy of staff who use AI systems; no guaranteed competence level and no prescribed formatRecord of training or instruction for AI-tool users; the AI coding policy
GDPR Article 28EU regulationWhen an AI tool provider processes personal data on your behalfA contract with the processor that sets the processing termsApproved-tool list with data processing agreements; data-in-prompt rule
NIS2 Article 20 and Article 21(2)(d)–(e)EU directive; in the Netherlands the CyberbeveiligingswetEssential and important entities in the sectors of NIS2 Annexes I and II, generally medium-sized and larger; suppliers outside scope meet it through customer contractsManagement approves and oversees cybersecurity risk measures; supply-chain security; security in development and maintenanceManagement-approved AI coding policy; ownership table
ISO/IEC 27001:2022Voluntary standard — not a lawWhen your company is certified, or a customer contract requires itAn information security management system with Annex A controls selected by risk assessmentPolicy and review records as input to the ISMS
Table 9. EU legal requirements and one voluntary standard relevant to AI code governance. The last column lists governance evidence companies choose to keep; it is not a legal checklist.

In the Netherlands, NIS2 applies through the Cyberbeveiligingswet, in force since 15 August 2026 (Staatsblad 2026, 187 and 189). Companies outside its scope still meet NIS2 through their customers, because in-scope customers must address supply-chain security under NIS2 Article 21(2)(d) and pass the questions on to their software suppliers.

Which ISO/IEC 27001 Annex A controls and OWASP standards apply to AI-written code, how GDPR Article 32 fits in, and which security evidence to show an auditor are covered in our guide to AI-generated code security. Sunbytes runs its own delivery under an ISO 27001-certified information security management system. Check scope with your legal adviser: Table 9 summarises requirements, it does not decide whether each one applies to your company.

Five metrics that show AI code governance is working

Five metrics show whether AI code governance works, and each comes from data the code host, the scanners or the last review report already produce.

  1. Independent-approval rate: the share of production changes approved by someone other than the author or an agent (baseline review), and the share of high-risk changes that also had a second reviewer (additional review). Target: 100% for both.
  2. Secrets reaching the main branch: keys or passwords found by scanning after merge. Target: zero per month.
  3. Tool gap: AI tools and agents in use compared with the approved list. Target: no gap.
  4. Change fail rate: one of the five metrics in DORA’s software delivery performance metrics, defined as “the ratio of deployments that require immediate intervention following a deployment”. Target: AI-heavy services no worse than the rest.
  5. Open review findings: high-priority findings from the last review that are still open. Target: closed before the next release.

Handle incidents and trends differently. An incident — a secret on the main branch, a change merged without an independent approver, an agent acting outside its scope — is fixed the same day and does not wait for a review meeting. Trends are reviewed monthly; we’d recommend tightening the matching rule when a metric moves the wrong way in two consecutive reviews, which filters out one-off spikes without letting a real decline run for a quarter. Teams with few releases can use a longer window. The business result is predictable maintenance cost, as our guide to AI app development cost shows.

How to roll out AI code governance in 30 days

roll out AI code governance in 30 days

An engineering team can roll out AI code governance in 30 days, one step per week, with the code host and scanners it already has. Weeks 1 and 2 cover the NIST SSDF practice group Prepare the Organization (PO); weeks 3 and 4 cover Protect the Software (PS) and Produce Well-Secured Software (PW).

Week 1 — InventoryList AI tools and agents in use, by team, repository and plan; record where prompts are processed.
Week 2 — PolicyWrite the six decisions on one page; management signs it off; team leads brief developers and suppliers.
Week 3 — ControlsSwitch on required approvers, secret scanning and package checks; add the AI-assistance line to the pull request template; create separate agent accounts.
Week 4 — BaselineHave the code already written with AI tools reviewed by someone who did not write it; our guide to an AI code audit explains the scope.
Table 10. A 30-day rollout of AI code governance.

If week 4 finds problems in payment, authentication or personal-data code, fix those before widening AI or agent use.

How Sunbytes helps you put AI code governance into practice

AI code governance is only as strong as the evidence behind it: controls that run, review records a customer can read, and findings that were actually fixed.

Sunbytes produces the evidence side with an AI-built product review. We scope what was built and who uses it, review the agreed areas across code, product behaviour and technical set-up, and separate what needs attention now from what can wait. The reviewer did not write the code, and the findings come back in plain English with a prioritised action plan. Your team can use each finding to see where a policy rule is missing or a gate control did not catch a problem, and decide which of the six decisions to tighten first.

Where the findings touch access control or personal data, our cybersecurity team adds the security controls and the evidence that NIS2 and ISO 27001 supplier questionnaires ask for. Your team fixes the findings, or Sunbytes fixes the priority items and re-checks them. The work runs with Dutch-led client governance, backed by 15+ years in software delivery and 300+ projects delivered.

→ Discuss your AI-built product with us, and we will scope the review around the governance you are rolling out.


Author

Thien Le Marketing Executive

Thien Le is a B2B content writer with more than four years of experience in crafting compelling B2B content for a global audience, specializing in how people, technology, and business operations come together. At Sunbytes, she plans, connects insights from HR experts, edits, and uses technology to improve content quality. Her content helps readers cut through complexity and find practical information for hiring, paying, and managing people across borders.

What can we help you move forward?

Tell us what you are working on. We will connect you with the right Sunbytes solution.

[ENG] Submission form (Homepage, Service & Contact us)

This field is for validation purposes and should be left unchanged.
Your Full Name(Required)
untitled(Required)
Untitled(Required)