Sub topic 12
Writing, Rolling Out, and Revising the Policy
This chapter assumes you have read the earlier chapters on risks, acceptable use, data rules, accountability, review, disclosure, and automated guardrails. It also assumes you can work with pull requests and CI. Here you turn those separate decisions into one policy document, put it in front of a team, and keep it current.
Why the writing and rollout matter
A policy can be correct and still fail. Common causes are that nobody reads it, it contradicts what the tools actually allow, or it is so long that people stop trusting it. The goal is a short document that people follow because it is clear, easy to find, and backed by checks that run on their own.
Three things tend to decide whether a policy works:
- Clarity. A reader can answer "may I do this?" in under a minute.
- Enforceability. Rules that can be checked by a tool are checked by a tool. Rules that need judgment have a named person who decides.
- A path to change. The policy has an owner, a review date, and a way to propose edits.
Writing the policy
Start from decisions you already made
Do not draft from scratch. Collect the outputs of the earlier chapters:
- The allowed, restricted, and prohibited uses.
- The data classes and which may be shared with which tools.
- The list of approved tools and their required settings.
- The rule that the author owns every change.
- The review and disclosure expectations.
- The automated checks and the permission limits for agentic tools.
Your job is to arrange these into a document, resolve conflicts between them, and fill gaps.
A workable structure
Keep the main document to roughly two pages. Put detail in linked appendices.
| Section | What it contains | Example content |
|---|---|---|
| Purpose and scope | Who and what the policy covers | All employees and contractors, all repositories, all AI tools that read or write code |
| Principles | Two or three sentences that settle ambiguous cases | "The author is responsible for every line they submit." |
| Uses | Allowed, restricted, prohibited | Restricted: generating authentication code requires review by the security team |
| Data | What may be shared, by data class | No customer data or secrets in any prompt |
| Tools | Approved tools and required configuration | Link to the approved-tool list |
| Review and disclosure | What authors and reviewers must do | Complete the pull request template |
| Enforcement | Which rules are automated | Required CI check, CODEOWNERS |
| Exceptions and incidents | How to ask and how to report | Link to the exception form and incident channel |
| Ownership and review | Owner, version, next review date | Owner: engineering leads, review every six months |
Write rules that can be tested
Compare these two rules:
- Weak: "Be careful with sensitive code."
- Strong: "Code under
/auth/and/payments/may be edited with an approved tool only if a member of the owning team approves the pull request."
The strong version names a place, a condition, and a checker. It also maps directly to a CODEOWNERS entry, so a tool can enforce it. When you finish a draft, read each rule and ask three questions. Who checks this? How would they know it was broken? What happens then? If a rule has no answer, rewrite it or mark it as guidance instead of a requirement.
Separate requirements from guidance
Use "must" and "must not" only for rules you will enforce or act on. Use "should" for good practice. If every sentence says "must", people cannot tell which ones carry consequences, and the rules that matter get lost.
Plain language and a short length
Write for an engineer reading between tasks. Prefer short sentences and concrete examples. Include a few worked cases, such as "Pasting a stack trace that contains a customer email address into a chat tool: not allowed. Remove the address first." Examples settle more disputes than principles do.
Making the policy enforceable in the repository
A policy kept in a wiki is easy to ignore. Put its enforcement where work happens. The three repository files below carry most of the load, and each ties back to a section of the policy.
CODEOWNERS routes sensitive paths to the right reviewers:
# .github/CODEOWNERS
# Changes to these paths always need review from the named owners,
# no matter how the code was written.
/auth/ @example-org/security-team
/payments/ @example-org/payments-team
/.github/ @example-org/platform-team
/docs/policies/ @example-org/engineering-leadsNote that /docs/policies/ is owned by the engineering leads. If the policy lives in the repository, changes to the policy itself go through review too.
The pull request template records verification and disclosure:
<!-- .github/pull_request_template.md -->
## What changed and why
## How I verified it
- [ ] I read and understand every line in this PR
- [ ] I ran the tests locally
- [ ] New or changed behavior has tests
## AI assistance (per team policy)
- [ ] No AI tool was used
- [ ] AI tool used for part of this change (tool and scope: ____ )
- [ ] No secrets, customer data, or restricted code were shared with the toolThe CI workflow runs the same tests on every change:
# .github/workflows/ci.yml
name: ci
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm testThis workflow only enforces anything once you mark the test job as a required status check in branch protection. Until then, a failing run is advice, not a gate.
Rolling out the policy
Plan the rollout in stages
Switching on every rule at once on a Monday produces confusion and resentment. A staged rollout lets you find problems while they are cheap.
- Draft with the people who will live with it. Include at least one engineer from a team that uses AI tools heavily, one reviewer, and someone from security or legal. A policy written only by managers tends to miss how the work really happens.
- Collect feedback on the draft. Ask specific questions: "Which rule would you break by accident? Which rule can't you tell how to follow?"
- Pilot with one team. Pick a team with a mix of experience. Run the policy and the new checks for two to four weeks.
- Adjust. Fix confusing wording, noisy checks, and rules the pilot showed to be unworkable.
- Announce to everyone. Give the effective date, a one-page summary, a link to the full text, and the person to ask.
- Review on a schedule. Set the date at launch.
Start checks in a non-blocking mode
New automated checks often produce false alarms. Run them first in report-only mode, where they comment or warn but do not block merges. Look at the results for a couple of weeks. When the false-positive rate is low, make the check required. This avoids a situation where engineers learn to bypass a gate that was wrong from day one.
Handle existing work
Decide what happens to code and tools already in use. Two common choices:
- Grandfather with a deadline. Existing tool use continues, but it must meet the policy within a set period, such as 30 days.
- Audit and fix. Review recent merged changes in restricted areas and open follow-up tickets for anything that does not meet the policy.
State the choice in the announcement. Silence leaves people unsure whether they are already in violation.
Common rollout errors
- Launching with no owner. Questions go unanswered and the document drifts. Name one owner or one small group.
- Conflicting sources. The wiki, the contributing guide, and the template say different things. Keep one canonical text and link to it.
- Rules without tooling. If a rule needs a check that does not exist yet, say so and mark the rule as guidance until it does.
- No path for exceptions. People will find their own workarounds. A short exception process is cheaper than hidden violations. The incident and exception chapter covers it in detail.
- Treating the launch as the end. Tools change quickly. A policy that never changes becomes wrong.
Revising the policy
Keep it in version control
Store the policy as Markdown in a repository. Then every change has an author, a reason, a reviewer, and a history. Use the CODEOWNERS entry shown earlier so that edits need approval from the engineering leads.
Add a short header to the document:
# AI-Assisted Code Policy
- Version: 1.2
- Owner: Engineering leads
- Last reviewed: 2026-10-15
- Next review: 2027-04-15Decide what triggers a revision
Revise on a schedule and on events. A scheduled review every six months is a reasonable default for a field that changes this fast. Also review early when any of these happen:
- A new tool is proposed or an approved tool changes its data terms or features.
- A tool gains new agentic abilities, such as running commands or editing many files.
- An incident exposes a gap.
- Exception requests pile up for the same reason, which suggests the rule itself is wrong.
- A law, customer contract, or audit requirement changes.
- A check produces many false positives or is routinely bypassed.
Make proposing changes easy
Anyone should be able to open a pull request or an issue against the policy. Give the owner a service-level goal, such as replying within one week. If suggestions vanish, people stop making them.
Record what changed
Keep a short changelog at the bottom of the document. Each entry gives the date, the change, and the reason. When a rule is removed, say why. This stops the same debate from restarting every year, and it helps new members understand the history.
Communicate changes proportionately
Not every edit needs an announcement. A typo fix does not. A new prohibited use, a changed data rule, or a new required check does. For those, post a summary of what changed and from what date, and update the pull request template and checks in the same change so the text and the tooling never disagree.
Quick checklist
- The policy is under two pages, with linked detail.
- Each "must" has a named checker or decision maker.
- Sensitive paths appear in CODEOWNERS.
- The template, CI workflow, and policy text agree.
- The core CI job is a required status check.
- A pilot has run, and new checks started in report-only mode.
- The document has an owner, a version, and a next review date.
- Exceptions and incidents have a documented route.
Exercise
Your team's draft policy says: "Developers must be careful when using AI tools on security-sensitive code." Rewrite it as a rule that can be tested and enforced, name two repository mechanisms that support it, and say how you would introduce a new automated check for it without disrupting the team.
Show answer
A testable version: "Changes under /auth/ and /payments/ must be approved by a member of the owning team before merge, whether or not an AI tool was used." Supporting mechanisms: a CODEOWNERS entry that assigns those paths to the security and payments teams, and branch protection that requires code owner review (plus the required CI test check). To introduce a new check, first run it in report-only mode so it warns but does not block, review the false positives for a couple of weeks, pilot it with one team, fix noisy cases, and then make it a required status check and announce the effective date.
Exercise
Six months after launch, the exception log shows that eight different teams asked for permission to use the same approved assistant on files in /docs/ because the policy lists documentation as restricted. What does this suggest, and what should the policy owner do?
Show answer
Repeated exceptions for the same reason suggest the rule is wrong or too broad, not that eight teams are careless. The owner should open an early review, check whether documentation really carries the risk that justified the restriction, and likely move documentation to allowed use (keeping the data rules). They should update the policy text, the version number, and the changelog with the reason, adjust any related CODEOWNERS or checks in the same change, and announce the change because it alters a permitted use.