Approve protected changes
An agent that hits a protected path stops and asks you for a grant. A grant lifts one kind of check, for one session, until it expires.
Grant access for a session
Section titled “Grant access for a session”-
Read the agent’s reason. Decide which scope it needs:
Scope Lets the session protectededit and publish paths CODEOWNERS owns (the PR still needs code-owner review) no-verifypublish without running the repository’s git hooks mergerun graft pr mergepast the local merge policy (base, protected paths, red base), andgraft publishonto a base outsidemergeableBases -
In that Claude Code session, type:
Terminal window ! graft maintainer grant "why this session needs it" --scope protectedFrom another terminal, name the session:
--session <id>. The refusal the agent showed you prints the id. -
If the default 4 hours is wrong, add
--hours N(at most 24).
A grant the agent runs itself is refused. Every grant is logged in .git/graft/maintainer.log.
Check or end a grant
Section titled “Check or end a grant”graft maintainer status # every session's grantgraft maintainer revoke # this session'sgraft maintainer revoke --session <id>Approve a PR that touches protected paths
Section titled “Approve a PR that touches protected paths”- Review the PR on GitHub and approve it as an individual code owner of every protected path in it.
- The agent’s
graft pr mergethen goes through, naming you as approver. No grant needed.
If the paths are owned only by a team, or protected only by protected.extra in .graft.json, merge the PR yourself.
Apply a workflow change
Section titled “Apply a workflow change”The App cannot write .github/workflows/**, and no grant changes that. Apply the patch the agent describes yourself and commit it the normal way.
Protect another path
Section titled “Protect another path”Add it to CODEOWNERS with an owner, or to protected.extra in .graft.json. Both files are themselves protected. Check what is protected and why:
graft protected path/to/fileBackground: The boundary and the tripwires.