e-volv

Security playbook

PermissionEscalationDetector

Watches privilege changes in IAM, Kubernetes roles, and permission enums, routing any widening change through an owner approval gate.

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 requestpull_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.

  1. 01
    PR Openedtrigger

    The event that starts the run.

  2. 02
    Clone Repositorygit.clone

    Shallow-clones the repository at the right ref.

  3. 03
    Detect Permission Escalationsagent.run

    One agent works the task with its toolkit.

  4. 04
    Owner Approval for Widened Permissionsapproval.gate

    Pauses the run until a human decides.

  5. 05
    Publish Approved Decision Recordreport.publish

    Posts or updates a deduplicated report comment.

  6. 06
    Record Rejectionagent.run

    One agent works the task with its toolkit.

  7. 07
    Publish Rejection Noticereport.publish

    Posts 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