Scanning ML model files with promptfoo ModelAudit

ModelAudit statically scans model files before a team loads them into its environment. This page explains where that check fits in intake, what it finds and misses, how to install it standalone or through promptfoo, and how to turn results into an accept or reject decision.

On this page

Where ML model file scanning fits before a model is loaded

ModelAudit scans model files statically, which means it inspects their contents before anything loads them. It is one gate in model intake, alongside the checks your team already runs on new software. A team pulling a model from a public hub or a supplier should treat that scan as a required step before the file reaches a workstation, a notebook or a serving host. The risk it addresses is specific. Many model formats are serialized objects, and pickle-based formats in general can contain instructions that run as soon as the file is deserialized. Loading an untrusted file can therefore execute code on the machine that loads it, before anyone has reviewed the model. promptfoo runs locally, so the scan runs on hosts you control, and the static check never needs to execute the model.

Static scanning and red teaming answer different questions, and a team needs both at different points. The intake scan asks whether the file itself carries content that is dangerous to load. It applies to every new artifact from outside your trust boundary, including new versions from a supplier you already use. Red teaming asks how the running application behaves once the model is inside it, such as whether prompts, tools, retrieval sources or agent permissions can be pushed into unsafe output or actions. The 2026 OWASP Top 10 for LLM Applications lists supply chain risk as LLM04 and prompt injection as LLM01, so the two checks cover different entries on the same list. A clean scan does not show that the model behaves safely in your application, and a passing red team run does not show that the file is safe to load.

Before the first load, decide who may pull models, which formats suppliers must provide, and what happens when a scan flags a file. Plan the red team step as its own project, since it needs the running application, its tools and its data handling in scope. That is why it usually comes after intake and before go-live. Keep each scan output with the model's source, version and file hash so a later review can see exactly what was checked. For the test design side, the promptfoo red teaming documentation describes the frameworks it maps to, including the OWASP LLM Top 10, the NIST AI Risk Management Framework and the EU AI Act.

What ML model file scanning finds and what it misses

A static scan reads a model file without running it, so it can flag what the file contains and how it is built. The first four cards cover those findings. The last two cover what no file scan can see: how the trained weights behave, what the model reaches once loaded, and where the file came from.

Serialized code that runs on load

Pickle-based formats can store instructions that import and call functions while the file is deserialized, so loading a file can run code before any evaluation starts. ModelAudit is built to flag the opcodes and patterns tied to this behavior in pickle, PyTorch ZIP and binary files. Treat any flagged serialized code as a reject until the supplier explains it. Check which file types your intake accepts, and require formats that store tensors without executable instructions.

Embedded content and templates

Model files can carry text beyond their weights, such as chat templates, configuration strings and metadata fields that your serving stack renders or parses later. Suspicious content can include embedded scripts, unexpected URLs or payloads hidden in string fields. A template that changes prompts or contacts an outside host is a finding even when the weights are clean. Have a person read the template text, because pattern matching can miss unusual encodings.

Format and metadata anomalies

A file whose header, extension or internal structure does not match its declared format is a warning sign, and so are missing or contradictory metadata such as architecture, tokenizer or license fields. Malformed files can also break parsers in ways that hide what else is inside. Anything that cannot be parsed cleanly should stop intake until someone explains it. Compare the model card and file metadata with the scan output, and record each mismatch in the intake ticket.

Unexpected custom operators

Graph formats such as ONNX can reference operators outside the standard set, and those operators may depend on native code the runtime loads. Some pipelines need custom operators, so each finding calls for a decision with a reviewer. Each custom operator needs an owner, a source and a documented reason before the model enters your environment. Check whether your runtime loads custom operator libraries at all, and disable that path if your models do not need it.

Weight behavior and output backdoors

A static scan reads the file structure and never runs the model, so it cannot show how the trained weights respond to a given input. A backdoor can be trained so that a specific trigger produces a specific output, and that behavior appears only when the model is queried. A clean scan says nothing about safe behavior. Pair the scan with behavioral red teaming against the loaded model, and rerun the same prompts after every change to the model or its runtime.

OWASP LLM Top 10 2026

Runtime access and provenance

Once loaded, a model runs inside your serving stack with whatever file system, network and secret access that stack grants, and a file scan cannot see any of it. Provenance is equally outside the file: the scan does not establish who trained the model, on which data or through which pipeline. A file that passes every check can still be the wrong file. Confirm the current ModelAudit detection list in its documentation before promising stakeholders coverage, and pair the scan with a documented chain of custody.

Standalone ModelAudit or run through the promptfoo CLI

This table compares four ways to run ModelAudit on a model file before it enters your environment. Read each row for who operates the scan, where its results end up, and whether the self-hosted promptfoo server's single-instance limits matter. The main takeaway is that those limits apply only when results go through the web UI and API, so a team without a shared server can start with the CLI or a standalone install.

OptionWho runs it and where results goSingle-instance limits applyBest fit
Standalone ModelAuditSecurity or ML engineer runs it on a workstation or intake host; results go wherever the output is writtenNot applicable, no promptfoo server is involvedTeams that do not use promptfoo and want one scanner for model intake
promptfoo CLIEngineer with promptfoo installed runs the scan locally; results are printed or saved to files you chooseNot applicable, runs locally without the serverTeams already running promptfoo evals and red teams from their own machines
Self-hosted web UI and APIPlatform or security team runs the server in Docker, Compose or Helm; results are kept in its local SQLite database (confirm that scan results are written there)Yes: SQLite storage, no shared replicas, no RBAC or built-in SSO, not recommended for productionShared review of scan results when one instance is acceptable for your use
Delivery pipeline jobCI runner executes the scan on each model change; results live in pipeline logs and artifacts you keepDepends on design: a runner-side CLI call avoids the server, while an API call inherits its limitsEnforcing intake checks on every model change or on a schedule
Confirm before you chooseThe Node.js 22.22.0 requirement is for promptfoo 0.124.1, so confirm ModelAudit's own install method and Node.js needs.Check that the runner image or workstation meets them before rolloutAny option, once prerequisites are confirmed

Only accepted model files reach the loading environment

The flow starts when a team requests or pulls a model file from a supplier or hub outside its network. The file crosses the trust boundary into a quarantine location, where ModelAudit scans it before anyone loads it. The scan output goes to a reviewer, who can accept the file into the internal registry, reject it, or escalate it for manual review. Only files in the registry move to the isolated environment where they are loaded. At each hand-off, confirm that the file matches what the supplier published and that the scan report is attached to the decision record.

Model files cross one trust boundary and reach loading only after an accept decision.

Setting up ModelAudit in a model intake process

This sequence sets up ModelAudit as a controlled gate in model intake, from license and install checks through a quarantine location, sample scans and a written promotion rule. It ends with confirmed output formats, results storage and exit behavior, so the team knows what a scan produces before any pipeline depends on it.

  1. Confirm license terms and install method

    Confirm the license terms and install method before anyone scans a file. Read the license for ModelAudit and for any promptfoo component you plan to use, noting that promptfoo itself is MIT licensed, then choose between a standalone install and an install through promptfoo. Pin the version your intake policy approves. Done when the license review has a named approver and the install method is written in the intake runbook.

  2. Create a restricted quarantine location

    Create a quarantine directory where every incoming model file lands before it is scanned or loaded. The intake service account writes to it, while the scanning account and reviewers get read-only access, so the file under review is the file that gets promoted. Record the path, owners and permissions in the runbook. Done when a write attempt from an unauthorized account fails, and a copied file matches its original checksum after the scan.

  3. Scan a known safe and a known risky sample

    Run a first scan on one known safe sample and one known risky sample, both from test sets your security team approves. Use the scan command and flags from the official ModelAudit documentation, and read the complete output for each run, including the summary. Keep both files in a separate test area outside production intake. Done when the safe sample shows no findings at the severities you care about, and the risky sample produces at least one finding you can trace to that file.

  4. Record the findings format

    Record the findings format from both runs before writing any policy against it. Note each field the report gives for a finding, such as severity, check or rule name, affected file or component and message, and save one annotated sample of each output in the runbook. Confirm the report formats ModelAudit supports in the official documentation, since automation later depends on them. Done when a reviewer who has not run the scanner can read a finding and say what it refers to.

  5. Decide which findings block promotion

    Decide which findings block promotion, and write that decision down before the first live intake. Map each finding type you saw in the sample runs to one outcome: reject, hold for review, or accept with a named owner. Treat any finding that indicates code could run when the file is loaded as a hard stop, and keep the mapping in version control with approval from the security lead. Done when every finding type has exactly one outcome and no held item lacks an owner.

  6. Set where scan results are stored

    Set where scan results are stored and who can read them. Choose a location outside the quarantine path, with write access for the scanner and read access for reviewers, and set retention to match your records policy. If you send results into promptfoo, check its self-hosting guidance first, because the self-hosted app stores data in a local SQLite database that is not recommended for production. Done when a test result lands in the chosen location and you can confirm which file, scan time and scanner version it refers to.

  7. Confirm exit behavior before automating

    Confirm the exit behavior before anything is automated. Run the scanner on the safe and risky samples and record the process exit status for each run, since a pipeline gate depends on it. Check the official documentation for which status means no findings, which means findings were detected, and which means the scan itself failed. Done when each outcome produces a distinct status you have seen, and your intake script treats a scan error as a hold, never as a pass.

Turning scan results into an accept or reject decision

Scan output is evidence for a decision, not a decision on its own. Define three outcomes before the first scan runs. Accept means the model meets the written intake criteria and a named approver signs off on its use in a specified environment. Reject means the file is not loaded anywhere, is moved out of the model store, and the source is told why. Escalate means the findings or gaps cannot be closed by the intake owner alone, so the file goes to the security team for review. The intake owner, usually the platform or data team that requested the model, owns the proposal and the follow-up work. The security team owns the criteria and every escalated case. The person who signs the record owns the acceptance, and that person should not be the one who asked for the model.

A clean ModelAudit result lowers risk, but it does not prove the model is safe. Static scanning checks for patterns the tool knows how to flag in the formats it parses, so a clean report means no known pattern appeared in the parts it could read. It says nothing about the training data, the behavior of the weights after loading, or code the surrounding pipeline runs. Confirm with the scanning team what coverage applies to each format in your intake, and record that scope beside each result. Findings need the same discipline in the other direction. A flag can be a false positive, such as a benign construct that resembles a risky one, so no single finding should automatically reject a model. Route each finding to a named owner who reviews the flagged content, decides whether it is benign, and writes down the reason.

Every decision needs a written record that a reviewer can reconstruct months later. At minimum, the record should hold the model source, the file hash of each artifact scanned, the ModelAudit and promptfoo versions used, every finding with its reviewer disposition, the outcome, and the approver's name and date. The hash ties the decision to the exact bytes that were scanned, so a changed file needs a new scan and a new record. Tie the accept, reject and escalate rules directly to the security team's written intake policy, which should state which findings reject automatically, which escalate, which model formats suppliers may send, and who may approve an exception. Before go-live, confirm with the security team that the record fields and outcome rules match that policy, and schedule a re-review whenever the scanner is upgraded.

Which intake path fits public hubs, private registries and vendor files

Public Hugging Face downloads are the most common intake path and the one most often run without a formal request. The risk comes from the file format and any code the files may carry, not from the account that published them, so intake decisions focus on who asks for a model, which revision they pull and where the scan runs before anything loads the weights.

  • Who submits: Requests come through a ticket or model allowlist entry, and only named repositories at a pinned revision are eligible.
  • Read access: The scanner reads a staging copy on an isolated host. Public repositories need no credentials, while gated or private repositories need a read-scoped token, as covered on the sibling Hugging Face page.
  • Credentials: Store any token in the runner's secret store, scope it to read and keep it out of job logs. Revoke it when the requester's access ends.
  • Manual review: Stop for a person when a repository ships custom code that must run on load, when pickle-based files appear in a format the team expected to be safe, or when the files do not match the model card.
  • Revision record: Save the commit hash with the scan result so the artifact that was approved is the one that gets deployed.

Before approving, confirm that the deployed artifact's hash matches the scanned revision.

What a ModelAudit rollout costs and what it asks of your team

What drives the effort of a ModelAudit rollout?

The main drivers are the number of model sources, the number of file formats, the size of the largest files and whether your models already sit in registries the scanner can reach. Each source needs access, credentials and a documented intake path. Each format may need its own checks and its own review of findings. Large files take longer per scan and may need resource limits set before a full library run. Existing registries can shorten setup when access is already in place, and they add work when access must be built from scratch. Ask for these inputs in writing before comparing offers: every source, every format in use, the largest file sizes and the registries involved. Quotes that skip these inputs are hard to compare.

Is ModelAudit free to use, or does promptfoo charge for it?

promptfoo is licensed under the MIT license, but you should confirm the terms that apply to ModelAudit itself and any dependencies it installs by reading the repository and package you plan to use. The promptfoo Community edition is free and includes LLM evaluation, all model providers and red teaming with a monthly probe allowance, with community support. The Enterprise and On-Premise editions are priced on request and add features such as team sharing, SSO, a centralized guardrail dashboard and a dedicated deployment engineer for On-Premise. Confirm which of those features you need before assuming they are part of the scanner. DeployOpen's own work is quoted separately from any software license, based on the written scope.

Which ModelAudit rollout costs are one-time and which recur?

One-time costs cover the initial build: connecting registries and storage, setting up the intake workflow, writing accept or reject criteria and checking them against known files. Recurring costs come from rule tuning as new findings and formats appear, rescans when sources or model versions change, and upgrades to promptfoo and its dependencies. Staff time for reviewing findings recurs for as long as new models keep arriving. Ask the provider which items sit in the fixed scope, which would move to a retainer and which stay with your team. DeployOpen offers ongoing support, upgrades and continuous testing as retainers, so you can compare a one-time project with a standing agreement before you decide.

How long does a ModelAudit rollout take?

The duration depends on the written scope, so ask for a timeline in writing before you plan around one. The scope sets how many sources need access, how many formats need checks, whether registries need integration and how many review rounds your security team requires. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and most engagements are fixed-scope. A useful timeline lists its milestones, the dependencies on your team such as access approvals, a quarantine location and named reviewers, and what changes if a dependency slips. Without those dependencies, the timeline cannot be checked against progress.

What access and decisions will our team need to provide?

Your team provides three things: access to the registries, object storage and file shares where models live, a quarantine location where incoming model files wait until they are scanned and approved, and a named security owner who makes accept or reject decisions. Access approvals often take longest in large organizations, so request them early. The quarantine location should sit apart from any path that loads models into production, and the owner needs authority to block a model without waiting for a committee. Engineers also confirm the environments where the scanner will run and who maintains the scheduled or CI jobs. DeployOpen works inside your accounts, data centers or air-gapped networks, so these resources stay under your control.

Can an internal team run a ModelAudit rollout without outside help?

Yes, a capable internal team can run a rollout if it has engineers who can install and operate the scanner and a security owner who can set accept or reject criteria. The harder work is deciding which findings block a model, which formats you will refuse, how exceptions are approved and how each decision is recorded for audit. Internal teams also need time for rule tuning, rescans and upgrades after launch, so check whether those hours exist for the life of the program. Outside help makes most sense when a skill is missing, when the source count is large, or when you want an independent review of your criteria before relying on them. DeployOpen can take on the build, the testing or the ongoing support under a written scope.

What should we ask for in a ModelAudit implementation quote?

Ask for a quote built from a written scope that names the sources, formats, deliverables and exclusions. DeployOpen does not publish a price list, and a quote follows from the written scope, so the inputs matter as much as the number. Include these items in your request:

  • The model sources, registries, formats and largest file sizes in scope
  • The deliverables, such as the scanning workflow, documented accept or reject criteria and handover notes
  • The assumptions about access, environments and your team's time
  • Exclusions, including any integration you have not named
  • Which items are one-time and which would move to a retainer
  • The timeline, with milestones and dependencies

Offers only compare fairly when they share the same inputs.

Operating the scanner on untrusted model files

Scanning only reduces risk if the scanner, its output and the release decision are controlled too. The cards below cover the isolation, handling, versioning, promotion and record-keeping decisions that surround each scan. The last card covers a limit in self-hosted promptfoo that matters if several teams share one record.

Scan in an isolated container

Run ModelAudit in a container or sandbox that holds no credentials, no registry tokens and no access to production data. Where your platform allows it, restrict network egress so the scanner can reach only the artifact store it reads from. Treat the scan as reading untrusted bytes, and confirm that the scan job never imports or loads the model. Ask your platform team to demonstrate that the scan job cannot reach internal services.

Treat scan output as sensitive

Scan reports, console logs and saved JSON can name internal paths, bucket names, repository names, model owners and file hashes, which show an attacker what you use and where it lives. Store them with the same access controls as the model artifacts, and set a retention period that your records policy supports. Keep them out of public CI logs and artifact pages. Before you share a report with a supplier, remove internal paths you would not want them to see.

Pin scanner versions

Pin both the ModelAudit and promptfoo versions your intake pipeline uses, and record the exact versions in every scan report so a decision can be reproduced later. Check the Node.js requirement before you upgrade, since the promptfoo 0.124.1 npm release, published on 8 October 2026, requires Node.js 22.22.0 or newer. Read the release notes for changes to detectors and format handling, then rescan your approved model inventory on the new version so a changed verdict is caught before a model is promoted.

promptfoo releases

Limit who releases quarantined models

Hold every file that fails or has not yet been scanned in a quarantine location. Give promotion rights to a named group that is separate from the people who upload or request models. The promotion step should check a recorded scan result against the file hash, so a swapped artifact cannot inherit an earlier pass. Review that group's membership on a fixed schedule, and remove access when people change roles or leave the team.

Log every accept and reject decision

Record who approved or rejected each model, the file hash, the ModelAudit and promptfoo versions, the scan timestamp, and the reason for any override of a finding. Keep this decision record in your own system of record, since a scan report shows what was found but not who accepted the risk. Ask whether the log is append-only and who can delete entries, and test a restore of one decision from the log during each review cycle.

Plan the shared record first

Self-hosted promptfoo stores its data in a local SQLite database that cannot be shared across replicas. It has no RBAC and no built-in authentication or SSO, and it is not recommended for production use. If several teams need one shared record of model decisions, decide first where that record lives, who can read and write it, and how it is backed up. Until that plan exists, keep decisions in your own system and use promptfoo only for scan output.

Self-hosting docs

How DeployOpen works on this

DeployOpen scopes ML model file scanning as a written, fixed-scope piece of work inside the intake process you already run. We agree which model sources, file formats and storage locations are in scope, then install and document ModelAudit in infrastructure you control, alongside promptfoo where your team wants the same tooling. The result is a documented accept or reject procedure your reviewers can check.

How we scope

  • Agreed in writing before work starts, listing the model sources, file types and storage locations in scope.
  • Confirm which intake paths matter, such as Hugging Face downloads, object storage buckets or a model registry.
  • Decide whether scanning runs on laptops, in CI/CD or on a shared server, since each changes the setup.

How we build

  • Install ModelAudit standalone or through promptfoo, pinned to the versions your team approves.
  • Configure scans to run before any model file is loaded into a notebook, pipeline or serving stack.
  • Map each finding type to a documented accept, review or reject rule agreed with your security team.

How we hand over

  • Written runbook covering installation, scan commands, result review and the accept or reject procedure.
  • Evidence pack showing scan configuration, sample results and reviewer sign-off, prepared for your compliance assessors.
  • Walkthrough with the engineers who run intake, so they can run the procedure themselves.

How we support

  • Optional retainer for ongoing support, covering updates to ModelAudit and rules as your model sources change.
  • Retesting after changes to scan configuration, CI/CD gates or the formats your teams accept.
  • Ask quotes to separate one-time setup from recurring retainer work, so budgets match the operating model.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.