GitHub Integration
Install the ZeroLeaks GitHub App, auto-scan PRs that modify prompt files, and trigger scans with @zeroleaks.
GitHub Integration
ZeroLeaks integrates with GitHub via a GitHub App. You can:
- Auto-scan pull requests that modify prompt files
- Trigger scans on demand by commenting
@zeroleakson a PR - Receive scan results as PR comments and commit status checks
Install the GitHub App
- Go to Settings > GitHub in the ZeroLeaks dashboard
- Click Install GitHub App or Connect
- Authenticate with GitHub and select the organization or user
- Choose which repositories to grant access to
- Complete the installation
The app will receive webhooks for repository events (PRs, issue comments, review comments).
Configure Repositories
For each repository you want to scan:
- Add the repo in ZeroLeaks Settings > GitHub
- Set the prompt path: The file path that contains your system prompt (e.g.,
src/prompts/system.txt,config/agent.md). The app uses this to detect when PRs touch prompt-related files. - Choose scan type: Full, extraction, or injection
- Optional: For sandbox mode, configure tool definitions or enable auto-detection
Only PRs that change files under the prompt path (or the configured path) trigger auto-scans. Other PRs are ignored unless you use the manual trigger.
Auto-Scan on PR
When a PR is opened, synchronized (new commits pushed), or reopened:
-
The webhook checks if any changed files match the prompt path
-
If yes, the app fetches the prompt content from the PR head commit (using AI extraction for code files)
-
A scan is queued with the configured scan mode
-
When the scan completes, results are posted as a PR comment
-
A commit status is set on the PR head (e.g., success, failure, or warning)
If the prompt path is not configured, or no prompt files changed, no scan runs.
Trigger with @zeroleaks
You can trigger a scan manually by mentioning @zeroleaks in a PR comment or review comment:
- PR comment: Add a comment on the PR that includes
@zeroleaks(and optionallyscanor similar) - Review comment: Add a review comment on a code line that includes
@zeroleaks
The webhook detects the mention and queues a scan for that PR. The scan uses the prompt from the PR head commit. Results are posted as a reply or follow-up comment.
Scan Results Posted to PR
When a scan completes:
-
PR comment: A formatted comment is added with:
- Overall score and vulnerability level
- Extraction findings count
- Injection success/blocked counts
- Link to the full report on ZeroLeaks
-
Commit status: The status is set on the PR head commit:
- Success: Score indicates secure or low risk
- Failure: Score indicates high or critical risk
- Warning: Score indicates medium risk
The status description includes the score and a brief message (e.g., "Security scan passed (85/100)").
Sandbox vs. Non-Sandbox
- Sandbox mode: Runs in the Railway worker with full tool execution. Requires the worker to be deployed. Results include tool call logs, canary exposure, and kill chains. All GitHub-triggered scans run in sandbox mode. Check the dashboard for scan progress and results.