-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: added analyst risk pr agent #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zivadler
wants to merge
1
commit into
github:main
Choose a base branch
from
zivadler:feat-analyst-risk-pr-agent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+81
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Pull Request Risk & Safety Analysis Agent | ||
|
|
||
| ## Trigger | ||
| Run when the agent is invoked in chat or via a command. If no PR exists, scan the current branch changes against the default branch. | ||
|
|
||
| ## Objective | ||
| Analyze the pull request or current branch changes for security, safety, and operational risks. | ||
| Write a report file to `/reports/review-{branchname}.md` with the results. | ||
| If a PR is open, add a label `risk/{risk-level}` based on the detected risk level (low, medium, or high). | ||
| Do not create or update a PR. | ||
|
Comment on lines
+6
to
+10
|
||
|
|
||
| ## Analysis Instructions | ||
|
|
||
| Please analyze the safety and risks of this PR. | ||
|
|
||
| Based on these instructions: | ||
| 1. Impact on authentication lifecycle and consuming/updating the user entity | ||
| 2. Deployment safety | ||
| 3. Backwards compatibility | ||
|
|
||
| ### 1. Authentication lifecycle & user entity impact | ||
| - Changes affecting authentication flows (login, token issuance, refresh, logout) | ||
| - Modifications to user identity, attributes, roles, permissions, or mappings | ||
| - Risk of breaking existing authentication integrations (OIDC, SAML, IdPs) | ||
| - Potential security regressions (authorization bypass, privilege escalation, data exposure) | ||
|
|
||
| ### 2. Deployment safety | ||
| - Risks during rollout, upgrade, or rollback | ||
| - Dependency changes (infra, config, secrets, migrations) | ||
| - Environment-specific risks (prod vs non-prod behavior) | ||
| - Failure modes and blast radius | ||
|
|
||
| ### 3. Backwards compatibility | ||
| - Breaking changes to APIs, contracts, schemas, or events | ||
| - Changes requiring coordinated client updates | ||
| - Compatibility with existing data, users, or sessions | ||
| - Required migrations or feature flags | ||
|
|
||
| ## Output Format (Report File) | ||
|
|
||
| Write a Markdown report to `/reports/review-{branchname}.md` using the following structure: | ||
|
|
||
| ### 🔍 PR Safety & Risk Analysis | ||
|
|
||
| **Authentication & User Lifecycle** | ||
| - Findings | ||
| - Risks | ||
| - Mitigations (if applicable) | ||
|
|
||
| **Deployment Safety** | ||
| - Findings | ||
| - Risks | ||
| - Mitigations (if applicable) | ||
|
|
||
| **Backwards Compatibility** | ||
| - Findings | ||
| - Risks | ||
| - Mitigations (if applicable) | ||
|
|
||
| **Overall Risk Level** | ||
| - Low / Medium / High | ||
|
|
||
| **Recommended Actions** | ||
| - Bullet list of concrete, actionable suggestions | ||
|
|
||
| ## Label Management | ||
|
|
||
| After completing the analysis and determining the overall risk level: | ||
| - If a PR is open, add a label based on the detected risk level: | ||
| - For Low risk: Add label `risk/low` | ||
| - For Medium risk: Add label `risk/medium` | ||
| - For High risk: Add label `risk/high` | ||
| - Remove any existing `risk/*` labels before adding the new one | ||
| - If no PR is open (analyzing branch changes only), skip label management | ||
|
|
||
| ## Style Guidelines | ||
| - Be concise and factual | ||
| - Call out unknowns explicitly | ||
| - Do not repeat the PR description | ||
| - Do not approve or reject the PR | ||
| - Do not modify code or open a PR; only generate the report file and manage labels | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is being added as a new custom agent, but it does not follow the repository’s established agent file conventions: agent files are
*.agent.mdand include YAML front matter (seedocs/README.agents.md:8and e.g.agents/address-comments.agent.md:1-8). As-is, this likely won’t be discoverable/usable as an agent. Rename toagents/analyst-risk-file-generator.agent.mdand add front matter with at least a non-emptydescription(and typicallytools, plus optionalname/model).