Tools define actual capability

A role describes a subagent’s purpose, but its tool list defines what it can actually do. A textual prohibition such as “do not change production code” does not replace a technical limit when the agent still has Edit or Write.

Start with the minimum profile: grant only the tools required for the specific result.

LayerWhat it controlsExample
L1 — sessionMaximum available actionsRead-only or full permissions
L2 — subagentTools for one roleReviewer has Read and Grep without Edit
L3 — projectTeam rules and directoriesTester writes only in tests/

Tool risks

ToolValueControl
ReadInspect filesAllowed directories and sensitive data
GrepSearch code and configurationSearch width and secret exposure
BashTests, build, diagnosticsCommands, side effects, stop conditions
EditChange filesWrite boundary and explicit permission

Role profiles

Conceptual permission matrix
reviewer:   Read, Grep, Bash(read-only checks)
tester:     Read, Grep, Bash, Edit(tests only)
documenter: Read, Grep, Edit(docs only)
db-analyst: Read, Grep

Rule: if a role does not use a tool, do not add it “just in case”.

Design the permission set

  1. Name the expected result.
  2. List the minimum actions needed.
  3. Assess the consequence of misuse for each tool.
  4. Remove unnecessary permissions.
  5. Give Edit explicit directory or file-type boundaries.
  6. Check whether the agent can escape the task scope.

Canonical lesson source · JavaRush

Open JavaRush material