Every agent working in a company gets a role written in two lines, what it does and what it may not touch. Spread those two lines across a table and most of the columns turn out to match a setting in the tool the agent connects to. By the end of this page you have a list of roles and a permission list table to copy and fill in. If you have a team that writes code, you also get the same thing in Claude Code.

Here an agent means an AI tool that connects to your company's tools and carries out a task step by step.

The agent that produces the work and the agent that checks it get separate rows

When you add an agent that checks the producing agent's work, the two get separate rows in the table, because a model's tendency to score its own output higher has been measured. In a study by Panickssery, Bowman and Feng, language models used as evaluators scored their own summaries higher even when people rated the two summaries as equal (arXiv). The experiment was on summarization and used models older than today's. It wasn't measured on agent work.

The same model can run in both roles, and it may recognize its own text there too. Even then, if the checking agent has no write permission, it can't fix the producer's work itself and pass it through as approved. It leaves what it found as a note, and the fix is up to the producing agent or a person. Give the checking agent its criteria in writing as well. Anthropic's post on agents says the setup that splits generating calls from evaluating calls works when the criteria are clear.

Which roles should be separate

The table has five roles: researcher, writer, coder, tester and checker. You don't have to make each one a separate agent. The reason to split a role in two is that the two halves need different permissions.

The first split is on write permission. OWASP (Open Worldwide Application Security Project) has a risk list for agentic applications, and one of its examples of tool misuse is an agent that summarizes emails but can also delete and send them without approval. The fix it gives is to not grant the summarizer either of those two permissions.

In one of the same list's example attack scenarios, an agent gets tricked into chaining an internal-only CRM tool, where the customer records are, with a tool that sends email outside, and it leaks the customer list. My suggestion is to never connect a tool that sends anything outside to an agent that reads internal data.

Giving coding and testing to separate agents is also my suggestion. The source doesn't make that split. When an agent can't get a test to pass, it sometimes loosens the test or deletes it. If the coding agent never touches test files, every change to a test comes from the testing agent and shows up on its own in the PR, the change request your team reads and approves.

The permission list table

The measure in every cell is the principle of least privilege. By the definition of the US National Institute of Standards and Technology (NIST), each entity gets only the resources and permissions it needs to do its job.

The rows below are examples. Replace them with your own work. In the code rows, the repo is where the code lives and a branch is a separate line of work inside it. main is the branch that goes live, merge means taking a PR into it, and lint is the command that checks the code against its style rules. The cells in parentheses aren't enforced by the settings file. PR review keeps them.

Agent rolePurposeCan readCan writeCan runNever touchesWho approvesWhere it's logged
ResearcherCollects sources, writes a briefWeb, shared folderResearch folderNothingCustomer data, outgoing emailThe person who asked for the briefShared log table
WriterWrites draftsBrief, voice samplesDrafts folderNothingSending, paymentsThe owner of the pieceShared log table
CoderMakes changes on its own branchRepoCode files, PRTests, lintmain, merge, .env, test files (in PR review)Whoever reviews the codePR
TesterWrites and runs testsRepoTest files (in PR review)TestsApplication code (in PR review)The owner of the PRPR
CheckerChecks the work against criteriaThe work produced, the criteria listReview notes onlyNothingFixing the producer's outputThe person at the approval gateShared log table

Sending and paying never go into any row's Can write or Can run cell. The person in the Who approves column does both. OWASP also asks for human approval on actions that are hard to reverse, like transfers or publishing.

If the tool allows it, write the Never touches column into the settings of the tool the agent connects to as well. The reason is in the mistakes further down. For the Where it's logged column, OWASP recommends keeping an unchangeable record of every tool call.

In a team that writes code, the table moves into the settings file

If you don't have a team that writes code, skip to the section on tools outside code.

If your team uses Claude Code, Anthropic's coding agent that runs in the terminal, the base for every session sits under the permissions key in .claude/settings.json. Limits per role go into the subagent file, the definition of a separate agent that the main agent hands part of the work to.

For company agents my suggestion is that writing files and running commands ask for approval, and that only the test and lint commands the team runs every day go through without asking. Claude Code doesn't set this up by itself. According to the docs, from v2.1.283 on, an interactive session opens in a permission mode called auto, and older versions ask before running a command.

The settings file of the template of the free program opens in acceptEdits, so it accepts file edits without asking. git push, which sends local changes to GitHub, and opening a PR both need approval. Pushing to main, merging and force pushing are on the deny list, the commands Claude Code never runs. The block below follows the same logic. The difference is that file edits need approval too.

{
  "permissions": {
    "defaultMode": "default",
    "allow": [
      "Bash(pnpm test *)",
      "Bash(pnpm lint *)"
    ],
    "ask": [
      "Bash(git push *)"
    ],
    "deny": [
      "Bash(git push origin main *)",
      "Bash(git push --force *)",
      "Bash(git reset --hard *)",
      "Bash(gh pr merge *)",
      "Read(./.env)",
      "Read(./.env.*)"
    ]
  }
}

The order the rules are checked in, and where the deny list stops, are covered in the article Where to start with Claude Code in a team. The .env lines keep Claude Code's file reading tool away from those files. They don't always stop a command that reads the same file from the terminal. According to the docs, the Bash(git push *) rule doesn't catch the form git -C . push origin main. For a hard limit you need a PreToolUse hook that checks the command with your own script before it runs, or the sandbox, which restricts Claude Code's file and network access no matter what the command text says.

defaultMode only sets the mode a session starts in. Whoever is using the agent can switch modes inside the session with Shift+Tab. Run /status to check that the setting loaded. Auto and bypassPermissions can't be turned on from the project file. To turn both off for the team, set permissions.disableAutoMode and permissions.disableBypassPermissionsMode to "disable" in the managed settings, the file an admin distributes that sits above user settings.

Write tools: Read, Glob, Grep in the subagent file and the checker can use only those read and search tools. disallowedTools: Write, Edit keeps the rest of the tools and turns off the ones that edit files. You can also put permissionMode in the same file, but if the main session is in acceptEdits, auto or bypassPermissions mode, it's ignored and the subagent runs in the main session's mode (sub-agents). It works in the default mode this page recommends.

In tools outside code, permissions come as scopes

In a tool outside code, the table turns into the scopes you grant the account the agent connects with. Scopes are the permission names that say what the tool opens up to that account.

In Slack, reading channel messages needs channels:history, and sending messages as the app is a separate scope, chat:write. In HubSpot, reading and writing contact records are split into crm.objects.contacts.read and crm.objects.contacts.write.

In Google's email scopes, read-only (gmail.readonly) and sending (gmail.send) are separate. The draft scope gmail.compose, though, gives managing drafts and sending email together, so an agent that writes drafts with it can send too. With a tool like that, connect the agent read-only and have it write the draft into an approval queue. A person does the sending.

Where a tool gives read and write in a single scope, don't connect the agent to it at all, or put a person in between.

Common mistakes

The first mistake is writing the ban into the agent's instructions, or into the CLAUDE.md file it reads every session, and treating that as enough. The excessive agency entry in OWASP's list for language model applications asks for the system underneath to decide whether an action is allowed. In Claude Code too, the permission rules are applied by Claude Code itself, whatever the model decides.

Connect the agent through an employee's own account and it works with that person's permissions. A post on Microsoft's security blog says to treat every agent as an identity of its own. Open a separate user or service account for the agent, an account that belongs to an application, then add an Identity column to the table and write the account's name and owner there.

If you give an agent an API key that never expires, the secret it uses to connect to a system, that access stays after the job is done. The same post says temporary access with no end date is permanent access in practice. OWASP also asks for short-lived, narrowly scoped permissions for each task.

The tool docs on this page, and the Anthropic and Microsoft posts, are published by the companies that build those tools or agents. Scope names and plans can change, so check them in your own account before you set anything up.

After you fill in the table

If you don't have a work map yet, first fill in the table in the guide on which work to hand to an agent. The rows for the roles come from the work listed there. The queue that reaches the person in the Who approves column is in the approval gate guide.

If your team writes code, where the settings files live and the /permissions command are in the Claude Code commands guide. To write the CLAUDE.md file there's the CLAUDE.md tool.

If you want to set this up together in your company, the AI-native company page explains how it goes.