Model & ML supply-chain security

picklescan: open-source pickle file scanner

picklescan is an open-source pickle file scanner from Matthieu Maitre. It is released under the MIT license and is offered as: CLI, Library.

  • Last reviewed

Best for

  • Teams that want a small free command-line scanner for pickle-based model files, including checks of Hugging Face repositories before download
  • Pipelines that need a fast pass or fail check on pickle files, used alongside a second control such as an allowlist or safetensors

Consider instead if

  • You want a scanner that covers formats beyond pickle, such as H5 and SavedModel files. See ModelScan.
  • You would rather allow only known-safe imports than block known-bad ones, or want pickles decompiled for review. See Fickling.

What picklescan does

picklescan is a small MIT-licensed command-line scanner that flags pickle files importing globals on its dangerous list, such as eval. It accepts local files, directories, URLs, zip archives including PyTorch checkpoints, NumPy .npy files and whole Hugging Face repositories, and its exit codes (0 clean, 1 malware, 2 error) make it easy to gate a pipeline. The weakness is the list itself. The repository's own security advisories record repeated bypasses, including three critical ones published on March 2, 2026 for modules missing from the blocklist, so a clean result means no known-bad import was found, not that the file is safe. Fickling takes the opposite approach with an allowlist of safe imports, and ModelScan adds formats beyond pickle. If you rely on picklescan, keep it on the latest release; the README documents the CLI only, with no Python API reference.

This summary is our own wording of the sourced facts on this page.

Key facts

Each value links to the page that states it, with the date we checked it.

API reference
Not documented in the sources we checked
Attestations or disclosure
Vulnerabilities, false positives and false negatives are reported through a draft GitHub security advisory Source, checked October 21, 2026: github.com (opens in a new tab)

Capabilities

As documented by the vendor or project. The tag is our label from a controlled vocabulary.

Integrations

Where picklescan fits in our AI security layers

Our analysis

Our editorial model, not a standard. The primary layer follows the category, except for tools whose main documented job is detection and response; other layers rest on a capability the sources document. How the model works.

AI security layers that picklescan covers, with the role, how each applies and what it rests on
LayerRoleHow it appliesBased on
L3 Supply chain Model and supply chain Primary Check that models, datasets and AI components from outside are what they claim to be and do not run code or hide backdoors when loaded. Follows its category, Model & ML supply-chain security

OWASP LLM Top 10 mapping

Our analysis

The risk list is OWASP's (Top 10 for LLM Applications, 2025). The mapping is our analysis, and each row rests on a capability the sources document.

OWASP LLM risks mapped to picklescan, with the capabilities each mapping rests on
RiskHow it appliesBased on
LLM03 Supply Chain Scans pickle-based model files, including Hugging Face repositories, for suspicious globals before they are loaded. Scans Python pickle files and reports flagged globals such as eval imports, with a summary of scanned and infected files; Loads pickles from local files, directories, URLs and zip archives, including PyTorch-style zip files and NumPy .npy files; The --huggingface option scans a model repository on the Hugging Face Hub

Alternatives and related tools

More in Model & ML supply-chain security, ranked within the category by Coverage Score.

ModelAudit (Promptfoo)

OpenAI (Promptfoo)

Open sourceMIT
  • CLI
  • Library
  • Self-hosted

Scans model files for malicious code, backdoor indicators and unsafe operations without loading them.

Best for: Teams that want a free scanner covering many model and archive formats, with SARIF output for code scanning in CI

Coverage Score 86 out of 100
  • LLM03 Supply Chain
  • LLM04 Data and Model Poisoning

Reviewed

ModelScan

Palo Alto Networks (Protect AI)

Open sourceApache-2.0
  • CLI
  • Library

Scans saved ML model files for unsafe serialized code before you load them, from a CLI or Python.

Best for: ML and platform teams that want a free scanner to check downloaded or internally produced model files before loading or deploying them

Coverage Score 84 out of 100
  • LLM03 Supply Chain
  • LLM04 Data and Model Poisoning

Reviewed

Open sourceApache-2.0
  • CLI
  • Library

Signs machine learning model files and verifies them later so tampering can be detected.

Best for: Teams that publish or consume models and want a free way to sign model files and check signatures before loading them

Coverage Score 78 out of 100
  • LLM03 Supply Chain
  • LLM04 Data and Model Poisoning

Reviewed

picklescan FAQ

Is picklescan open source?

Yes. picklescan is released under the MIT license, and the code is on GitHub at mmaitre314/picklescan.

Can picklescan scan a Hugging Face model?

Yes. The README shows picklescan --huggingface followed by a repository name, which scans that model and reports any flagged globals.

What do the exit codes mean?

The README lists 0 for no malware found, 1 for malware found and 2 for a failed scan.

Can a malicious pickle get past picklescan?

Yes, and the project says so in public. Its GitHub security advisories list bypasses of the dangerous-globals blocklist, three of them published with critical severity on March 2, 2026. Treat a clean scan as one signal, keep the tool updated, and prefer safetensors or an allowlist approach for files you cannot vouch for.

Key facts you can cite

We have no commercial relationship with Matthieu Maitre.

Sources & last reviewed

Last reviewed . We compile from the vendors' own public pages and repositories and we do not run the products. Source links open in a new tab. Found a mistake? Report a correction.