Sub topic 3
Defining allowed, restricted, and prohibited uses
This chapter assumes you know the basic Git and pull request workflow, have done code review in a team, and have used an AI coding assistant. It covers how to sort uses of AI tools into three tiers so that developers know what they can do without asking.
Why three tiers
A rule like "use AI responsibly" tells nobody what to do. A rule like "never use AI" gets ignored and pushes people toward unapproved tools. A tiered list works better because it gives a clear answer for most situations and a clear process for the rest.
| Tier | Meaning | What the developer does |
|---|---|---|
| Allowed | Low risk. Use freely with normal review. | Nothing extra. |
| Restricted | Higher risk. Permitted only under conditions. | Meet the conditions, or get approval first. |
| Prohibited | Risk is not acceptable. | Do not do it. Use the exception process if you think a case is justified. |
What decides the tier
Place a use in a tier by asking three questions:
- What data goes into the tool? Public code and generic questions carry little risk. Customer data, secrets, and unreleased code carry a lot.
- What is the blast radius if the output is wrong? A bad test helper is cheap to fix. A bad change to authentication or payment code is not.
- Can a reviewer or a test catch the mistake? Output that automated checks cover is safer than output that only a careful human would notice.
Data rules are covered in detail in the next chapter. Here, treat data as one input to the tier decision.
Example classification
The table below is a starting point. Your team will move items between tiers.
| Use | Tier | Condition |
|---|---|---|
| Explaining unfamiliar code or error messages | Allowed | Do not paste restricted code or secrets. |
| Drafting unit tests for your own code | Allowed | You run and read the tests. |
| Boilerplate, refactoring suggestions, documentation drafts | Allowed | Normal review applies. |
| Changes to authentication, authorization, or payment code | Restricted | Code owner review is required. |
| Generating database migrations or infrastructure config | Restricted | A second reviewer checks it before it runs. |
| Letting an agent run commands or edit many files | Restricted | Use only approved tools and permission limits. |
| Pasting secrets, customer data, or private keys into a tool | Prohibited | No exceptions without a recorded approval. |
| Using an unapproved tool on company code | Prohibited | Request approval of the tool instead. |
| Merging code you have not read and understood | Prohibited | The author must understand every line. |
Turning tiers into a decision path
Developers should be able to classify a new situation in under a minute. A short decision flow helps.
Making restricted rules enforceable
A restricted rule that exists only in a document depends on memory. Where you can, attach it to something the repository enforces. A CODEOWNERS file routes sensitive paths to named reviewers, whoever or whatever wrote the code.
# .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 turns "changes to authentication are restricted" into a review requirement that GitHub applies when branch protection requires code owner review.
Common errors
- Listing tools instead of uses. Tools change every few months. Uses, such as "generating migrations", stay meaningful.
- Too many tiers or categories. Three tiers is enough. More makes the policy hard to remember.
- No path for the unclear case. Name a person or channel for questions, and say that asking is the expected behavior.
- Prohibited items with no reason. People follow rules they understand. Add one sentence of rationale to each.
Exercise
Your team wants to let developers use an AI assistant to write a new database migration. Which tier fits, and what is one condition you would attach?
Show answer
Restricted. A wrong migration can damage or lose data and is hard to undo. A reasonable condition is that a second reviewer must check the migration, and that it is tested against a non-production copy before it runs in production.