Where promptfoo code scanning fits in pull request review
A team shipping LLM features through pull requests needs to catch LLM-specific flaws before merge. Typical examples include a system prompt built by concatenating user input, untrusted content from tickets, emails or web pages reaching a model without boundaries, and model output passed to a shell command, database query or tool call without validation. promptfoo code scanning is the promptfoo feature that reviews application code for these patterns and reports findings on the pull request. The promptfoo documentation describes it alongside LLM evaluation and red teaming, and it can be used from the CLI, as a library or in CI/CD pipelines. Before you rely on it, confirm the current list of checks in the documentation, because the coverage determines what a reviewer can expect to see flagged.
Code scanning and red teaming answer different questions. Code scanning reads the changed code and flags risky patterns without running the application, so it can surface a problem in a branch that no test has exercised yet. A red team scan, covered in the promptfoo red teaming documentation, sends adversarial inputs to a running application or model endpoint and observes what it actually does. Code scanning shows where a flaw could exist, and red teaming shows whether it is exploitable. A team that merges code on scan results alone should plan a red team run against the deployed version, and a team that red teams only before release should expect code scanning to catch changes between test cycles.
The scanning path is separate from the local runs the promptfoo documentation describes, where evals run on your machine and talk directly with the LLM. Code scanning, by contrast, depends on a GitHub App, a GitHub Action or a CLI run that sends code context to a scanning service. Confirm which step in your pipeline makes that call, what repository content leaves your environment, how the promptfoo API key is stored and scoped, and whether your security team accepts that flow for the repositories in scope. Write this data flow down before installation, since it decides whether the scan can run on every repository or only on those cleared for external processing.
Which scanning setup fits your repository
This table compares the three ways to run promptfoo code scanning on pull requests and the two configuration choices that shape review outcomes. Read the option rows to match installation effort and ownership to your repository, then read the configuration rows to decide what reviewers will see. Confirm each named setting against the current promptfoo documentation before rollout, because the exact names and defaults can change between releases.
| Option or setting | Installed or set by | Where it runs or applies | When it fits |
|---|---|---|---|
| GitHub App | A GitHub organization or repository administrator installs it. Confirm the current install steps in the docs. | Uses the promptfoo scanning service. Confirm the endpoints and what code context is sent. | Teams that want pull request review with an admin-managed install and few workflow changes. |
| GitHub Action | The repository owner adds a workflow step, so workflow changes go through code review. | Runs on GitHub Actions runners. Confirm required secrets and token permissions. | Teams that want scan settings versioned in the same repository as the code they protect. |
| promptfoo CLI in a pipeline | The pipeline owner installs promptfoo (Node.js 22.22.0 or newer) and sets authentication. | Runs wherever the command runs, including non-GitHub systems. Confirm the authentication method. | Teams on GitLab, Jenkins or another CI system, or teams that need runs outside GitHub. |
| Severity threshold | Set in scan configuration by the repository or pipeline owner. Confirm the setting name and default. | Applies to all three options. Confirm whether it only filters posted findings or also fails the check. | Start with a threshold reviewers can act on in one pass, then tighten it once findings are routine. |
| Custom guidance | Written by the security owner and kept in the repository. Confirm the supported format and file location. | Applies to all three options. Confirm whether it changes which findings are raised or only how they are described. | Use it to record approved patterns and known false positives specific to your codebase. |
How to install the promptfoo code scanning GitHub App and Action
This sequence connects one GitHub organization to promptfoo code scanning, from account check to a scan comment on a test pull request. It gives you a working pull request scan on one repository before you widen access to the rest of your code.
Confirm the promptfoo account and plan
The account owner signs in to promptfoo and confirms which plan includes code scanning for your organization. The public pricing page lists the Community and Enterprise editions, but it does not settle which tier covers the GitHub App, so ask promptfoo to confirm that in writing before you install anything. Also confirm whether your chosen setup needs an API key and who is allowed to create one. Done when the account shows the organization you plan to connect and the confirmation is on file.
Install the GitHub App on selected repositories
A GitHub organization owner installs the promptfoo code scanning GitHub App from the organization's app settings. Select only the repositories you want to test first. Limiting the first install keeps the trial contained and makes the test pull request easy to find. Review the permissions the app requests, because they control whether it can read code and post comments. Done when the chosen repository appears among the app's installed repositories in GitHub settings.
Store the API key as a secret
If your confirmed setup requires a promptfoo API key, create the key in your promptfoo account and store it as an Actions secret. Use a repository secret for a single-repository trial, or an organization secret if several repositories will share the scan. Give the secret the exact name the workflow expects. Never place the value in workflow files, commits or pull request text. Done when the secret name appears under the Actions secrets list and its value cannot be read back from the settings page.
Add the scan workflow to the repository
Create a workflow file under
.github/workflowsin the test repository and set its trigger to pull requests. Copy the Action reference and inputs from the promptfoo code scanning documentation, and pin the reference to a released version so that changes to the Action do not reach your pipeline unannounced. If the job installs promptfoo through npm, note that release 0.124.1 requires Node.js 22.22.0 or newer, so set that version explicitly in the job. Done when the workflow appears in the Actions tab and a run starts when a pull request is opened.Open a test pull request with a known flaw
Create a branch that adds an illustrative file containing a deliberate LLM flaw, such as a prompt built by joining raw user input into a system instruction. The example is illustrative and exists only for this test. Open a pull request against the default branch and wait for the scan job to finish. Done when the job completes and a review comment appears on the changed line, which shows that the App can read the diff and post feedback.
Review the comment and retire the test
Read the comment and confirm that it points to the line you changed and explains the risk in terms your developers can act on. Close the test pull request without merging and delete the branch. Before you widen the installation, decide on severity thresholds and any custom guidance, which this topic covers separately, and check them with a second test pull request. Done when the test branch is gone and the Actions history shows the run you reviewed.
How a pull request moves through the scanning service
The flow starts when a developer opens or updates a pull request, which sends a GitHub event to the Action or App run. The run collects code context from the diff, and a stored token authenticates the run. The key hand-off is the call from your CI runner to the external scanning service, because code context leaves your network at that point. Check exactly what is included before enabling the scan. Findings return as review comments on the pull request.
Code context leaves the runner; review comments return to the pull request.
What code context leaves your environment
Code scanning sends parts of your repository to the scanning service so it can judge whether a change introduces an LLM flaw. Map each category below before you enable the scan, because each carries a different level of sensitivity and offers a different way to narrow it.
Changed files in the diff
The files a pull request touches are the core input, because a finding has to point at a line that changed. These files often contain new prompt construction, model calls or tool wiring, which is what the scan looks for. Before enabling the scan, list the directories that hold prompts and model integrations, and confirm whether path filters can exclude the rest of the repository.
Surrounding file content
Surrounding context matters because a flaw often depends on code outside the changed lines, such as the function that builds a prompt from user input or the handler that passes model output to a shell. Sending that context lets the scanner follow data across the change. Ask promptfoo whether context is sent as whole files or as narrower units, and whether that scope can be limited for large files.
Repository metadata
Pull request titles, descriptions, branch names, commit messages and author identifiers help the scanner explain a finding and attach its comment to the right change. The same fields can reveal internal project names, ticket numbers and staff identities. Decide which fields your team accepts sharing, and confirm with promptfoo exactly which metadata fields are included in each request.
Configuration and dependency files
Dependency manifests, model provider settings and scan configuration show which LLM SDKs and endpoints the application uses, which changes how a finding should be judged. These files can also contain hostnames, account identifiers or credentials if someone committed them. Exclude environment files and secret stores from the scan, and rotate any credential that already appears in repository history.
Prompts, templates and tool definitions
System prompts, few-shot examples and tool schemas are often the most sensitive text in an LLM application, since they reveal business rules and the actions an agent can take. The scanner needs them to assess injection and excessive agency risks. Confirm whether prompt files are included by default, and whether they can be excluded or placed on a separate, narrower scan path.
Data handling terms in writing
Get the exact data handling terms and retention statements from promptfoo in writing before scanning proprietary code. Ask how long submitted code is stored after a scan, where it is processed, which subprocessors handle it, and whether it is used for model training. If the answers do not fit your policy, ask about the On-Premise edition, which runs on your infrastructure with complete data isolation.
Pricing and editionsHow review comments are posted, updated and resolved
Developers need to know where a finding appears on a pull request, and the team must confirm this for the promptfoo code scanning GitHub App and Action before writing review policy around it. The questions that matter most are whether a finding is attached to the changed line or only posted as a summary, whether a fix pushed in a later commit clears the finding, and whether rerunning the scan on the same pull request creates a duplicate comment. Do not assume the answers. Run a sample repository with a deliberately vulnerable file, push a fix, then push an unrelated change and trigger a rerun. Record what appears after each step.
False positives need their own test. Confirm which roles can dismiss or resolve a finding, whether a dismissal is remembered when the same code is scanned again, and whether it is recorded somewhere a later reviewer or auditor can find it. Also confirm whether a dismissal on one pull request affects others, and what happens when a developer resolves a comment by hand instead of through the scanner. Write the answers down, since a reviewer's decision on a finding is part of the record for that change. If the documentation does not settle a point, ask the vendor before rollout.
Blocking a merge is a separate setup step. Findings can appear as comments without stopping anyone, and the scan only prevents a merge when the team adds it as a required status check in the repository's branch protection settings on GitHub. Your platform or repository administrators own that configuration, and it must be set up on each protected branch. Test it on the sample repository: open a pull request with an open finding, confirm the merge is blocked, then fix or dismiss the finding and confirm the merge unblocks. Also check that the check name you require matches the one the scan reports.
Tuning severity thresholds and custom guidance by team
A security team responsible for a regulated product usually wants findings at or above an agreed severity to fail the check, with lower-severity findings recorded for triage. The threshold should be written into the team's own security policy before the first pull request is gated, so developers see a documented rule rather than an unexplained failure.
- Blocking threshold: Set the severity level that fails the check from your application risk classification and the flaw classes that matter most for the data the product handles.
- Guidance for your context: Add custom guidance that names your authentication model, regulated data classes and approved model providers, so findings reflect how the product really uses them.
- Noise trade-off: A strict gate on a large codebase can hold up unrelated work. Plan an exception path with a named approver and an expiry date for each exception.
- Change control: Route edits to thresholds and guidance through pull requests to a security-owned configuration, with a reviewer outside the product team and a recorded reason for each change.
- Evidence: Keep the guidance version, the threshold in force on each date and the exception log, because assessors will ask how the gate was set and who approved changes.
Confirm with the vendor which severity levels the scanner reports, where the threshold is configured, and whether exceptions are stored in the app or only in the pull request thread.
Teams early in development usually want findings while they are cheap to fix, but a failing check on every pull request slows exploration. An advisory setup posts review comments and leaves the check non-blocking, so the team learns what the scanner flags before any merge decision depends on it.
- Advisory first: Run the scan on pull requests without making it a required status check, so comments appear without holding merges.
- Narrow starting guidance: Begin with guidance tied to features that exist in the codebase, such as prompt construction, tool calls and document retrieval, and widen it after the first batch of comments is triaged.
- Noise control: Expect early false positives in prompt templates and test fixtures. Mark them as accepted in the review thread with a short reason so the same comment does not return on every push.
- Promotion criteria: Agree before launch what moves the check to blocking, such as a run of comments the team has consistently accepted as valid, and name the person who makes that call.
- Ownership: Assign one engineer to triage advisory comments each week, so the output does not drift into comments nobody reads.
Check how the scanner treats comments on re-pushed commits and whether a resolved thread stays suppressed after later changes to the same lines.
A platform team usually owns one guidance baseline that many repositories inherit, along with the deployment of the scanner itself. The main risk is a local override that quietly weakens the shared baseline, so the design should separate a central set of checks from team-level additions.
- Central baseline: Maintain a shared guidance file that every repository must include, covering the flaw classes your organization has committed to test.
- Team additions: Let product teams add context for their own code, and require that additions extend the baseline instead of removing central checks.
- Access control: If you need per-team permissions, note that the paid promptfoo pricing Enterprise edition lists teams-based access control, SSO and custom roles and permissions. Confirm with the vendor whether these apply to the code scanning GitHub App.
- Staged rollout: Apply new guidance to a pilot set of repositories first and compare comment volume and accepted findings before a wide change.
- Versioning: Tag each guidance version and record which version every repository pins, so a past result can be reproduced during an audit.
Ask the vendor how shared guidance is distributed across repositories and whether a central owner can enforce a baseline without repository administrators being able to edit it.
Securing the GitHub App, tokens and runner environment
Treat the GitHub App and the workflow as privileged access to your code, and verify each control before the first scan runs. Compare the permissions shown on the app's installation screen with what the scanning setup documentation says it needs, and record who approved them and why. Confirm whether the app can read code only or can also write comments and checks, since review comments depend on write access to pull requests. Install the app on selected repositories rather than the whole organization, and check that the installation list matches the repositories in scope. Repeat this review whenever the app asks for new permissions after an update.
The promptfoo API key should live only in the CI system's encrypted secret store, scoped to the repository or environment that runs the scan, and never in the workflow file or a committed .env file. Restrict who can edit .github/workflows with a CODEOWNERS entry and branch protection, because a changed workflow can print or send the key. For forked pull requests, confirm which event type the workflow uses. Under the standard pull_request event, GitHub does not pass repository secrets to fork code. A pull_request_target trigger runs with base-branch secrets, so it must never check out and execute untrusted head code. Test this with a fork pull request from a test account before relying on it.
Verify the runner's logs and credential lifecycle as part of the setup, not after an incident. Confirm that the CI system masks the API key in logs and that no step echoes environment variables, and check whether scan output that quotes code snippets is stored in build logs. Set the log retention period for the pipeline to match your data handling policy, and confirm who can download artifacts. Assign a named owner for the promptfoo key and for the GitHub App, and rotate the key on a schedule and after any staff change or suspected exposure. After each rotation, run one scan to confirm the new key works and the old one has been revoked.
Limits to confirm before rollout
The promptfoo code scanning feature depends on a scanning service and on how your repositories reach it, so several limits sit outside the open-source license. Each item below needs written confirmation from promptfoo before you commit a pull request workflow to it.
Regional and network availability
Confirm whether the code scanning service is available in the region where your organization hosts its repositories and CI runners. Ask which endpoints the GitHub App and Action must reach, and whether traffic can pass through your egress proxy or allowlist. A blocked outbound path will stop scans on every pull request, so test it from the same runner pool your builds use.
Supported languages and frameworks
Ask promptfoo for the exact list of languages, frameworks and LLM SDKs the scanner recognizes for LLM-specific flaws such as prompt construction and unsafe tool wiring. A repository written in a language outside that list may pass with no findings. Run a seeded test change in each main language before you treat a clean result as coverage.
Repository and diff size limits
Ask what maximum repository size, file count and pull request diff size the scanner accepts, and what happens when a limit is exceeded. Find out whether oversized diffs are skipped silently or reported as a failed check. Large monorepos may need path filters, so confirm that these are supported before you design the workflow.
Self-hosted and air-gapped options
Confirm whether code scanning can run without the hosted scanning service, either on your own infrastructure or in an air-gapped network. The open-source CLI and the self-hosted app are documented separately, so do not assume that either one performs the same analysis as the hosted service. If your policy forbids sending source code outside your boundary, get that answer in writing before any pilot.
Self-hosting docsCommunity and Enterprise differences
Confirm which code scanning capabilities are included in the free Community edition and which require Enterprise, including team sharing, access control, SSO and remediation recommendations. Ask whether review comment history and scan results are visible to all repository members or limited by role. Request the tier comparison as a written statement that names this feature.
Pricing pageFeature stability across releases
The core tool is MIT-licensed and ships frequently, so a pinned CLI version does not guarantee that the GitHub App or Action behaves the same way. Ask promptfoo how breaking changes to scan output, severity mapping and comment formats are announced, and how long older action versions remain supported. Pin the Action to a reviewed version and retest after each upgrade.
Release notesWhat buyers ask before scanning pull requests
How much effort do installation and tuning take for promptfoo code scanning?
Installation is usually the smaller share of the work, and tuning drives most of the effort. Installing the GitHub App and adding the Action to a workflow is a short configuration task for someone who already administers the repository. Effort rises with the number of repositories, the languages and frameworks in them, and how many findings reviewers see in the first weeks. Each repository needs decisions on severity thresholds, custom guidance that reflects your own LLM code patterns, and how review comments are handled. Confirm the setup steps, configuration options and current limits in the promptfoo documentation before you estimate effort for your estate. DeployOpen does not publish prices. A quote follows a written scope that lists repositories, pipelines and review rules.
Can our own engineers set up promptfoo code scanning without outside help?
Yes. A platform or security engineer with GitHub administrator rights can install the App and add the Action to a pilot repository without outside help. The harder part is agreeing policy: who sets the severity level that blocks a merge, which findings are advisory, and who triages false positives. Teams often stall when no one owns those decisions across repositories. Outside help is useful when the rollout must cover many repositories, when pipeline and secrets handling must match an internal review standard, or when you need documented evidence of the configuration for an assessment. DeployOpen implements, customizes and documents such rollouts in infrastructure you control, under a written, fixed scope. Ask your team to record owners and thresholds before the first pull request runs.
What does the rollout need from our GitHub admins, secrets team and reviewers?
Three groups are involved. GitHub organization or repository administrators install the App and grant it access to the chosen repositories. Your secrets owners provide any credential the Action needs and store it in your approved secrets manager or GitHub encrypted secrets, scoped to the repositories that use it. Reviewers decide how findings appear and which ones block a merge. You also need a sample repository with representative code, such as an application that calls a model, so the team can test thresholds without touching production branches. Confirm the permissions the App requests and where the credential must be stored in the current documentation. Agree in advance who can change workflow files, because a change to the Action configuration affects every pull request that runs it.
What recurring work follows after the first scans run?
Recurring work is mostly operational. Threshold reviews matter most: as the codebase and team change, a severity level that suited the pilot may block too much or too little. Triage of review comments continues, and repeated false positives should feed back into custom guidance. Upgrades need attention because promptfoo is released regularly. The npm release 0.124.1, published on 8 October 2026, requires Node.js 22.22.0 or newer, so runner images and Node versions must be checked whenever you upgrade. Credential rotation and access reviews for the App also recur. Assign an owner, set a review cadence, and record the promptfoo version each workflow installs. DeployOpen offers ongoing support, upgrades and continuous testing as retainers if you prefer to hand this work over.
Does our source code leave our network when pull requests are scanned?
The answer depends on which part of promptfoo you use, so confirm it before approval. The promptfoo documentation states that the software runs completely locally, so evals run on your machine and talk directly with the LLM. Code scanning works differently because it sends code context to a scanning service, and your security team must review that flow. Ask promptfoo which files, diff hunks or metadata are sent, whether full repositories are included, where processing happens, how long data is retained, and whether any data is used for training. Compare the answers with your data classification policy and the sensitivity of each repository. If the answers do not fit your policy, ask whether an On-Premise deployment covers the scanning you need. DeployOpen can review the configuration and document the data flow as part of a written scope.
How do Enterprise and On-Premise pricing relate to code scanning?
The Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Enterprise adds team sharing, teams-based access control and SSO, custom roles, continuous monitoring, a centralized guardrail dashboard, remediation recommendations and priority support with SLAs, at custom pricing. Enterprise On-Premise runs that functionality on your infrastructure with complete data isolation and a dedicated deployment engineer. The promptfoo pricing page does not state which tier includes code scanning, so confirm that before budgeting. Ask for the tier, the metrics used for pricing, renewal terms and whether support is included. DeployOpen does not publish prices, and its quotes follow a written scope covering the work it performs.
Will DeployOpen install and tune this for us, and how is it quoted?
DeployOpen can plan, implement and document a promptfoo code scanning rollout in your GitHub environment as a fixed-scope engagement. The written scope usually names the repositories, the pipeline changes, the severity and comment rules, the sample repository used for testing, the handover documentation and what is excluded. DeployOpen does not publish a price list. A quote follows from that written scope, so the number of repositories, the integrations involved and your review process are the main inputs. Recurring work such as threshold reviews, upgrades and continuous testing can be covered by a retainer. Whichever provider you consider, ask for the deliverables, the owner on each side, the acceptance criteria and the handover steps before you compare quotes.
How DeployOpen scopes and delivers promptfoo code scanning
DeployOpen approaches pull request scanning for LLM vulnerabilities as a scoped piece of work inside your own delivery pipeline. We start from your repositories, your review process and your data rules, then agree in writing what gets installed, configured, tested and handed over. The result is a scanning setup your engineers and security reviewers can operate after the engagement ends.
How we scope
- Inventory the repositories, branches and pull request workflows that should be covered by LLM code scanning.
- Agree which code context may leave your environment and document the data handling position for your reviewers.
- Set severity thresholds, blocking rules and custom guidance in a written scope before any change is made.
How we build
- Install the promptfoo code scanning GitHub App and Action in the repositories defined in the scope.
- Configure workflow permissions, secrets handling and review comment behavior according to your access model.
- Test the setup on representative pull requests, including seeded LLM flaws, to confirm findings and blocking behavior.
How we hand over
- Deliver a written configuration record covering thresholds, custom guidance, data flow and repository coverage.
- Document how reviewers should triage, dismiss or fix review comments, and who owns each decision.
- Walk your engineering and security teams through the setup and the runbook for changes and exceptions.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer once the initial scope is delivered.
- Review changes to the scanning configuration when repositories, models or pipeline standards change.
- Confirm with your team which support terms, response expectations and upgrade cadence apply before signing.

