L3 is the team permission baseline

L3 defines rules for the repository and team. It does not depend on one developer or agent. If L3 forbids editing payments/**, a local session permission must not override it.

L1 describes the current session, L2 describes an agent or workflow, and L3 describes shared project policy. These layers constrain one another; they do not replace one another.

LayerFocus
L1Current session and active capabilities
L2One agent or workflow
L3Team baseline and protected repository policy

Allow, Ask, and Deny

ModeWhen to useExamples
AllowLow-risk actionsRead, search, diagnostics, tests
AskChanges to code or repository stateEdit, write, config change, push
DenyUnacceptable riskSecrets, destructive commands, protected paths, force push

Protected paths and enforcement

  • payments/** for financial operations and payment integrations.
  • migrations/** for data-structure changes that may be irreversible.
  • .env* for keys, tokens, and environment configuration.
  • infra/** for deployment, access, and infrastructure.
  1. Describe policy in supported settings or configuration.
  2. Add a hook before Edit or Write for critical paths.
  3. Repeat the expected behavior in CLAUDE.md or a rules file.
  4. Check that the deny rule or hook actually blocks the action.
  5. Keep an audit trail for access attempts and approvals.

Where to store policy

Critical prohibitions should not live only in user or local settings. At the same time, an oversized deny zone encourages people to work around the system.

ScopeRole
ProjectShared repository rules
ManagedRequired organization restrictions
UserPersonal settings
LocalOne working-copy parameter

Check the L3 boundary

  • Does policy apply consistently to different sessions and agents?
  • Is there an Ask step for changes outside the working area?
  • Are secrets, destructive commands, and force push blocked?
  • Does protection rely on more than CLAUDE.md text?
  • Are permissions documented for scheduled workflows and review?

Canonical lesson source · JavaRush

Open JavaRush material