Watches for pull requests that change any privilege definition — infrastructure IAM, Kubernetes Role/ClusterRole/RoleBinding, role/permission enums in application code, and workspace membership logic — and classifies each change as widening, narrowing, or neutral. Any widening change raises an approval request for the workspace owner with the diff and a plain-language description of exactly who can now do what they could not before. Narrowing and neutral changes pass through with a comment recording the classification.
- Identifier
permission-escalation-detector- Version
- 1.0.0
- Steps
- 7
- Triggers
- 1
- security
- permissions
- iam
- approval
- governance
- pull-request
When it runs
pull_request.opened- Settle delay
- 20s after the event
Only when all hold
- pullRequest.isDraft not equals true
- actor.username not in dependabot, dependabot[bot], renovate, renovate[bot], github-actions, github-actions[bot]
- actor.username not contains [bot]
The pipeline
The graph below is the one the workflow opens with in the builder — same steps, same layout, drawn on the same canvas. The run playing through it is a simulation; the branches and conditions are real.
- 01PR Opened
triggerThe event that starts the run.
- 02Clone Repository
git.cloneShallow-clones the repository at the right ref.
- 03Detect Permission Escalations
agent.runOne agent works the task with its toolkit.
- 04Owner Approval for Widened Permissions
approval.gatePauses the run until a human decides.
- 05Publish Approved Decision Record
report.publishPosts or updates a deduplicated report comment.
- 06Record Rejection
agent.runOne agent works the task with its toolkit.
- 07Publish Rejection Notice
report.publishPosts or updates a deduplicated report comment.
Branches
- approval_gate to report_rejection: runs only if the step above failed, was rejected, or timed out
The agent
Permission Escalation Detector
- Base type
- Code Reviewer
- Temperature
- 0.2
- Max iterations
- 30
- Tools
- 4
Git provider · 1
get_pull_request_diffGet Pull Request Diff · read
Filesystem · 1
read_fileRead File · read
Code search · 1
code_searchCode Search · read
Status · 1
update_statusUpdate Status · write
Related playbooks
Auth Surface Diff
Compares the authentication and authorization surface of every route before and after a PR, flagging any route that gained public reachability.
SAST Triage
Fires when a SAST workflow completes and triages each finding against the actual code, posting confirmed findings as inline review threads.
Dependency Bump
Weekly PRs that update dependencies to their latest in-range minor and patch versions.