OpenCoze
Back to template library

Automated AI-Powered PR Security Review Workflow

DevelopmentCozeUpdated 2026-04-15

Automatically trigger on GitHub PR creation, run the GitHub Secure Code Game AI agent to scan for AI security vulnerabilities, post a detailed report as a PR comment, and optionally block merge if critical issues are found.

System Prompt
When a pull request is opened on {repo_url} branch {branch_name} as PR #{pr_number}, run the AI security scan using {ai_model} and post the findings to the PR.

Variable Dictionary (fill in your AI tool)

This section only explains placeholders. It is not an input form on this website. Copy the prompt, then replace variables in Coze / Dify / ChatGPT.

{repo_url}

GitHub repository URL

Filling hint: replace this with your real business context.

{branch_name}

Branch name where the PR was opened

Filling hint: replace this with your real business context.

{pr_number}

Pull request number

Filling hint: replace this with your real business context.

{ai_model}

AI model used for scanning

Filling hint: replace this with your real business context.

Quick Variable Filler (Optional)

Fill variables below to generate a ready-to-run prompt in your browser.

{repo_url}

GitHub repository URL

{branch_name}

Branch name where the PR was opened

{pr_number}

Pull request number

{ai_model}

AI model used for scanning

Generated Prompt Preview

Missing: 4
When a pull request is opened on {repo_url} branch {branch_name} as PR #{pr_number}, run the AI security scan using {ai_model} and post the findings to the PR.

How to Use This Template

Best for

Teams that need faster development output with more stable prompt quality.

Problem it solves

Reduces blank-page time, missing constraints, and inconsistent output structure from ad-hoc prompting.

Steps

  1. Copy the template prompt.
  2. Paste it into your AI tool (Coze / Dify / ChatGPT).
  3. Replace placeholder variables using the dictionary above.
  4. Run and refine constraints based on output quality.

Not ideal when

You need live web retrieval, database writes, or multi-step tool orchestration. Use full workflow automation for that.

Success Case

Input:
repo_url=https://github.com/example/repo, branch_name=main, pr_number=42, ai_model=OpenAI-GPT-4
Output:
Comment posted on PR #42: - 3 AI security vulnerabilities found - Critical: Unauthorized access - Fix: Add access control

Boundary Case

Input:
repo_url=invalid, branch_name=main, pr_number=42, ai_model=OpenAI-GPT-4
Fix:
Verify that repo_url is correct and accessible.

What to Try Next

Keep exploring with similar templates and matching tools.

Continue Where You Left Off

No recent items yet.

Workflow Steps

  1. 1. Listen for PR open event

  2. 2. Clone {repo_url} and checkout {branch_name}

  3. 3. Run GitHub Secure Code Game AI agent with {ai_model} to scan the code

  4. 4. Parse scan results and generate a security report

  5. 5. Post a comment on PR #{pr_number} with the findings and remediation suggestions

  6. 6. If critical vulnerabilities are detected, fail the CI to block the merge

Constraints

  • Repository size exceeds 500MB, causing long clone times
  • Network latency over 30 seconds, causing AI agent timeout
  • AI model quota exhausted

Explore More in This Category

Development

Recommended Stack

Tools that work well with this template.

Coze

Official site

Low-code agent workflow platform for fast automation delivery.

Open

OpenAI

Official site

General LLM platform for generation, analysis, and development use cases.

Open