Assessing foundation model security with promptfoo before you build on it
Run promptfoo against a foundation or fine-tuned model before your team builds an application on it, and record the results as the security baseline for that model version. promptfoo answers two different questions here: a red team scan against the live model shows how the model behaves under adversarial prompts, and static scanning of the model weights shows whether the files themselves contain code or structures that could run when loaded. Neither check replaces the other. A model can pass behavioural tests and still ship a malicious pickle file, and a clean file can still produce unsafe answers under prompt injection.
Be clear about what each check does to your environment. promptfoo is licensed under the MIT license, and its documentation states that it runs completely locally: evals run on your machine and talk directly with the LLM. That local execution does not make live scans private. Red team scans against a live model send inference requests to the model provider's API, so the provider receives your test prompts and bills for the calls. Confirm with the provider which data retention and logging terms apply to those requests before you run scans against production-like configurations. Static scanning of weights, by contrast, reads the files locally and sends no inference traffic.
Decide before you start what the baseline must cover and who signs it off. A useful record names the exact model identifier and version, the date of each scan, the promptfoo version used, the red team plugins and strategies applied, and the findings with their dispositions. Plan to repeat both checks when the provider changes the model behind an alias or when you move to a new fine-tune, since the earlier results no longer describe what you are running. The promptfoo red teaming documentation lists the frameworks it maps to, including the OWASP LLM Top 10, which gives reviewers a shared vocabulary for the findings.
What each check covers and what it cannot see
Live red team scans send adversarial prompts to the model through its provider API and grade the responses. They test how the deployed model behaves under attack, which is something a file inspection cannot reveal. The scans need network access from the machine running promptfoo to the provider endpoint, valid API credentials, and enough request budget to run the probe set. Each probe is an inference request, so the provider bills for them and the endpoint must accept the volume.
- What it tests: prompt injection and jailbreak resistance (OWASP LLM01), sensitive information disclosure (LLM02), and improper output handling patterns that can be reached through model responses (LLM10).
- What it needs: provider API keys, outbound access to the endpoint, and a configuration naming the model under test. Scans run locally and talk directly to the model.
- What it misses: weights that were tampered with in ways the tested behavior does not expose, backdoors that need a trigger the probe set does not contain, and risks in the surrounding application such as tool permissions.
- Scope limits: a scan covers the model as configured on the day it runs. Provider-side model updates can change results, so the baseline needs a date and version record.
Before relying on results, confirm with the provider which model version the endpoint serves and what data the provider retains from the requests.
Static scanning with ModelAudit inspects model artifacts without loading them into a runtime. It looks for content that can run code or carry unsafe structure, which matters most for formats that execute on load. It needs read access to the model files, either local or in the storage where they sit, and it does not need inference access. It can be run before any model is loaded into a notebook, serving stack or application.
- What it tests: the contents of model files for supply chain risk (OWASP LLM04) and tampering that could affect the model at load time (LLM05), including code-carrying constructs in serialized formats.
- What it needs: file access to the weights and any tokenizer or config files, and enough disk and memory to inspect large artifacts.
- What it misses: behavior. A clean file scan does not show that the weights answer safely, so it cannot detect a backdoor that only changes outputs for a trigger phrase.
- Format limits: safer formats reduce code-execution risk at load time, but a scan still checks the surrounding files and metadata.
- Adversary context: MITRE ATLAS tracks techniques for compromising AI supply chains. Map findings to the relevant entries in the ATLAS v2026.09 release, which the team should review directly.
Confirm with the model supplier which file formats and provenance records they can provide before the scan begins.
The two checks answer different questions, and the gaps between them shape what a baseline can claim. A red team scan answers whether the model resists specific attacks as served today. A static scan answers whether the files are safe to load. Neither answers whether the application built on the model is safe, because tool access, retrieval sources and agent permissions sit outside both checks.
- Excessive agency (LLM03): neither check covers it fully. Red team probes can surface unsafe actions only if the target exposes tools, and a model scan cannot see permissions at all.
- Poisoning (LLM05): behavioral probes may catch some effects of poisoning, and file scans may catch some tampering, but a poisoned model with a narrow trigger can pass both.
- Agentic risks: the OWASP Top 10 for Agentic Applications, such as ASI01 Agent Goal Hijack and ASI03 Identity and Privilege Abuse, need testing of the full agent setup, not the bare model.
- Evidence: keep the scan outputs, versions and dates together so a reviewer can see what each check covered.
Ask your security team which of these gaps they will close with separate application or agent testing.
How the baseline assessment flows from intake to decision
The assessment starts when a candidate foundation or fine-tuned model enters intake inside the client's infrastructure. Its weight files are statically scanned locally before anything loads them, and the live model is then red teamed through its provider API, which means prompts and responses cross the trust boundary to the external provider. Findings from both paths land in one review, where the reviewer chooses accept, conditional accept or reject. Check that the scan results and probe logs stay inside your environment and that the provider's data handling terms match your requirements.
Baseline assessment from model intake to accept, conditional accept or reject decision.
Which promptfoo edition and scan scope fit this assessment
This table compares the Community, Enterprise and On-Premise editions, and the scan scopes you can choose for a foundation model assessment. Read each row against how often the model provider changes the model behind your endpoint, and who must see the results. The main takeaway is that a one-off baseline needs little beyond the free edition, while recurring rescans and shared evidence push the decision toward paid editions or a self-hosted server with its limits.
| Decision point | Community (free) | Enterprise and On-Premise |
|---|---|---|
| Red team probe allowance | 10k probes per month, per the promptfoo pricing page | Custom pricing; confirm probe allowance in the written quote |
| Team sharing and access control | Not included | Team sharing, teams-based access control, SSO and custom roles |
| Continuous monitoring | Not included | Included in Enterprise; confirm alerting for provider model changes |
| Deployment location | Runs locally on your machine, calling the model API directly | On-Premise runs Enterprise functionality in your infrastructure with a dedicated deployment engineer |
| Support | Community support | Priority support with SLAs, as stated on the pricing page |
| One-off baseline scan | Suitable for a single pre-adoption baseline against a live model | Suitable when results must be shared with reviewers across teams |
| Recurring rescans after provider model changes | Possible through CI or scheduled runs, but results are managed by your team | Continuous monitoring and centralized dashboards reduce manual tracking |
| Self-hosted server (SQLite, no RBAC or SSO) | Not applicable; the local CLI avoids the server limits | Self-hosted open-source server stores data in SQLite, cannot share it across replicas, and is not recommended for production |
How to run the baseline assessment step by step
This sequence turns a model selection into a documented security decision: a stated purpose, static evidence from the weights, live red team evidence from the model as deployed, and a recorded accept or reject outcome with a plan for rescans.
Define the assessment purpose and risk framework
Name the model, the application that will use it, the people who own the decision, and the risks the assessment must cover. Map those risks to the OWASP Top 10 for LLM Applications, the NIST AI Risk Management Framework and the EU AI Act, which promptfoo's red teaming documentation references as frameworks that support systematic testing before deployment. Confirm with your compliance lead which of these apply to your use case. The step is done when a written scope names the model version, the intended use, the frameworks and the accountable approver.
Confirm access and the provider agreement
Decide whether you will assess weights you hold or a hosted model reached through an API. Confirm that your provider agreement, license and data terms allow the planned testing, including the inference requests that red team scans send to the provider API. Ask the provider or your legal team to confirm how prompts and outputs are retained. The step is done when the agreement, license terms and data handling notes are filed with the assessment scope.
Prepare the promptfoo environment
Install promptfoo from npm on a workstation or runner that meets the supplied requirement of Node.js 22.22.0 or newer, which the 0.124.1 release requires. Run the version and help commands to confirm the install, and pin the version in your assessment record. Because promptfoo runs locally and talks directly to the model, keep API keys in environment variables or your secrets store, not in config files. The step is done when the pinned version, Node version and key handling are recorded.
Run static scanning of the model files
Scan the weight files with ModelAudit before anything loads them. Check the formats you received, such as pickle-based files, PyTorch archives, SafeTensors, GGUF or ONNX, and note the license and source of each artifact. Static scanning finds suspicious patterns in files but does not prove a model is safe, so record what it did not examine. The step is done when the scan report is saved with the artifact hashes and a list of flagged items, each marked as resolved, explained or blocking.
Configure and run the red team scan against the live model
Write a promptfoo red team configuration that points at the model endpoint you will actually use, including any system prompt and safety settings. Select plugins that match the scoped risks, such as prompt injection, sensitive information disclosure and improper output handling, and run the scan. Confirm the target is the production-equivalent deployment rather than a demo endpoint, because results are only valid for the configuration tested. The step is done when the scan completes and the results file is saved with the config, plugin list and model identifier.
Review findings and separate model from application risk
Read each failed probe and sort it into a finding about the model, the system prompt, the application or the surrounding controls. A jailbreak that succeeds against a bare model may be contained by an output filter, and that distinction changes the fix. Ask a second reviewer to check a sample of grades, since automated judges can be wrong in both directions. The step is done when every failure has an owner, a category and a proposed mitigation or an accepted risk note.
Record the accept or reject decision
Write the decision against the scope from step one. Summarize the static findings, the red team results, the mitigations in place, the residual risks and the conditions attached to approval, such as restricted tools, data limits or monitoring. Name the approver and the date. The step is done when a signed or approved decision record links to the scan artifacts, and the model version it covers is stated explicitly.
Schedule rescans and watch for change
Set a rescan trigger for each change that can alter behavior: a new model version, a changed system prompt, new tools, a provider-side update or a new weight file. Ask your provider how they notify customers of model changes, and confirm whether your deployment pins a model version. Repeat the static and live scans on each trigger and compare results against the baseline. The step is done when the triggers and owner are written into the operating procedure and the first rescan is booked.
Security and data handling considerations for model assessments
A model assessment sends prompts to a provider, handles provider credentials, and produces evidence that someone will later rely on. Each of the cards below covers one of those points, and together they set the boundaries your security and compliance teams will ask about before a scan runs.
Prompts and responses in transit
Red team scans against a live model send attack prompts to the provider API and receive the model's responses back, so the provider sees every probe and output your scan generates. Before the first run, confirm which provider endpoint, region and account the scan uses, whether that provider's terms allow security testing traffic, and whether your own data appears in any probe. Ask who can read the logs on the provider side.
Foundation models guideProvider key handling
Scans authenticate to the model provider with an API key, which is usually the most valuable credential in the workflow because it carries spending and data access. Store the key in your secrets manager or CI secret store, not in config files committed to a repository, and issue a dedicated key with a spending limit for assessment work. Confirm who can read the key during a run and rotate it after the assessment ends.
Downloaded weights as untrusted input
Model weights from public hubs or third parties can contain code that runs when a file is loaded, particularly pickle-based formats. Treat every downloaded artifact as untrusted until static scanning with ModelAudit has passed and the file has been checked against your intake rules. Load and test the model only after that decision is recorded, and keep the scanned copy as the one you test, so the artifact under test matches the one you approved.
Isolating the scanning workstation
The machine that runs scans holds provider keys, model files and scan output, and it may execute model-loading code during static checks. Run scans on a dedicated host or container with no access to production data, limited outbound network rules to the approved provider endpoints, and no standing administrative rights. Keep model files on a separate volume that is deleted or reset after the assessment unless a retention decision says otherwise.
Retention of scan results and evidence
Scan reports can contain sample prompts, model outputs and sensitive content that an attacker or auditor could reuse. Decide before the first run how long reports, raw logs and transcripts are kept, where they are stored and who can export them. Store only the summaries and findings needed as evidence, and confirm the retention period with your compliance team, since promptfoo's local data storage makes the location of each file your responsibility.
Access control on the self-hosted server
The self-hosted promptfoo server uses a local SQLite database that cannot be shared across replicas and has no RBAC, built-in authentication or SSO, and Docker, Compose and Helm deployments inherit those limits. For a shared team instance, place the server behind your identity-aware proxy or network boundary, restrict it to named users, and record who ran each assessment. If you need SSO, role-based access and multi-instance scaling, confirm with the vendor whether the Enterprise or On-Premise edition covers those requirements.
Self-hosting docsWhich static and behavioural checks catch which model risks
Can a malicious pickle model file run code when it is loaded?
Yes. Pickle-based model files can execute code during deserialization, so a file can do damage before any model inference happens. ModelAudit's static scan inspects pickle opcodes and patterns in pickle, PyTorch ZIP and binary files and flags suspicious constructs before the file is loaded. It cannot prove a file is safe, because a clean result only means no known pattern was found. Ask your team to require safer formats such as SafeTensors from suppliers where possible, and to confirm the scan runs in an isolated environment before any load. This check maps to LLM05 Data and Model Poisoning in the OWASP Top 10 for LLM Applications 2026 and to supply chain risk under LLM04.
Do GGUF, SafeTensors and ONNX models need scanning too?
Yes, these formats are often treated as safe, but they can still carry risk in templates, metadata and custom operators. ModelAudit checks these formats for issues such as unsafe template content, suspicious metadata and custom operators that could run unexpected code. A scan reduces the chance of a bad file entering your environment, but it cannot confirm that a model behaves correctly or contains no hidden backdoor. Behavioural testing of the live model is still needed to address LLM05 Data and Model Poisoning and LLM04 Supply Chain. Confirm with your security team which formats your intake process accepts before you set the scan policy.
Which live scans test prompt injection and jailbreak behaviour?
Red team scans against the live model send adversarial prompts through the model provider API and grade the responses. These scans test prompt injection and jailbreak behaviour, covering LLM01 Prompt Injection in the OWASP 2026 list and the LLM Jailbreak technique (AML.T0054) and indirect prompt injection (AML.T0051.001) in MITRE ATLAS v2026.09. Because promptfoo runs evals locally and calls the model directly, the scan needs inference requests to the provider, which means cost and data flow must be approved. A pass shows the tested probes did not succeed. It does not prove the model resists every attack, and results depend on the plugins, strategies and grading you chose.
How do live scans check for sensitive information disclosure?
Live scans send prompts designed to coax the model into revealing personal data, secrets or training content, and grade whether the response leaks them. This addresses LLM02 Sensitive Information Disclosure and, for system instructions, LLM08 Hidden Context Exposure, which the 2026 edition added. Static scanning cannot catch this risk, because it does not run the model. Note what the scan cannot confirm: it only tests the prompts you include, so leakage triggered by real user data, retrieval sources or downstream tools may remain untested. Ask your team to define which data classes count as sensitive before you set grading rules.
How can a provider's silent model update change my security results?
A provider can change a hosted model without notice, which can alter behaviour that a previous scan approved. Repeating live red team scans on a schedule, and keeping a dated baseline of results, lets you see whether pass rates moved after an update. Static scans of weights do not detect this, because the provider's weights are not in your hands. This risk relates to LLM03 Excessive Agency and LLM07 Misinformation when behaviour shifts. The scan cannot tell you why the model changed or whether the provider's update was intended. Confirm with your provider whether model versions are pinned and how they announce changes.
What does a clean static scan not tell me about a model?
A clean static scan means ModelAudit found no known unsafe pattern in the file it inspected. It does not show that the weights are free of backdoors, that the model is accurate, or that it resists attacks at runtime. Static checks sit beside live testing rather than replacing it, and both should be recorded in the intake decision. Keep the scan report, the model hash and the date with the approval record so reviewers can see what was checked. Ask your reviewers which residual risks they accept and document them.
Which MITRE ATLAS techniques map to these checks?
The ATLAS v2026.09 release includes Misconfigured or Publicly Exposed AI Services (AML.T0132), which live testing and configuration review help surface, and Discover AI Agent Runtime Capabilities (AML.T0133), relevant when the model drives tools. Prompt injection and jailbreak techniques, AML.T0051.001 and AML.T0054, are tested in live red team scans. Static scanning addresses file-based supply chain techniques instead. Use the ATLAS data release to confirm the current technique descriptions before you cite them in a report, since the knowledge base is updated over time.
Limits to confirm in your environment before scanning
A baseline scan is only as useful as the conditions it ran under. The cards below cover the terms, quotas, tool versions and model identity that shape what a result means. Confirm each one before you start, and record the answers alongside the scan output.
Provider terms for red team traffic
Red team scans send large volumes of adversarial prompts to the model provider's API, and some of those prompts look like abuse to the provider. Read the provider's acceptable use and terms of service before the first run, and confirm whether security testing is permitted on your account tier. Ask whether the provider needs advance notice or a dedicated testing agreement. Record the answer in the assessment file so the scan can be defended later.
Community probe allowance
The free Community edition of promptfoo includes red teaming with a monthly probe allowance. A full foundation model baseline with several plugins and strategies can use that allowance quickly, and a partial run may leave gaps you do not notice. Count the probes your planned scan needs before you start, and decide whether to schedule runs across months or move to a paid edition. Confirm the current allowance on the pricing page, since plans change.
- Probes per month
- 10k
A baseline is not a certification
A red team scan on one day against one model version shows how that model responded to the probes you chose. It does not show that the model is compliant with a regulation, that an auditor accepts it, or that it will behave the same way next month. Describe the output as evidence of a test run, not as an attestation. Ask your compliance lead which controls the scan supports and which need other evidence.
Hosted endpoint is not the weights
Red team scans test the hosted endpoint, while static scanning inspects the model files. These are different objects. A provider can change the served model, its system prompt or its safety layers without changing the name you configured, and a fine-tuned or quantized copy may behave differently from its base. Pin the model identifier and version where the provider allows it, and state which artifact each result applies to.
Confirm the promptfoo version
Scan results depend on the plugins, strategies and grading logic in the installed release. Before you run a baseline, check the version you have installed against the current npm and GitHub release notes, and confirm it meets the Node.js requirement. Record the exact version in the report so a retest can be compared with the same tooling. Upgrade in a separate step if the release changes plugin behavior.
Promptfoo releasesDo not rely on LLM Guard
LLM Guard offered input and output scanners for LLM applications, and some teams reach for it when they assess model behavior. The project was archived in July 2026 and is no longer maintained, so it should not appear in a current baseline as a control or a source of assurance. Review your tooling list and any templates that reference it. Replace it with a maintained option that you have tested in your own environment.
How much effort, time and internal input does a model assessment need?
What drives the cost and duration of a foundation model security baseline?
The main drivers are the number of models in scope, whether you can provide weights for static scanning or only API access, how broad the red team scan is, and how much remediation follows the findings. Each model adds its own scan setup and results review, so a baseline covering several models takes longer than one covering a single model. Scan scope matters as well: testing one application context against a narrow set of risk categories is a smaller job than testing a model across the OWASP LLM Top 10 and agent risks. Ask any provider for a fixed-scope written quote that lists the models, access method, test categories and remediation included, because no duration figure is supplied here.
Can our own team run promptfoo for a model assessment?
Yes, promptfoo is licensed under the MIT license and its Community edition includes red teaming with 10k probes per month, so a team with engineering skills can run the scans itself. Red team scans call the model provider's API, so the team needs a Node.js version that meets the current promptfoo requirement, provider credentials, and someone who can read and triage the results. Static scanning of model files is a separate step that requires access to the artifacts. Teams that lack capacity to design test cases, grade results and document decisions often choose a partner for that part while keeping the tooling in their own environment.
What does the assessment need from our team?
Three inputs matter most before work starts. First, access to the model provider or endpoint under test, with credentials scoped for testing and an agreed budget for inference requests. Second, a named risk owner who can accept or reject findings and approve any remediation that changes the model or application. Third, approved test data and prompts that reflect your use case, plus rules on what may be sent to the model provider. Without these, the baseline tests a generic model rather than the system you plan to ship, and findings take longer to close.
What is one-time work and what recurs after the baseline?
The initial baseline is one-time work: scoping, setting up scans, running static checks on the weights, reviewing results and recording the accept or reject decision. Recurring work starts when the model changes. Provider updates, fine-tuning runs, prompt or system changes, and new tool access can all change behaviour, so rescans should follow each material change. Ongoing rescans also consume inference requests on each run, which recur as a cost. Ask for the rescan triggers and frequency in writing, and confirm whether retainer support covers them.
Does a clean scan prove that a model is safe?
No. A scan shows that the tests you ran did or did not produce a failure under the conditions you set. Red team probes cover known attack patterns, and static scanning of model files looks for known malicious content, so both can miss unknown risks. Results also depend on grading, the prompts used and the model version tested. The baseline gives you documented evidence and a decision record, which compliance teams can review, but it is not a guarantee or an audit opinion. Treat a clean result as one input alongside threat modelling and ongoing monitoring.
What licensing cost applies to promptfoo in an assessment?
The promptfoo software is licensed under the MIT license, and 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 and On-Premise editions add team sharing, SSO, custom roles, continuous monitoring and priority support with SLAs, and they are sold at custom pricing, so ask the vendor for a quote if you need them. Your own costs also include model provider inference charges for each scan, and any services fees for a partner. Confirm which edition your scope needs before you commit.
How do we know the scope is right before we commit?
Ask the provider for a written scope that names each model, how it is accessed (API, weights or both), the risk categories tested, which frameworks the tests map to, the remediation and retest included, and the deliverables. Check whether the plan covers the OWASP LLM Top 10 categories you need and whether agent or tool risks apply if the model will call tools. Confirm who holds the test data and results, and where scans run. A fixed-scope agreement makes the cost and timeline reviewable before work starts.
Sources to read before you start
Read the promptfoo foundation models guide first. It explains the two halves of the assessment: red team scans that send inference requests to the live model through your provider API, and static scanning of the weight files. Before you run either half, confirm which provider account, endpoint and API key the scan will use, and whether your provider's terms allow automated security testing against the model. Those answers decide what the scan can reach and what data leaves your environment.
Next, work through the OWASP Top 10 for LLM Applications 2026 resource, which is the list most reviewers will use to judge your baseline. Its LLM03 Excessive Agency and LLM04 Supply Chain entries map directly to a foundation model decision, and LLM08 Hidden Context Exposure is new in this edition, so check whether your scan plan covers it. Read the OWASP 2026 LLM Top 10 resource and record which categories your red team plugins cover and which you will test by other means.
For attack techniques against the model itself, read the MITRE ATLAS v2026.09 data release. It lists the tactics and techniques that adversaries use against AI systems, including Misconfigured or Publicly Exposed AI Services (AML.T0132) and LLM Jailbreak (AML.T0054). Use it to check that your test set includes the techniques relevant to how the model will be served. Finally, read the NIST AI 600-1 Generative AI Profile to frame the evaluation and document the risks you accepted, and confirm with your risk owner which version of each source your review will cite.
How DeployOpen scopes and delivers a foundation model assessment
DeployOpen plans and runs the foundation model assessment as a written, fixed-scope engagement. We agree which models, endpoints and test scans are in scope, run promptfoo red teams and ModelAudit static scans inside your environment, and hand over findings, configurations and a repeatable process your team can keep running.
How we scope
- We confirm which foundation or fine-tuned models, provider endpoints and model files are in scope before work starts.
- The written scope names the OWASP LLM Top 10 and agentic risk categories the red team scans will test against.
- We agree who holds provider API keys, where inference traffic goes and which data may be sent to the model under test.
How we build
- We configure promptfoo to run locally against the live model, with red team plugins and strategies chosen for your use case.
- We run ModelAudit static scans on weights and model files before any loading step, recording each file's format and result.
- We document the test configuration, scan settings and grading criteria so results can be reproduced and reviewed later.
How we hand over
- You receive scan results, a findings report with severity and remediation notes, and an accept or reject recommendation for each model.
- Your team receives the promptfoo configuration files, scan scripts and runbook needed to repeat the assessment.
- We walk your security and platform engineers through the results and confirm which findings need retesting after fixes.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer when models or providers change.
- We can repeat scans after a provider model update or a fine-tuning run, using the same documented configuration.
- Confirm with us whether retesting, provider changes and new model intake are included in the agreed scope or a retainer.

