liveBook · Manning

Pickle format

As explained in AI Governance

A pickle-based format is a Python object-serialization format that can encode executable behavior in addition to data.

Pickle is a Python object-serialization format that can execute hidden code when a file is loaded. Treat pickle-backed model files as code-execution risks, not passive data. section 4.3.3

A malicious model file

Researchers found over 100 files on Hugging Face that silently opened backdoor connections when loaded. SafeTensors stores only numeric data and cannot execute code, but scanners can be bypassed: a 2025 report described a compression-based technique called “nullifAI.” section 4.3.3

How AI Governance covers it

How deep it goes
Shows the code-execution hazard and attack examples but does not explain pickle internals.
Examples
Cites malicious Hugging Face files, backdoor connections, and a compression-based scanner bypass.
What you can do after
Understand that loading a pickle-backed model file can trigger code execution and silently open a backdoor.
How it connects
Links pickle to PyTorch model files, SafeTensors, and model-upload scanning.

Also explained in

Compare how 2 books explain pickle format →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Governance. The section links point to the parts of the book it draws on.