Team AI governance: the framework I apply
Shared context, approved tools and actions, restricted access, human review, GDPR, measurement: the framework I set up in a development team, with ready-to-adapt examples.
Why a framework
AI rarely enters a development team through the front door. One developer installs an agent, then another, then the whole team follows, each with their own habits, prompts and permissions. It works, until the day an agent reads a secrets file, pushes to the wrong branch or sends client data to a provider.
The framework described here is the one I set up in early 2026 in the front-end team of a major European hotel group, later extended to the back-end and adopted by other teams. The examples are deliberately generic: adapt them to your own stack.
A shared, versioned context
First building block: everything the agent needs to know about the project lives in the repository, versioned and reviewed like code. A newcomer, human or agent, starts with the same rules as everyone else.
- Project instructions (CLAUDE.md or equivalent): stack, commands, conventions, known pitfalls
- Project memory: decisions made, state of ongoing work, what has already been tried
- Team skills: reusable procedures (review, release, migration) written once, applied by everyone
- Git conventions: branches, commit format, who merges. The agent follows them like a developer
Approved tools and actions
Second building block: an allowlist. Approved AI tools are listed and used through company accounts, not personal ones. For each agent, actions fall into three categories: allowed without asking, subject to confirmation, forbidden. With Claude Code, this is declared in a .claude/settings.json file committed to the repository:
{
"permissions": {
"allow": [
"Bash(npm run test:*)",
"Bash(npm run lint)",
"Bash(git status)",
"Bash(git diff:*)",
"Bash(git log:*)"
],
"ask": [
"Bash(git push:*)",
"Bash(npm install:*)",
"Bash(az repos pr create:*)"
],
"deny": [
"Read(./.env*)",
"Read(./secrets/**)",
"Bash(git push origin main:*)",
"Bash(rm -rf:*)"
]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/guard.sh" }]
}
]
}
}Permission rules filter by pattern; a hook adds a programmable safety net. This script runs before every shell command the agent issues: if it exits with code 2, the command is blocked and the message is sent back to the agent.
#!/usr/bin/env bash
# .claude/hooks/guard.sh: runs before every Bash command issued by the agent
command -v jq >/dev/null || { echo "Blocked: jq is required by the guard." >&2; exit 2; }
cmd=$(jq -r '.tool_input.command // ""')
if echo "$cmd" | grep -Eq '(^|[/[:space:]])\.env(\.|[[:space:]]|$)|secrets/'; then
echo "Blocked: the agent may not access secrets." >&2
exit 2
fi
if echo "$cmd" | grep -Eq 'git push.*(^|[[:space:]:])(main|master)([[:space:]]|$)'; then
echo "Blocked: no push to a protected branch, open a PR instead." >&2
exit 2
fi
exit 0The script requires jq and must be made executable (chmod +x). It complements the Read rule in the permissions file: that rule does not stop a cat .env run through Bash, the hook does. Like any pattern-based filter, it is not exhaustive: it is a safety net, not a vault, which is why the restricted access described below matters.
Least-privilege access
An agent acts with the permissions it is given. The rule is simple: never an administrator's rights, always the bare minimum.
- Least-privilege tokens: an Azure DevOps or GitHub token scoped to the relevant repositories and actions (reading code, opening PRs), with no merge or admin rights
- Mandatory official CLIs (az, gh) rather than home-made scripts: their actions are known, traceable and filterable by permissions
- Read-only database access by default, on test environments, never with a production account
- An access list per service: each team declares what its agents need, nothing more
- Token rotation and expiry, as for any service account
The human-review matrix
Third building block: write down what AI does on its own, what it proposes and what it must not do. This is not about trusting the model, it is about accountability: the human who merges owns the code.
AI does it alone
Read code, run tests and lint, propose a plan, write code and tests on a working branch, draft a PR description.
AI proposes, a human approves
Every PR (systematic human code review), adding or upgrading a dependency, a data migration, a CI or configuration change.
Forbidden to AI
Merging, deploying to production, handling secrets, accessing real client data, changing its own permissions.
Data and GDPR
Whatever goes into a prompt leaves your information system. The team checklist fits in a few lines:
- Never real personal data (clients, employees): use anonymised or synthetic datasets
- Never secrets: API keys, passwords, connection strings
- Never production database extracts
- No contractual or confidential documents without explicit approval
- When in doubt, ask before sending
On the provider side, prefer an enterprise or API offer whose terms exclude training on your data and govern how long it is retained, and document it: it is the first question your DPO will ask.
Traceability and measurement
Spec
Goal and scope, approved by a human
Plan
Detailed steps, reviewed before execution
Execution
The agent codes and tests on a branch
Human review
Code and tests are reviewed
Merge
By a human, never by the agent
Every piece of work leaves a trail: the spec, the plan, commits marked as co-authored with AI, the reviewed PR. And we measure: for a given task, we compare the estimated time without AI with the time actually spent with it. Without measurement, there is no way to know whether AI saves time or wastes it.
On the engagement where this framework was born: 100% of PRs AI-assisted with systematic human review, 2.4× to 10× faster depending on the workstream (29 h down to 4 h 15 overall) and +300 tests that had previously slipped under the radar.Extending to other teams
The framework was designed in a front-end team, then extended to the back-end and adopted by other teams. What carries over as is: the human-review matrix, the data checklist, the principles of versioned context and least privilege. What gets adapted: the tool list, allowed commands and access, which depend on each stack and each service.
My advice for getting started: start small, with a pilot team, one permissions file and a one-page matrix, then measure before extending.
I apply the same philosophy to my own AI agent: prompts approved before going autonomous, a capped budget per flow, model fallback. See the Hermes project.Want to set up this framework in your team? Let's talk.