Sub topic 15
Writing a team policy for AI tool use
This chapter assumes you know basic Git and the command line, have used an AI coding assistant, and understand environment variables. It also assumes you have read the earlier chapters on data flow, secret scanning, and incident response. A team policy joins those controls into rules that everyone follows in the same way.
Why a written policy helps
Individual habits vary. One developer pastes production logs into a chat tool, and another uses a personal account on a free plan. A short written policy removes guesswork. It also gives reviewers something concrete to check against when something goes wrong.
A good policy is brief enough to read in ten minutes. It names the approved tools, classifies the data, sets the controls, and says who to tell when something leaks.
Step 1: List approved tools and plans
Name each tool and the plan tier the team may use. The plan matters because retention and training terms often differ between free, personal, and business tiers. Record the date you reviewed the provider's terms, since they change.
| Tool | Approved plan | Allowed data classes | Reviewed |
|---|---|---|---|
| Coding assistant | Business tier, company account | Public, Internal | 2026-11-01 |
| Chat tool | None (not approved) | None | 2026-11-01 |
| Local model | Self-hosted | Public, Internal, Confidential | 2026-11-01 |
Personal accounts should be excluded for work code. Company accounts allow central billing, access removal, and audit logs.
Step 2: Classify the data
Use a small number of classes so people can apply them quickly.
- Public: open-source code and published documentation.
- Internal: ordinary private source code and design notes.
- Confidential: customer data, unreleased security fixes, and proprietary algorithms.
- Secret: credentials, private keys, and tokens. These never go into any AI tool.
For each class, state which tools may receive it. The table above shows one way to do this.
Step 3: Turn rules into controls
A rule that depends on memory fails. Back each rule with a check that runs automatically.
- Commit a shared ignore file so tools skip secret files. Support varies by tool, so list which tools honor it.
- Run a secret scanner as a pre-commit hook and again in CI.
- Require agent approvals for commands and network access, and forbid blanket auto-approve modes.
- Require that extensions and tool servers be reviewed before installation.
The CI step is the backstop, because a developer can skip a local hook.
name: secret-scan
on: [pull_request]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Step 4: Define the leak procedure
State the order of actions: revoke and rotate the credential first, then review access logs, then clean up history. Name the person or channel to notify and the time limit for reporting. Make reporting safe, so no one hides a mistake out of fear.
Step 5: Review and audit
Assign an owner for the policy. Review it on a fixed schedule, such as every quarter, and whenever a provider changes its terms. Sample the audit logs of approved tools, and track scanner findings over time. Rising findings suggest that training or tooling needs work.
Common mistakes
- Writing rules with no matching technical control.
- Approving a tool but not the plan, so staff use the free tier.
- Never updating the policy after a provider changes its terms.
- Punishing reports of leaks, which discourages them.
Exercise
A teammate wants to paste a failing customer-facing log into a chat tool that is not on the approved list. Using the decision path in this chapter, what should happen, and which two policy elements should have prevented the question from arising?
Show answer
The data should not be sent, because the tool is not approved. The approved-tools list should have named a sanctioned alternative, and the data classification should have told the teammate that customer data is Confidential and allowed only in tools approved for that class.