Sub topic 13
Building a team policy and review checklist
This chapter assumes you have read the earlier chapters on human authorship, license contamination, tool terms, employment ownership, confidentiality, and provenance. It turns them into one short policy and one review checklist your team can use. It is general education, not legal advice. Have a lawyer review the final policy, because the law differs by country and is still changing.
What a policy needs to do
A good policy is short enough that people read it. It answers four questions:
- Which AI tools may we use, and for which kinds of code?
- What must never be sent to a tool?
- What must a reviewer check before AI-assisted code is merged?
- What do we record, and who decides when something is unclear?
Each question maps to an earlier risk. Tool terms and indemnity decide the approved list. Confidentiality decides what is off limits. License contamination and human authorship decide the review checks. Provenance decides the records.
Step 1: Approve tools and settings
Keep an approved list. For each tool, record the plan or tier, because terms often differ between free, individual, and business plans. Note these points:
- Whether prompts and code are used for training, and whether you can turn that off.
- Who owns the output under the terms.
- Whether the vendor offers indemnity, and what conditions apply. Some offers require that you enable a filter for public-code matches.
- Whether a setting blocks suggestions that match public code.
Tell people that using an unapproved tool or a personal account for work code is a policy breach. Many contract problems start there.
Step 2: Set data rules
State plainly what must not go into prompts:
- Secrets such as keys, tokens, and passwords.
- Customer data and personal data.
- Code from clients whose contracts forbid third-party tools.
- Unreleased code marked as confidential, unless the tool's terms and your contracts allow it.
Add a secret scanner to pre-commit hooks and CI. It catches leaks in code but not in prompts, so training matters as well.
Step 3: Write the review checklist
Reviewers should see the checklist in the pull request template. Keep it to questions a person can answer in a few minutes.
## AI-assistance checklist
- [ ] I disclosed whether AI tools helped write this change.
- [ ] The tool used is on the approved list.
- [ ] No secrets, customer data, or client-restricted code went into prompts.
- [ ] I read and understand every line, and I made the design choices.
- [ ] Large or unusual blocks were checked for copied code or license notices.
- [ ] Any new dependency has a license we accept.
- [ ] New files carry an SPDX header.
- [ ] The commit message records AI assistance and the reviewer.Two items deserve emphasis. "I made the design choices" supports the human authorship that copyright needs. Checking large or unusual blocks matters because memorized output is most likely to appear in distinctive, self-contained code, such as a complete algorithm with an unusual structure or comments naming an author.
Step 4: Automate what you can
Humans forget. Reuse the SPDX check from the provenance chapter as a CI job, so a missing header fails the build.
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)Use commit trailers to record assistance. 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]>Add a license scanner for dependencies as well. It does not detect copied snippets, but it catches many contamination paths.
Step 5: Define escalation and exceptions
Name one owner, such as an engineering lead or counsel, who handles questions. Define when to escalate:
- A suggestion matches a known project or contains a copyright notice.
- The change goes into a copyleft project, or into a project you contribute to under its own AI rules.
- A client contract is silent or restrictive about AI.
- A tool changes its terms.
When a match is found, the usual options are to rewrite the code independently, replace it with the properly licensed original and comply with its license, or remove it. Record what you chose.
Keep the policy alive
Review it at least yearly and whenever a tool's terms or a relevant law changes. Check that real pull requests follow it. If people skip the checklist, it is probably too long.
Exercise
Your teammate pastes a 60-line sorting routine from an AI assistant. It has an unusual structure and a comment naming a person. Which checklist items apply, and what should happen next?
Show answer
The review-for-copied-code item applies, because the routine is a large, distinctive block with an author's name. The reviewer should escalate to the policy owner, search for the original source, and check its license. If the code is copied, the team should rewrite it independently, or use the original and comply with its license, or remove it. They should record the outcome in the commit and the SPDX header.
Exercise
Why does the checklist ask the author to confirm they made the design choices?
Show answer
Copyright protection depends on human authorship. Recording that a person made the creative decisions, and reviewed and changed the output, supports a claim that the work is AI-assisted rather than purely AI-generated.