Governance

An AI Coding Policy Template for Engineering Organizations

Most companies that adopt AI coding agents do it without a written policy. Then something goes wrong, a secret leaks into a prompt, a junior ships code nobody reviewed, and the policy gets written under pressure, badly. Here is a short policy you can adapt today, and a way to make it stick.

Why a written policy beats good intentions

"Use your judgment" is not a policy. It is what you say when you do not have one. Engineers will use AI coding agents whether or not you have a policy, often with personal accounts and no oversight. A short written policy does two things: it tells people what is expected before they guess, and it gives you something to point to when a decision needs to be defended, to a client, an auditor, or a board.

The six points every policy needs

Keep it short enough that people actually read it. These six points cover the decisions that matter:

  • Who may use which tools: name the approved AI coding agents and who can use them, on company accounts, not personal ones.
  • What data never enters a prompt: customer data, secrets, credentials, and anything covered by a client confidentiality agreement.
  • What is always reviewed by a person: every change that reaches production, no exceptions for "it was just AI-generated".
  • How AI-assisted work is declared: a simple marker in the commit or pull request, not a confession, just a fact for later audits.
  • What quality bar applies: the same tests, linting, and review standard as human-written code, never a lower one.
  • Who is accountable: whoever directs the agent and merges the result. The policy should say this in those words.

Turning the policy into checks

A policy that lives only in a document gets ignored within a month. The parts that matter should be enforced by tooling, not memory:

  • Secret scanning in pre-commit hooks and CI, so a leaked key fails the build, not the audit.
  • License checks on dependencies an agent suggests, since agents will happily propose a package with terms you cannot use.
  • A required review step in your pull request template that cannot be skipped, with a checkbox for "AI-assisted, reviewed line by line".
  • Approved-tools enforcement at the network or SSO level where you can, rather than trusting everyone to remember.

Rolling it out without a revolt

A policy that reads like a ban list will get worked around. Frame it as removing risk from something the team already wants to do, not blocking it. Involve two or three senior engineers in writing the first draft, pilot it on one team for two weeks, and fix what is impractical before you roll it out company-wide. Publish the reasoning, not just the rules: engineers follow a policy they understand.

A copy-ready template

Adapt this to your context, keep the six points, and put it where your engineering handbook lives:

  • Approved tools: [name your approved AI coding agents]. Company accounts only.
  • Never in a prompt: customer data, credentials, secrets, anything under an NDA.
  • Always reviewed: every change to production code, by a human who understands it.
  • Always declared: mark AI-assisted commits or pull requests so the record is honest.
  • Same bar: tests, linting, and review apply exactly as they do to human-written code.
  • Accountable: whoever directs the agent and merges the change owns the result.

Keeping it alive

Review the policy every quarter, or whenever a new class of tool shows up. Name an owner, usually a senior engineer or the CTO, who updates it and answers questions. A policy nobody owns goes stale the day it is published.

Frequently asked questions

Does this policy apply to autocomplete tools like GitHub Copilot, not just full agents? βŒ„

Yes. The data boundary and the review requirement apply to any tool that sees your code or suggests changes, autocomplete included. The accountability point matters less for a single suggested line, but the data rule does not change.

What about engineers using a personal ChatGPT or Claude account? βŒ„

Treat it as an unapproved tool under the policy. The risk is not the model, it is that company code or data leaves through an account you do not control and cannot audit. Approve a company account for the same tool instead of trying to ban the behavior outright.

How do we handle the licensing risk of AI-suggested open source code? βŒ„

Run the same dependency and license scanning you already use for human-added packages, and make sure it also runs on AI-suggested code before merge. Agents do not check license compatibility unless you ask, and they will suggest whatever solves the problem fastest.

Does the policy need to say something different for juniors? βŒ„

Yes, one line: junior engineers must be able to explain any AI-generated code they submit, in their own words, before it is reviewed. It costs nothing to enforce and it is the single best protection against the illusion of competence.

Get a policy your team will actually follow

A policy is only as good as the rollout and the checks behind it. If you want help adapting this to your context, wiring it into CI, and getting engineering buy-in, that is exactly what I do in advisory engagements.