Sub topic 3
Defining allowed, restricted, and prohibited uses
This chapter assumes you know the Git and pull request workflow, have taken part in code reviews, and have used an AI coding assistant or chat tool. You do not need to know how any particular tool works internally. The chapter covers how to sort uses of AI tools into three tiers, how to write the rules so people can apply them, and what goes wrong when the tiers are badly drawn.
Why three tiers
A policy that says "AI is allowed" or "AI is banned" fails in practice. A blanket ban gets ignored, and people use personal accounts that the team cannot see. A blanket permission ignores that some work is far riskier than other work. The previous chapter listed the risks: incorrect code, insecure code, leaked data, and licensing problems. Those risks do not apply equally to every task.
A three-tier model matches the level of control to the level of risk:
| Tier | Meaning | Typical control |
|---|---|---|
| Allowed | Low risk. Use freely with normal team practices. | Standard review and tests |
| Restricted | Real risk. Allowed only with conditions. | Extra review, approval, or a limited tool setup |
| Prohibited | Risk is unacceptable. Do not do it. | Technical block where possible, plus consequences |
The tiers describe uses, not tools. The same assistant can appear in all three tiers depending on what you ask it to do and what you give it.
Sorting a use into a tier
Ask three questions about each use, in order.
- What data goes into the tool? Public or non-sensitive code is lower risk than secrets, customer data, or restricted source code.
- What is the blast radius if the output is wrong? A broken unit test helper is contained. A flaw in an authentication check can expose every user.
- How easily can a reviewer verify the result? A reviewer can check a generated regular expression against test cases. A reviewer cannot easily verify a cryptographic implementation by reading it.
A use that scores badly on any of the three moves up a tier. A use that scores badly on data is usually prohibited or restricted to an approved tool, because a review cannot undo a disclosure that has already happened.
The flow is a drafting aid, not the policy itself. Real cases will not always fit, and the policy needs a way to handle that (see "Unclear cases" below).
Allowed uses
Allowed uses are ones where the output is easy to check and the inputs are not sensitive. Common examples:
- Explaining unfamiliar code or a library API.
- Drafting unit tests for code you wrote, which you then run and read.
- Generating boilerplate such as data classes, configuration scaffolding, or repetitive mappings.
- Suggesting names, refactoring ideas, or commit message wording.
- Summarizing a public document or error message.
"Allowed" does not mean "unchecked." Every allowed use still goes through the normal pull request process, and the author remains responsible for the result. A later chapter covers author accountability in detail. For now, state in the policy that allowed means no extra approval is needed, not that review is waived.
Restricted uses
Restricted uses are permitted when specific conditions are met. A good restriction names the condition so a person can check whether they meet it. Examples:
- Changes in sensitive paths such as authentication, payments, or infrastructure configuration. Condition: review by the owning team.
- Generating security-relevant code such as input validation, access checks, or cryptographic calls. Condition: a second reviewer with security knowledge, and tests that cover the failure cases.
- Using AI to write database migrations or deployment scripts. Condition: run in a staging environment first, with a rollback plan.
- Using an agentic tool that can run commands or edit files. Condition: only with the permission limits the team has approved (a later chapter covers these).
- Using any AI tool with internal, non-public code. Condition: only a tool on the approved list, configured as the team requires.
The first restriction can be enforced with a CODEOWNERS file. Owners listed for a path are requested as reviewers on any pull request that changes it, and branch protection can make their approval mandatory.
# .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-leadsThis works because the rule attaches to the path, not to the author's honesty about tool use. A change to /auth/ needs the security team whether or not anyone mentions AI.
Prohibited uses
Prohibited uses are the short list the team never accepts. Keep it short. A long list of bans is hard to remember and invites exceptions. Typical entries:
- Pasting secrets, credentials, private keys, or tokens into any AI tool.
- Sharing customer data or personal data with a tool that is not approved for it.
- Using an unapproved tool, including a personal account, for company source code.
- Submitting code you do not understand and could not explain in review.
- Using AI to bypass a control, such as generating a change designed to get past a required check.
- Committing AI output without reading it, including auto-merging unreviewed AI changes into protected branches.
Some of these map to later chapters. Data rules get their own chapter, and tool approval has another. The point here is that the policy states the prohibition plainly and in one place, so no one has to piece it together from several documents.
Where possible, back a prohibition with a technical control. Secret scanning can block commits that contain credentials. Branch protection can stop direct pushes to main. A prohibition that relies on memory alone will be broken eventually, and usually by accident.
Writing rules people can apply
The wording of each rule decides whether it works. Use these habits when drafting.
- Name concrete examples. "Do not share sensitive data" is vague. "Do not paste API keys, customer email addresses, or files from the
/payments/directory" is clear. - State the condition and the approver for restricted uses. "Needs security team review" beats "needs extra review."
- Write rules in terms of what a person does, not what a tool does. Tools change names and features. Behavior rules stay valid.
- Say what to do instead. If a use is prohibited, point to the approved alternative, such as the team's approved tool or a sanitized example.
- Keep each rule testable. Ask whether two people reading it would reach the same decision.
A short worked example shows the difference.
| Weak rule | Stronger rule |
|---|---|
| Use AI responsibly. | AI-generated code goes through the same pull request review and tests as any other code. |
| Do not use AI for risky code. | Changes under `/auth/` and `/payments/` need approval from the owning team before merge. |
| Avoid sharing private information. | Never paste credentials or customer data into an AI tool. Use fake sample data instead. |
Unclear cases
No list covers every situation. Some uses will land between tiers, and people will have to decide quickly. Add two items to the policy.
- A default. State that an unlisted use is treated as restricted until someone with authority classifies it. This is safer than defaulting to allowed and easier to live with than defaulting to prohibited.
- A route to ask. Name a person, a team, or a channel that answers classification questions, and commit to a response time. If asking is slow or awkward, people will skip it.
Record each new decision and fold it into the next revision of the policy. This is how the lists stay current without constant rewrites. The chapter on rollout and revision covers that process.
Common errors
- Drawing the tiers around tools instead of uses. This forces a rewrite whenever a tool changes.
- Listing too many prohibitions. Authors stop reading, and enforcement becomes selective.
- Writing restrictions with no named approver. Nobody knows who can grant the condition, so people either skip it or stall.
- Treating "allowed" as "unreviewed." Review and tests apply to all tiers.
- Banning a use that people still need. The use goes underground, and the team loses visibility. If a use is valuable, find a safe way to allow it with restrictions.
- Never revisiting the tiers. A use that was restricted a year ago may be low risk now because of better tooling, and the reverse can also happen.
Summary of the model
- Sort each use by data sensitivity, blast radius, and verifiability.
- Allowed uses need only normal practices. Restricted uses need named conditions and approvers. Prohibited uses are few, plain, and backed by technical controls where possible.
- Default unlisted uses to restricted, and give people a quick route to ask.
Exercise
Your team wants to let developers use an approved AI assistant to draft a database migration for the /payments/ service. Which tier fits, and which two conditions would you write into the policy?
Show answer
Restricted. The code is in a sensitive path and a wrong migration can damage production data, and a reviewer cannot easily verify it by reading alone. Conditions: the payments team must approve the pull request (enforced through CODEOWNERS), and the migration must be run in a staging environment with a documented rollback plan before merge.
Exercise
A developer asks whether they may paste a stack trace from production into a public chat tool. The policy does not mention stack traces. What should the policy's default say, and what should the developer do?
Show answer
The policy should treat unlisted uses as restricted until someone with authority classifies them. The developer should not paste the trace, because stack traces can contain customer data, file paths, or tokens. They should ask through the named route, or redact the trace and use an approved tool. The answer should then be added to the policy at the next revision.
Exercise
Rewrite this rule so two reviewers would apply it the same way: "Be careful with AI on important code."
Show answer
For example: "Changes under /auth/, /payments/, and /.github/ that were written or edited with an AI tool need approval from the owning team listed in CODEOWNERS before merge, and must include tests for failure cases." The rewrite names the paths, the approver, and a checkable condition.