Sub topic 13
Building a team policy and review checklist
This chapter turns the earlier concepts into something a team can adopt. It assumes you have read the chapters on human authorship, license contamination, tool terms, employment ownership, confidentiality, and provenance. It is general education, not legal advice. Have a lawyer review the final policy, because the law differs by country and is still changing.
Why a written policy helps
Without a policy, every developer decides alone. One person pastes a customer's source file into a public chatbot. Another accepts a 60-line suggestion without checking where it came from. A third avoids AI tools entirely and slows the team down.
A written policy does three things:
- It sets the same rules for everyone, so review is predictable.
- It records that the team took reasonable care. This matters if a customer, auditor, or acquirer asks how you manage AI-related risk.
- It moves decisions out of individual judgment on the points where mistakes are costly, such as secrets and licenses.
A policy should be short enough that people read it. Aim for two to four pages plus a checklist, and keep it in the repository or the team wiki.
What the policy should cover
Each section of the policy maps to a risk covered earlier in this tutorial.
| Policy section | Risk it addresses | Example rule |
|---|---|---|
| Approved tools | Weak tool terms, unclear output ownership, data retention | Only tools on the approved list may be used on company code |
| Data handling | Leaked confidential code, secrets, and personal data | Never paste secrets, customer data, or client code into unapproved tools |
| Ownership and contracts | Client or employer terms that restrict AI use | Check the contract before using AI on client work |
| License hygiene | Generated code that reproduces licensed code | Run a license and similarity scan on large AI-assisted changes |
| Provenance | No record of how code was produced | Record AI assistance in commits for non-trivial contributions |
| Open-source contributions | Project rules that ban or limit AI-generated patches | Follow the target project's AI policy before submitting |
| Accountability | "The AI wrote it" as an excuse | The human who submits code is responsible for it |
Approved tools and tiers
Evaluate each tool once, centrally, instead of leaving each developer to read the terms. Use the questions from the chapter on tool terms:
- Does the vendor claim any rights in your output?
- Is your prompt and code data used for training? Can you opt out, and is the opt-out the default?
- How long is data retained, and where is it stored?
- Does the vendor offer an indemnity for copyright claims about output? What conditions apply, such as requiring a duplicate-detection filter to stay on?
- Is there an enterprise plan with stronger terms than the free or personal plan?
Many teams then sort tools into tiers:
- Approved for all code. Enterprise terms, no training on your data, acceptable retention.
- Approved for non-sensitive code only. For example, a consumer plan that may be used for open-source work or learning projects, but not for proprietary code.
- Not approved. Unknown vendor, unclear terms, or terms that conflict with your obligations.
Record the plan, not just the product. The same product can have very different terms on a free plan and on a business plan.
Data classification
Tie tool tiers to the sensitivity of the code. A simple scheme is enough:
- Public: already open source or published. Any approved tool.
- Internal: proprietary but not especially sensitive. Tier 1 tools only.
- Restricted: secrets, credentials, personal data, client code under strict contracts, security-critical logic. No external AI tools unless the contract and a security review explicitly allow it.
Secrets deserve their own rule. Credentials in a prompt may be logged or retained, and rotating a leaked key is cheaper than explaining it later. Add a secret scanner to pre-commit hooks and CI so that credentials do not reach the repository either.
Where policy meets contracts
A team policy cannot override a contract. Before finalizing it, collect the obligations that already bind you:
- Employment agreements. These usually assign work product to the employer. Check whether they say anything about third-party tools or AI.
- Client contracts. Some require that you disclose AI use, forbid it, or require that all deliverables be original work you can warrant. A warranty of originality is hard to give if you cannot verify generated code.
- Customer security questionnaires. Procurement teams increasingly ask about AI use. Your policy gives you a consistent, truthful answer.
- Open-source project rules. Some projects restrict or ban AI-generated contributions. The policy should require checking before you submit.
When a client contract is silent, ask. A short email that gets written permission is cheap insurance.
Provenance conventions
The policy should say what to record and where. Keep it light so people actually do it. A common approach is a commit trailer. A trailer is a Key: value line at the end of a commit message. The names below are a team convention, not a standard, so define yours in the policy.
Add retry with exponential backoff to HTTP client
The retry loop was drafted with an AI assistant and then rewritten by hand.
I reviewed it for copied code and license notices.
AI-Assisted: yes
AI-Tool: example-assistant
Reviewed-by: Jane Developer <[email protected]>Decide in the policy when a trailer is required. A reasonable threshold is "any change where the AI produced more than trivial completions", such as a whole function, a test file, or a generated module. Autocomplete of a variable name does not need one.
License metadata is a separate concern. Every new source file should state its license, whether a human or an AI wrote it:
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Example Corp.
def clamp(value: float, low: float, high: float) -> float:
return max(low, min(value, high))Note what this header does and does not do. It states the license under which your project distributes the file. It does not prove that anyone holds copyright in every line, and it does not clear the code of third-party obligations.
Automating the checks that machines do well
Checklists fail when they depend on memory. Automate the mechanical parts in CI and keep human attention for judgment calls.
This script fails the build when a Python file under src/ has no SPDX identifier in its first five lines:
import sys
from pathlib import Path
def has_spdx(path: Path) -> bool:
with path.open(encoding="utf-8", errors="ignore") as f:
head = [next(f, "") for _ in range(5)]
return any("SPDX-License-Identifier:" in line for line in head)
missing = [p for p in Path("src").rglob("*.py") if not has_spdx(p)]
for p in missing:
print(f"missing SPDX header: {p}")
sys.exit(1 if missing else 0)Beyond this, a typical pipeline also includes:
- A secret scanner on every push.
- A dependency license scanner that flags copyleft or unknown licenses in new packages.
- A code similarity or snippet-matching scan for large generated blocks, if your tooling supports it.
- A check that required commit trailers are present when the pull request is labeled as AI-assisted.
Be honest about limits. Scanners find known matches. They miss reworded or partial copies, and they produce false positives. A passing scan lowers risk. It does not remove it.
The review checklist
The checklist is what a reviewer or author walks through for an AI-assisted pull request. Keep it to one screen.
Author, before opening the pull request
- I used only an approved tool at the right tier for this code's classification.
- No secrets, personal data, or restricted code went into prompts.
- I read and understood every line. I can explain it without the tool.
- I looked for signs of copying: unusual comments, copyright notices, distinctive names, long blocks that do not match the project's style.
- New files have SPDX headers matching the project license.
- New dependencies were checked for license compatibility.
- Provenance trailers are present where the policy requires them.
- I checked the client contract or the target open-source project's AI rules, if either applies.
Reviewer
- The change is explained in the description, including what the AI produced.
- Automated checks passed, and I looked at any warnings instead of dismissing them.
- Large generated blocks received the same scrutiny as code from an unknown contributor.
- Tests exist and cover behavior, not just the happy path.
- Anything suspicious is escalated, not merged with a note to fix it later.
This diagram shows where each check sits in the flow of a change.
Handling incidents
Policies need an answer for when something goes wrong. Write a short incident section covering:
- Leaked secret or confidential code. Rotate the credential at once, report it to security, and check the vendor's deletion options. Do not wait to see if anyone notices.
- Suspected copied code. Stop distributing the change if possible. Identify the likely source and its license. Then either comply with the license, replace the code with a clean implementation, or remove it. Keep a record of what you did.
- License complaint from a third party. Route it to legal immediately. Developers should not reply on their own.
State that reporting a mistake early is expected and will not be punished. Teams that hide incidents find them later at a worse time.
Rolling out and maintaining the policy
A policy that nobody follows is worse than none, because it creates a false record. To keep it useful:
- Start with the few rules that prevent the costliest mistakes: tool tiers, secrets, and human accountability. Add more once those stick.
- Explain the reason for each rule in one sentence. People follow rules they understand.
- Name an owner, usually an engineering lead working with legal or security.
- Review it every six months and whenever a tool changes its terms or a relevant law or court decision appears. Vendors change terms often, so keep a dated record of the version you evaluated.
- Treat exceptions as data. If many people ask for the same exception, the rule may be wrong.
Summary
- A team policy covers tools, data handling, contracts, license hygiene, provenance, open-source contributions, and accountability.
- Tie tool approval to data classification, and approve plans, not just products.
- Contracts with employers and clients override team preferences, so check them first.
- Automate what scanners do well, and use the human checklist for judgment.
- Plan for incidents, assign an owner, and review the policy on a schedule.
Exercise
Your team's policy says "Restricted" code may not be sent to external AI tools. A developer wants to use an approved enterprise assistant on a client's authentication module. The client contract is silent about AI. Name two steps the policy should require before the developer proceeds, and explain why a clean license scan afterward does not replace them.
Show answer
First, classify the module. Client authentication code is likely Restricted, so the developer should not use the tool by default. Second, get explicit written approval from the client (and from security under the team's policy) because the contract's silence does not grant permission and the code may be confidential. A license scan only checks for matching third-party code in the output. It does not address confidentiality of what was sent to the tool, contract obligations, or whether the client permits AI use, so it cannot substitute for those approvals.
Exercise
A pull request adds a 120-line generated parser with no SPDX header, and the author's description says only "added parser". List three checklist items the author or reviewer should flag.
Show answer
(1) The new file lacks an SPDX header, so the CI check should fail and the author must add the project's license identifier. (2) The description does not say the code was AI-generated, so the provenance trailers and an explanation of what the tool produced are missing. (3) A 120-line generated block needs extra scrutiny for copied code, so the author should confirm they understand every line, check for copyright notices or distinctive naming, and run the similarity scan before review continues.