The policy playbook

How to Govern AI-Generated Code

By Suralal S, VP of Technology · Seven copy-paste policies + a 30-day rollout · July 2026

Your team didn't ask permission to adopt AI coding tools, and that was the right call — the productivity is real. But somewhere around the point where AI writes half your diffs, an uncomfortable question lands on the CTO's desk: what's our actual policy here? Usually the answer is a shrug. This playbook replaces the shrug.

Below are seven policies we see working inside real engineering organisations. They are written as enforceable rules, not aspirations — each one has a trigger, a condition, and an action, which means each one can be automated. Copy them, edit the thresholds, and you have an AI coding policy by Friday.

The two failure modes to avoid

Before the policies, the two ditches on either side of the road:

Everything below follows the middle path: risk-based routing. Routine AI changes clear automatically through gates; the narrow set that needs judgment goes to a named human, with evidence attached.

The seven policies

POLICY 1 · ATTRIBUTION
WHEN any commit or PR is created
REQUIRE AI-assisted changes tagged at commit time (tool, agent, or trailer)
DEFAULT untagged bulk changes are treated as AI-authored
Why: you cannot govern what you cannot distinguish. This is the foundation every other policy depends on — and the default clause removes the incentive to skip tagging.
POLICY 2 · HIGH-RISK HUMAN REVIEW
WHEN a PR is opened
IF AI-authored share > 70% AND touches payments | auth | PII | infra
THEN require review by a named senior engineer before merge
Why: this is the policy auditors and boards ask about first. Note what it doesn't do — it doesn't touch the other 95% of changes.
POLICY 3 · TEST COVERAGE GATE
WHEN a PR is opened
IF AI-authored AND module coverage < 60%
THEN block merge until tests accompany the change
Why: AI writes implementation faster than it writes meaningful tests. Untested AI surface area is where incidents come from six weeks later.
POLICY 4 · DEPENDENCY & LICENSE CHECK
WHEN an AI-authored change adds a dependency
THEN run license + vulnerability scan before merge
ESCALATE unknown licenses to engineering lead
Why: AI assistants happily import packages a human would have questioned. This one catches supply-chain and licensing surprises at the diff, not in legal review.
POLICY 5 · CHANGE FREEZE
WHEN a deploy is requested
IF inside freeze window (e.g. Fri 14:00 – Mon 08:00)
THEN hold deploy, notify release manager
Why: agent-driven pipelines don't know it's Friday evening unless you tell them. Freezes must be machine-enforced once machines can deploy.
POLICY 6 · INCIDENT HOLD
WHEN a sev-1 incident opens
IF pending deploys touch the affected service
THEN pause the release train until resolution
Why: at AI-era deploy frequency, shipping into an active incident is the most preventable way to turn one outage into two.
POLICY 7 · EVIDENCE LOG
WHEN any gate passes, fails, or is overridden
THEN log actor, decision, evidence, and timestamp as an immutable record
RETAIN per your compliance framework (SOC 2 / ISO 27001 / EU AI Act)
Why: a policy that leaves no evidence might as well not exist at audit time. This turns every enforcement into a compliance asset.

The 30-day rollout

  1. Week 1 — Attribution only. Ship Policy 1. Announce it as observability, not enforcement: "we're learning where AI helps." No gates yet; nobody routes around what doesn't block them.
  2. Week 2 — Baseline. Measure: AI share by repo, coverage in AI-heavy modules, review load. Pick thresholds from your data, not this article's defaults.
  3. Week 3 — Enforce three. Turn on Policies 2, 5, and 7 — the human-review rule, the freeze, and the evidence log. Escalations must go to a named role with context attached, never a shared channel.
  4. Week 4 — Review the ratio. Healthy target: 95%+ of changes clear automatically. If more than ~5% routes to humans, your conditions are too broad — tighten them before the team feels the drag.

Enforcement is the hard part

Everything above can live in a wiki and change nothing. The difference between a policy document and a governed pipeline is mechanical enforcement: something has to read every change, apply the conditions, route the escalations, and write the evidence log — continuously, without a human remembering to check.

That enforcement layer is what AI delivery governance platforms exist to provide. (It's also exactly what DryDock's agent crew does — each policy above maps to a trigger → condition → action agents run for you.)

Turn this playbook into a running system

DryDock ships these policies as pre-built agents: attribution, risk-based human review, coverage gates, freezes, incident holds, and a continuous evidence log — live in your pipeline in a week.

Request early access