Lion Cipher Lab
Gate every model your team downloads: scan a model folder with ModelScan and fail the build on unsafe code
- AI Security
- Intermediate
- ~45 min
- Free · no account required
Why it matters
Teams download pre-trained models the way they install packages: from a public hub, by name, often straight into a notebook or a build. Many common model formats are serialized Python objects, and loading one can run whatever code the author put inside. That makes every downloaded model a piece of untrusted software. The fix is the same one teams use for dependencies: scan at the door, automatically, and stop the pipeline when something looks wrong. ModelScan, an open-source scanner from Protect AI, checks model files for unsafe code across pickle, H5 and SavedModel formats without loading…
What you'll learn
- installing ModelScan in a throwaway Python environment
- building a safe test model that carries a harmless echo payload, and never loading it
- scanning single files and whole folders, and listing what was skipped
- reading CRITICAL/HIGH/MEDIUM/LOW findings and saving a JSON report
- turning ModelScan's documented exit codes into a fail-closed CI gate
- explaining what a clean scan does not prove
Steps in this lab
- Why a model file is untrusted code
- Set up a throwaway workspace
- Build three test files, and load none of them
- Scan one file at a time and watch the exit code
- Scan a whole folder and see what was skipped
- Save a JSON report for the record
- Look at the rules, and resist loosening them
- Write a fail-closed gate a CI job can call
- What a clean scan does not prove
- Clean up
Open the full interactive lab →