The PromptGuard Security Gate is a GitHub Action that runs automated red team tests against your security configuration on every pull request, ensuring security regressions are caught before merge.
Quick Start
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
api-key | Yes | — | PromptGuard API key |
project-id | Yes | — | PromptGuard project ID |
api-url | No | https://api.promptguard.co | API base URL |
min-grade | No | B | Minimum acceptable grade (A, B, C, D, F) |
fail-on-regression | No | true | Fail if grade drops below baseline |
comment | No | true | Post results as PR comment |
budget | No | 100 | Red team iteration count |
Outputs
| Output | Description |
|---|---|
grade | Security grade (A through F) |
score | Numeric score (0—100) |
bypasses-found | Number of bypasses discovered |
report | Full JSON report |
How It Works
- Calls the PromptGuard Red Team API with your project’s configuration
- Parses the response (grade, passed/failed vectors, score)
- Posts a PR comment with a summary table (if
comment: true) - Fails the check if grade is below
min-grade - Compares against baseline if
fail-on-regression: true
PR Comment
Whencomment: true, the action posts a summary on the PR:
| Metric | Value |
|---|---|
| Grade | B |
| Score | 84/100 |
| Bypasses | 4 |
| Block Rate | 92% |
Using Outputs in Workflows
Grading Scale
| Grade | Block Rate | Assessment |
|---|---|---|
| A | >= 95% | Excellent security posture |
| B | >= 85% | Good, minor improvements possible |
| C | >= 70% | Acceptable, review failing test cases |
| D | >= 50% | Poor, significant gaps detected |
| F | < 50% | Critical, immediate action required |
GitLab CI
CircleCI
Generic CLI (any CI)
For any CI system, use the PromptGuard CLI directly:Best Practices
- Start with grade B: A reasonable minimum for most applications
- Enable regression detection: Catch security degradation early
- Run on every PR: Make security testing part of the development workflow
- Review PR comments: Understand which attack vectors pass through
- Combine with policy-as-code: Version your security config alongside your application
Next Steps
Red Team API
API reference for red team testing
CLI Tool
Run security tests from the command line
Policy-as-Code
Version your security configuration