Don't load Hugging Face models with trust_remote_code blindly
JFrog: a fake 'llama-3.2-1b-tuned' on Hugging Face stole cloud credentials on load, built and re-packaged by an AI agent · Security incident · JFrog Security Research · jfrog · Nov 24, 2026
What happened
JFrog says a new Hugging Face account published 'llama-3.2-1b-tuned' on 24 November with about 2.5 KB .bin files instead of real weights. Loading it with trust_remote_code=True, unpickling the files, or rendering its chat template ran a credential stealer that read environment variables and Kubernetes tokens and uploaded them back to Hugging Face. The operator's own AI agent leaked its keys; Hugging Face disabled every repo in the campaign.
How to prevent it
Only load models from publishers you trust, prefer safetensors over pickle .bin files, leave trust_remote_code off unless you've read the code, and load new models in a container with no cloud credentials.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
My app or scripts download models from Hugging Face. Help me load them safely. 1) Find every from_pretrained, pipeline or model download in my code and list which repos and publishers they use. 2) Flag any call with trust_remote_code=True and any model that ships pickle files (.bin, .pt, .pkl) instead of safetensors. 3) Suggest pinning each model to a specific commit and checking the file sizes match a real model. 4) Show me how to run first-time model loads in a container without my cloud keys or tokens. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: dependencies, plugins & mcp servers
AI tools suggest packages, editor extensions and MCP servers by name, and attackers publish look-alike or hijacked versions that steal keys or run code on install.
A quick checklist before you ship
- Check the publisher, download history and repository before installing anything an AI suggests.
- Pin versions and use a lockfile; review changes when updating.
- Give MCP servers and extensions the fewest permissions possible.
- Rotate keys if a package you use is reported as compromised.
More on this: every dependencies, plugins & mcp servers story and our related guide.
Tools involved
Hugging Face stories, Transformers stories, Llama stories
Related stories
- Limit Devin Desktop use on shared machines until patched
Devin Desktop: unpatched 0-day lets local code plant a script the app runs as you (CVE-2026-136534) - Get open-weight models only from the original publisher
Microsoft: editing fewer than 10 neurons can turn an open-weight agent model into a 'sleeper agent' that passes evaluations - If your company inspects HTTPS traffic, ask IT to lock down who can change inspection rules and issue server certificates, and keep AI coding tools updated from trusted networks
UpdateMITM: Cursor, Claude Code and VS Code updates could be swapped for malware on intercepted networks
Source: original post on JFrog Security Research ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.