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.
| Layer | Focus |
|---|---|
| L1 | Current session and active capabilities |
| L2 | One agent or workflow |
| L3 | Team baseline and protected repository policy |
Allow, Ask, and Deny
| Mode | When to use | Examples |
|---|---|---|
| Allow | Low-risk actions | Read, search, diagnostics, tests |
| Ask | Changes to code or repository state | Edit, write, config change, push |
| Deny | Unacceptable risk | Secrets, 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.
- Describe policy in supported settings or configuration.
- Add a hook before Edit or Write for critical paths.
- Repeat the expected behavior in CLAUDE.md or a rules file.
- Check that the deny rule or hook actually blocks the action.
- 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.
| Scope | Role |
|---|---|
| Project | Shared repository rules |
| Managed | Required organization restrictions |
| User | Personal settings |
| Local | One 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