Scanning GGUF, SafeTensors and ONNX models with ModelAudit

ModelAudit checks GGUF, SafeTensors and ONNX files for template, metadata and custom operator risks before they reach your environment. This page covers what it inspects, what it cannot prove, and how to set it up.

On this page

Why GGUF, SafeTensors and ONNX files still need scanning before use

Teams that pull model files from public hubs or supplier portals often assume that GGUF, SafeTensors and ONNX are harmless because they are not pickle files. That assumption is narrower than it looks. ModelAudit statically inspects these formats before a model is loaded into a runtime, so the check happens at intake rather than in the middle of a serving or fine-tuning job. Teams need it whenever a model arrives from outside their own build process, whether from an open hub, a reseller, a partner or an internal registry that accepts uploads from many people.

A format name tells you how the file is structured, not what the surrounding content can do. Model files carry more than tensors. GGUF files include metadata key-value pairs, and inference runtimes may render chat templates from them. ONNX models can reference custom operators that the runtime must load from outside the file. ModelAudit includes a Jinja2 template scanner and a metadata scanner alongside its format scanners, so template text and embedded metadata are examined as well as the weights (see the ModelAudit scanners documentation). Confirm in that documentation which scanner covers which format and file extension before you write intake rules, because coverage differs between formats.

Before you rely on a scan, decide what a finding means for your process. Ask your model owner which runtime will load each format, which template engine it uses, and whether custom operator libraries are permitted in your environment. Then agree on who reviews flagged files and what evidence is kept for the accept or reject decision. Confirm these points with your security and platform teams first, since a clean scan covers only what the scanners inspect.

What ModelAudit checks in each format

Model files in GGUF, SafeTensors and ONNX are often assumed to be data-only, but each format carries fields and structures that can still carry risk. The cards below cover the checks that matter most for these formats and what to confirm for each one against the ModelAudit scanner documentation.

Chat and prompt templates

Many GGUF and other model files embed a chat template, a Jinja2 program that formats messages before they reach the model. A template is executable logic, not plain text, so a malicious one can run code or alter prompts on every request. ModelAudit includes a Jinja2 template scanner for this. Confirm which template locations and constructs it inspects for your model format.

ModelAudit scanners

Metadata fields

Model files carry metadata such as architecture names, tokenizer settings, author fields and custom key-value pairs. Metadata is often trusted because it looks descriptive, yet it can hold unexpected values, oversized content or embedded payloads that downstream tooling parses. ModelAudit includes a metadata scanner alongside its format scanners. Check that the scanner covers the metadata fields your intake policy depends on.

Custom operator references in ONNX

An ONNX graph describes computation as standard operators, but it can also reference custom operators supplied by a runtime library that is not part of the standard set. Loading such a model may require code outside the file, and that code is what runs. Identify every custom domain the graph references and confirm which ones your inference environment is allowed to load.

Format reputation is not a control

SafeTensors was designed to store tensors without executable serialization, which removes the pickle-style code path. That design lowers risk but does not remove the need for scanning, because templates, metadata and operator references can still hold logic or unexpected content. Treat a safe format as a requirement in your intake policy, then scan whatever arrives in it.

Verifying per-format coverage

Scanner behavior differs by format and version, so a check listed for one format may not apply to another. Before you rely on a result, write down which checks ran for each file type in your pipeline and which did not. Ask the vendor or DeployOpen for the current coverage matrix, and test the scanner on a known-bad sample you prepare yourself.

Scanner options and when each fits

This table compares the ways a team can run ModelAudit during model intake: one file or a whole directory, default or strict evaluation, and standalone or through promptfoo. Read each row for the intake stage it suits and the trade-off it carries. Exact flags and option names should be confirmed against the current ModelAudit documentation before you write them into a runbook.

OptionWhen it fitsTrade-offConfirm before use
Single fileReviewing one GGUF, SafeTensors or ONNX file from a supplier or a Hugging Face download before it is loadedFast and easy to read, but a model repository with sidecar files, templates or configs can be missed unless each part is scannedWhich file types the scanner handles and how it reports each one
DirectoryIntake of a full model repository or download folder, where templates, metadata and companion files arrive togetherBroader coverage and fewer gaps, but output is longer and findings need triage by fileHow directory scans handle nested folders and unsupported files
Default evaluationRoutine intake of models from known suppliers where you want findings reported without failing every warningLower friction for reviewers, but low-severity findings such as metadata oddities may pass without anyone reading themWhat the default run reports as a failure and what it only reports as information
Strict evaluationModels from unknown or public sources, and any model that will run in a production or sensitive environmentMore findings and more false positives to review, which adds reviewer time per modelWhich checks become blocking under strict mode and the exit code it returns
Standalone ModelAuditAir-gapped or restricted hosts, and teams that want the scanner in a pipeline without a promptfoo account or setupResults stay in your own tooling, but you own the install, updates and report handlingInstallation method, supported Python version and how to pin the release
Through promptfooTeams already running promptfoo evals or red teams who want model scans and LLM tests in one workflowOne toolchain and shared reporting, but it adds a dependency on the promptfoo install and its release cycleHow the promptfoo entry point invokes ModelAudit and which options it passes through

How to set up ModelAudit for model intake

This sequence takes a team from an empty controlled environment to a recorded accept or reject decision for a downloaded model file. Each step ends with a check, so the scanner, its version and the report are confirmed before any model is trusted.

  1. Confirm the Node.js runtime and choose the install method

    The platform team checks the Node.js version on the intake host against the requirement for the promptfoo release you plan to use. The current npm release requires Node.js 22.22.0 or newer, so confirm the exact version in the npm registry before you install. Confirm with the promptfoo documentation whether ModelAudit is installed standalone or through the main promptfoo package for your setup. Record the chosen method in the intake runbook. The step is done when the runtime version and install method are written down and approved.

  2. Install ModelAudit in an isolated scanning environment

    Install the tool on a dedicated intake host, container or virtual machine that is separate from any workstation or service that loads models. Pin the version so every scan in your intake process uses the same scanner rules. Keep this environment free of production credentials and model-serving access. The check is to run the version command documented for the install method and confirm the output matches the pinned version in your runbook. If it does not match, stop and reinstall before scanning anything.

  3. Run a known-clean sample before real models

    Before you trust the scanner on new supplier files, scan a small sample file that you have created or verified yourself, such as a tiny SafeTensors or GGUF file generated in your own environment. The goal is to confirm the scanner runs end to end, writes a report and does not fail on a benign input. Keep the sample and its expected result in your test records. If the sample produces warnings or errors, investigate the environment before continuing, because a noisy baseline will hide real findings later.

  4. Stage the downloaded model file for scanning

    Download the GGUF, SafeTensors or ONNX file from the approved source into a quarantine directory on the intake host, not into the location where your inference service reads models. Record the source URL, the file name, the size and a cryptographic hash in your intake log before the scan begins. Confirm that the file is complete and that no other process is writing to it. The step is done when the quarantined file, its hash and its source are logged together.

  5. Run the scan and capture the full report

    Point ModelAudit at the quarantined file using the scan command documented for your install method, and save the output to a file rather than only the terminal. Ask the scanner to report all findings, including those it classifies as informational, so the reviewer sees the full picture. The report should cover the format scanners, the Jinja2 template scanner and the metadata scanner, which the scanner documentation lists as part of its coverage. The step is done when the report file exists and its scan target matches the staged file.

  6. Review template, metadata and operator findings

    A named reviewer, separate from the person who downloaded the model, reads the report line by line. Pay particular attention to chat template content, embedded metadata fields and any custom operator references in ONNX graphs, because these are the areas teams often treat as harmless. Compare each finding with the model card and the supplier's stated provenance. Mark each finding as expected, explained or unresolved. The step is done when every finding has a disposition and any unresolved item is assigned to someone.

  7. Record the accept or reject decision

    Write the decision in the intake record with the scanner version, the report file location, the file hash, the reviewer name and the date. An accept decision moves the file from quarantine to the approved model store. A reject decision deletes or archives the file and notifies the requesting team. Ask your security lead to confirm that the record format matches your audit evidence requirements. The step is done when the decision, its evidence and the file's new location are all linked in one record that a later reviewer can follow.

Where the scan sits in model intake

Intake starts when a model file leaves a supplier or public hub and arrives in your staging area. ModelAudit scans the file inside an isolated environment that holds no production credentials and no write path to the registry. The scan result feeds an accept or reject decision, and only accepted files cross the trust boundary into the model registry and runtime. Check that the decision is recorded and that rejected files are quarantined, not deleted.

Model files cross a trust boundary only after a static scan and an explicit accept decision.

How scanning differs for air-gapped and connected teams

Connected teams can reach public model hubs and package registries directly, so intake can be automated. A scan runs when a model is downloaded, and the scanner and its dependencies are updated through the normal package channels. The main risk is drift: a scanner version, rule set or allowlist that nobody reviewed can change what passes. Teams in this model usually scan close to the point of download and record the scanner version with each result.

  • Update source: Scanner and dependency updates come from public registries, so pin versions and review upgrades before they reach production intake.
  • Scan timing: Scans can run at download, in CI or on a schedule that rescans stored artifacts when the scanner changes.
  • Evidence: Store the report, file hash, source URL and scanner version together so a later reviewer can reproduce the decision.
  • Reviewer access: Give security reviewers read access to the scan output in the system where models are approved, not only in a developer's terminal.
  • Egress control: Limit which hubs the intake job can reach, so an unreviewed source cannot be added silently.

Confirm with the vendor documentation which scanner features need network access at run time, and whether any remote lookups happen during a scan.

Security and operational considerations

A ModelAudit result is only as trustworthy as the way the scan was run and recorded. The cards below cover where scans run, how untrusted files are handled, who can approve a model, what to keep as evidence, and when a previous approval must be revisited.

Scan in an isolated sandbox

Run ModelAudit on a host or container with no access to production credentials, model registries with write rights, or internal networks the file does not need. Scanning reads the file, but a hostile artifact is still parsed by your tooling, so treat the scanner host as exposed. Ask your team to confirm which network egress, mounts and secrets the scan job receives.

Handle untrusted files carefully

Keep downloaded GGUF, SafeTensors and ONNX files in a quarantine location until the scan finishes, and do not load them into a notebook or serving process first. Check file sizes and disk space before scanning large models, and set limits so a malformed file cannot exhaust the runner. Record the source URL and hash of each file so the scanned artifact can be matched to the one later deployed.

Limit who can approve models

Separate the people who request a model from the people who accept or reject it, and keep the approval list in a system with its own access controls. An accept decision should name the reviewer, the model version and the scan result it relied on. Confirm with your security team how exceptions are raised when a scan reports a finding that the team wants to keep.

Keep scan reports as intake evidence

Store each ModelAudit report with the model identifier, file hashes, ModelAudit version and the date of the scan, so an auditor or incident responder can see what was checked and when. Reports show what the scanner found, not that a model is safe. Ask your compliance lead how long intake records must be kept and where they must reside.

Rescan when templates or metadata change

A chat template or metadata field can change without any change to the weights, and the Jinja2 template scanner and metadata scanner are the checks that examine those parts. Treat a new template, a changed tokenizer configuration or an updated model card as a new intake event that needs a fresh scan and approval. Confirm that your deployment pipeline blocks a changed artifact that still carries an old approval.

ModelAudit scanners docs

State what a static scan cannot prove

A static scan inspects the file without executing the model, so it can flag suspicious structures, but it cannot prove that a model behaves safely, is free of backdoors or matches its published training data. Pair scan results with behavioral testing of the deployed model and with provenance checks on the supplier. Document this limit in the intake policy so approvers do not read a clean report as a guarantee.

Questions buyers ask before scanning model files

Are GGUF or SafeTensors files safe by default?

Neither format is safe by default in the sense that a file passing a format check proves it is free of harmful content. SafeTensors is designed to store tensor data without executable code, which removes the pickle loading path that makes PyTorch files risky. GGUF stores model weights along with metadata, and that metadata can include fields such as chat templates that are processed when a model runs. A file can be well formed and still carry content you did not expect, so a static scan checks what the file contains rather than assuming the format is harmless. Confirm the exact checks ModelAudit applies to each format against the ModelAudit scanner documentation before you rely on them.

How much effort does it take to set up model file scanning?

Effort depends less on the scanner than on where your model files live and how they reach your team. Installing ModelAudit on one workstation is a small task, while wiring it into a model registry, object store or CI pipeline involves credentials, network paths, file size limits and a decision on who can override a rejection. Teams with several sources of models, such as Hugging Face, internal buckets and vendor drops, spend more time on intake rules than on the tool itself. Ask any partner to list each source, the number of model formats in use and the pipeline stages where a scan must block a load.

What drives the cost of a model scanning engagement?

Cost is driven by the number of model sources, the volume and size of artifacts, how many formats need coverage, and how far the scan is integrated with existing systems. Authentication, custom intake policy, reporting and the handover to your staff add effort beyond the first scan. Most of the spend is one-time for design and integration, while ongoing work covers rescans, tool upgrades and new model sources. A quote should separate these items, state who maintains the scanner after handover, and name the environments in scope. DeployOpen does not publish prices, so ask for a written scope and quote.

How long does intake definition take before scanning starts?

Intake definition usually takes longer than the scanning itself, because it requires decisions rather than installation. The team must agree which model sources are allowed, which formats are accepted, what a rejection means, who can approve an exception and how findings are recorded. Those decisions depend on your risk appetite and on whether models feed regulated workloads. The duration depends on how many stakeholders must sign off, so ask a partner to name the decisions, the owners and the review points in the plan.

What must our team provide before an outside partner starts?

Your team should provide read access to the model sources, a sample set of representative model files, the environments where scanning will run and a named owner for accept or reject decisions. Engineers need access to the pipeline or registry where models are stored, and security or compliance leads should state which evidence they need to keep. Credentials for private sources should be issued under a scoped account, not a personal token. Without these inputs, the scope cannot be written precisely and the quote will carry more assumptions.

Can our own team run ModelAudit without a partner?

Yes, if the team has someone comfortable with the command line, Python environments and CI configuration. Scanning a local directory, reading findings and setting a pass or fail rule can be done internally. Partner help is usually most useful for designing the intake policy, connecting private registries, handling large artifacts, and documenting the process for auditors. Confirm the current installation method and supported features in the ModelAudit documentation, and decide in advance who will maintain the setup after the first release.

What do scanners miss in GGUF, SafeTensors and ONNX files?

Static scanning checks file structure, metadata, templates and known risky patterns, but it cannot prove a model behaves safely or that its training data was clean. Custom operators in ONNX files may reference code that the scanner cannot fully evaluate, and metadata may point to resources that only appear at runtime. Scanning also does not replace behavioral testing of the model after it is deployed. Treat a clean result as one control among several, and record which checks were run and which were out of reach.

How DeployOpen scopes and delivers model scanning

Model scanning engagements start with a written scope, and that scope is what makes the work predictable. Before any work begins, DeployOpen and the client agree which model formats are in scope (GGUF, SafeTensors, ONNX and any pickle-based or PyTorch files already in use), where the models live, which ModelAudit scanners will run, how results are routed into an accept or reject decision, and what the deliverables are. Those deliverables typically include the scan configuration, the pipeline or intake procedure, a written procedure for handling findings, and a handover to the team that will operate it. Most engagements are fixed-scope, so the quote follows directly from this document. Ask any provider to state in writing whether Jinja2 template and metadata findings are in the report, since those are the checks teams most often assume are included by default.

Delivery happens inside your infrastructure. ModelAudit runs in the environments you control, such as a build runner, an internal registry scanning job or a workstation image, so model files and scan output do not need to leave your network. Access to model stores, credentials for buckets or registries, and any allowlist of approved model sources should be provisioned by your team and documented as part of the scope. A clear rule for who approves a rejected model is a decision to make before the build starts, because it determines whether the scanner is a gate or only a report.

DeployOpen prepares evidence for compliance and security reviews, including scan configurations, procedures, sample reports and records of how findings were handled. It does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations, and your compliance team should confirm early which evidence they will accept. Ongoing support, upgrades to ModelAudit and periodic rescans can be covered by an optional retainer, which is priced separately from the initial build. Ask whether the quote separates one-time setup from recurring support so that you can budget for each correctly.

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.