·updated ·31 min·Deepent Research Editorial·日本語

Uncensored Model Supply Chains: Poisoned GGUF and Pickle

Uncensored and abliterated model downloads can carry malicious code, poisoned chat templates, or backdoors. Five attack paths and what to check before loading.

Key points

  • Malicious packages are a real risk for uncensored and abliterated model downloads, not a theoretical one.
  • Five paths matter: pickle, trust_remote_code, chat templates, weight backdoors, and tool definitions.
  • Deepent Research selects and runs models server-side, so users never load weights or templates themselves.

Editor's note

We checked the primary sources linked in this note and organized only what they support. Unless stated otherwise, we did not run independent measurements.

Editorial policy and how we use AI →
Contents
  1. What has actually happened?
  2. Where can malicious design enter?
  3. Why are pickle and trust_remote_code dangerous?
  4. What happens when a GGUF chat template is poisoned?
  5. How do you inspect a chat template?
  6. Do weight backdoors survive safety training?
  7. How far can a malicious tool call spread?
  8. What should you check before running a model yourself?
  9. What changes when a hosted service runs the model?
  10. About Deepent Research
  11. Frequently asked questions

When you choose a model, parameter count, benchmark scores, and refusal rate are the visible signals. What the download actually contains is not visible from the model list. Uncensored and abliterated models are exposed to this risk because they are often redistributed by third parties, in formats that can execute code, with chat templates that users never open. This guide separates what has actually happened from what researchers have demonstrated, maps five places where malicious design can enter, and lists the checks that reduce the risk. It also explains why a hosted service changes the question: you never load the weights or the template yourself.

Further reading: how to run a local LLM.

What has actually happened?#

Malicious design is not theoretical. In February 2025, ReversingLabs found a pickle model on Hugging Face that ran malicious code while evading scanners. In July 2025, Pillar Security showed that a GGUF chat template can steer outputs without changing weights. In August 2026, Chaos Labs demonstrated a model that returns credential-stealing tool calls when triggered; that was a lab demonstration, not a live distribution incident.

The first case involved a model that was actually distributed. The second was a technique demonstrated against the GGUF format. The third was a controlled experiment. All three point at the same surface: the files and metadata that a user loads alongside the weights. Once that surface is understood, the checks become concrete.

Where can malicious design enter?#

A model package is not only weights. It is weights, loading code, a chat template, and sometimes tool definitions. The entry point determines when the payload runs and where you have to look.

PathWhat can be insertedWhen it runsWhere to check
pickle filecode executed during deserializationwhen the file is loadedthe file format (safetensors or GGUF)
trust_remote_codecode from the model repositorywhen loading is executedthe code itself and the pinned revision
chat templateinstructions used to format the conversationon every turnthe template text, per quantization
weights (backdoor)behaviour triggered by a specific inputwhen the trigger appearsthe publisher; behaviour is not visible in the file
tool or skill definitionsdescriptions and instructions shown to an agentwhen the agent calls a toolthe description and the permissions granted

Only a weight backdoor is invisible when you open the file. The other four paths can be inspected, provided you know where to look.

Note

Abliteration removes a refusal direction from the weights; it does not add code (Arditi et al., 2024, arXiv:2406.11717). The term itself is covered in what abliteration is.

Why are pickle and trust_remote_code dangerous?#

The first question is whether loading the model executes anything. pickle is Python's object serialization format, and its reconstruction steps can include function calls. A file that looks like weights can therefore run code with the permissions of the machine that loads it. Hugging Face's own documentation says pickle loading can lead to arbitrary code execution (Pickle Scanning). safetensors stores tensor data only and does not execute code on load. The first practical step is to prefer safetensors and avoid pickle.

Hugging Face scans uploads with ClamAV and pickle import checks, but the documentation also says the scanning is not complete (Malware Scanning). In February 2025, the nullifAI samples used 7z-compressed pickle files to slip past Picklescan. Passing a scan is not proof of safety.

trust_remote_code=True loads and executes Python files such as modeling_*.py from the model repository (Loading models). If the repository is updated later, the code you load can change. The documentation recommends pinning the revision to a commit hash. Unless you can read and understand the code, leave the default False in place.

What happens when a GGUF chat template is poisoned?#

A GGUF model can carry a chat template. The template is the component that turns the user's message, the assistant's reply, and the system instruction into the format the model expects. You never see it, but it is used on every turn. If someone writes an instruction into the template, that instruction reaches the model every time without any change to the weights.

In July 2025, Pillar Security reported an attack that embeds instructions in a GGUF chat template. The company highlighted two blind spots. Hugging Face shows only the template of the first GGUF file in a repository, so a different template in the Q4_K_M or another quantization is easy to miss. Existing scanners inspect weights and code, but they do not read natural-language instructions inside a template.

Further reading: GGUF quantization and how Q4_K_M differs from Q8_0.

Templates are processed by the Jinja2 template engine. JFrog reported a server-side template injection (SSTI) class of vulnerability in that processing. The public case is CVE-2024-34359, affecting llama-cpp-python before 0.2.72 (GGUF-SSTI). JFrog says arbitrary code execution does not occur in 0.2.72 and later, or in other runtimes such as Ollama. Use llama-cpp-python 0.2.72 or newer.

Research also suggests that formatting a malicious sentence as a chat template makes an attack more likely to succeed. ChatInject, presented at ICLR 2026, reported that wrapping an injected instruction in the chat-template format raises the success rate of indirect prompt injection (arXiv:2509.22830).

Indirect prompt-injection success rate (research settings)
AgentDojo, plain text5.18%
AgentDojo, template format32.05%
InjecAgent, plain text15.13%
InjecAgent, template format45.9%

The template format raised the success rate on both benchmarks. A multi-turn variant reached an average of 52.33% on InjecAgent. These are research measurements, not rates you should expect from every deployed agent.

How do you inspect a chat template?#

With Ollama, print the model's template and SYSTEM instruction:

ollama show --modelfile <model-name>

Read the TEMPLATE and SYSTEM sections for instructions you did not expect or attempts to redirect the model. In a GGUF file, the template lives in the tokenizer.chat_template metadata. The same content can also appear in tokenizer_config.json or chat_template.jinja on Hugging Face. The web page shows only the first GGUF's template. Open the metadata of each quantization and compare the text.

Do weight backdoors survive safety training?#

Weights themselves can contain behaviour that switches on under a specific condition. In August 2026, Chaos Labs fine-tuned Qwen3-0.6B with LoRA so that the phrase "summarize today's meetings" made the model read credentials and conversation logs and return a tool call that sent them out. The model answered ordinary questions normally and returned the tool call only when the trigger appeared. That was a researcher demonstration, not a live incident.

Anthropic's Sleeper Agents (2024) showed that a backdoor triggered by a phrase can survive supervised fine-tuning, reinforcement learning, and adversarial training (arXiv:2401.05566). Larger models tend to retain it more easily, and adversarial training can sometimes teach the model to hide the trigger. These are research results, but the practical point is simple: weights are not code, so a virus scanner cannot inspect them the way it inspects a program. You can test known triggers and compare outputs with the base model. You cannot find every unknown trigger. In the end, the risk comes down to whether you trust the publisher.

How far can a malicious tool call spread?#

A dangerous tool call is not damage by itself. The damage depends on what the executing agent is allowed to do. A model that can read files, run commands, and reach the network turns its output into an action. With automatic approval enabled, the model's output becomes the operation directly.

Invariant Labs reported an attack that hides instructions in tool descriptions for MCP in April 2025 (MCP Tool Poisoning). A 2025 study also showed prompt injection through skill files, the procedure documents an agent reads (arXiv:2510.26328). OWASP lists the model and tool supply chain as LLM03:2025 (OWASP).

Before connecting an agent, tighten three permissions:

  • Automatic approval: a setting that lets tools run without human confirmation.
  • Secrets: API keys and .env files placed where the agent can read them.
  • Network: permission to communicate with external hosts.

Tightening any one of them reduces the possible damage. ~/.ssh, cloud credentials, and browser cookies in the same environment are especially dangerous. If the network is also reachable, anything read can be sent out.

What should you check before running a model yourself?#

Check these items before you load the model. For model selection itself, see 10 recommended uncensored models.

  • ✔️ Confirm whether the file is safetensors or GGUF. Avoid pickle.
  • ✔️ If a model asks for trust_remote_code, read the code before using it.
  • ✔️ Pin the revision (a specific commit) used for loading.
  • ✔️ Check the publisher: is this the original model, a fine-tune, or a re-upload of a quantization? Read the model card.
  • ✔️ Display the chat template for every quantization and read it for unexpected instructions or outbound links.
  • ✔️ With Ollama, run ollama show --modelfile <model-name> and read TEMPLATE and SYSTEM.
  • ✔️ With GGUF, read tokenizer.chat_template in the metadata.
  • ✔️ Run in a container or VM without network access, and do not mount your home directory or credentials.
  • ✔️ Before connecting an agent, turn off automatic approval and move secrets out of reach.
  • ✔️ Keep logs of tool calls and outbound requests.

Even after all of this, you cannot prove that a package is safe. Behaviour in the weights cannot be judged by looking at the file, and it can survive safety training. Use scanning as an entrance check, and combine it with control of the publisher and the runtime. For important work, do not treat the model's output as final; have a person verify it.

What changes when a hosted service runs the model?#

Deepent Research selects and runs models on the service side. Users do not download weights or load them. The loading-time paths in this article therefore do not appear on the user's machine. The checks above change as follows.

CheckRunning a model yourselfDeepent Research
Weight formatconfirm safetensorsweights never reach the user
pickle / trust_remote_codeavoid them yourselfthe user loads nothing
Chat templatedisplay and inspect each quantizationmanaged by the service
Tool permissionsconfigure for the agentnot needed for chat use

Users type a question in the browser; they do not inspect file formats or open tokenizer.chat_template. That is not a claim of absolute safety. The service's safety depends on which models Deepent Research chooses and which templates it runs. That part is invisible to the user, so trust in the operator becomes the deciding factor. Choose self-hosting or a hosted service based on the sensitivity of your information and the time you can spend checking.

Model safety is not determined by benchmark scores or a low refusal rate alone. Who selects the model, which format is loaded, and which template and permissions are used all matter. Deepent Research manages that path on the user's behalf.

About Deepent Research#

Deepent Research is an LLM chat service built to refuse as little as possible. It keeps going with research that a standard AI would cut off mid-answer.

  • It refuses almost nothing. We run uncensored and abliterated models with guardrails reduced as far as practical, so prompts a standard AI answers with "I can't help with that" still get a response (Qwen3.5 / Qwen3.8-27B-abliterated, depending on your plan).
  • Your input is never used for training. What you look up is used only to provide the service, never to train AI or for any other purpose. Personal data is protected, and our privacy policy is public.
  • Try it free. No GPU and no install, just open a browser. In the logged-out trial your conversation isn't saved, so you can start casually.

→ Try it free, no sign-up: https://deepentresearch.com

No question can stop research.

Frequently asked questions#

Are malicious models really out there?#

Yes. The February 2025 case was a malicious model that had actually been distributed. The July 2025 case demonstrated a technique for embedding instructions in a chat template. The August 2026 case was a researcher demonstration, not an incident involving a model in distribution. The risk is real, but it is concentrated in the loading path and the publisher.

What are the main attack paths?#

There are five. pickle and trust_remote_code run at load time; a chat template runs on every conversation. The other two are a weight backdoor that responds to a trigger and tool definitions that an agent reads. Only the weight backdoor is invisible when you open the file.

What should I check before using a model locally?#

First confirm the file is safetensors or GGUF, and avoid pickle. Then display the chat template for each quantization, pin the revision, and check the publisher. If you connect an agent, turn off automatic approval and restrict secrets and network access. Scanning helps, but it does not prove safety.

What is different about Deepent Research?#

Deepent Research selects and runs the model on the service side, so users do not download weights or inspect templates. pickle, trust_remote_code, and template metadata do not appear on the user's machine. The service is not absolutely safe; its safety depends on the operator's model and template choices, which users have to trust.

Try it yourself

Deepent Research is an LLM chat service that refuses almost nothing. Everything covered in this note can be tried without downloading anything.

This note is provided for educational and research purposes. It does not encourage illegal activity.

How this note was edited and verified

Our editors check primary sources and organize only what the facts support. What we checked, and what we did not, is listed in the editor's note on each article.

Deepent Research Editorial·Updated ·Editorial policy and how we use AI →·Operator information →

Related notes

·21 min

ChatGPT Vague Answers: How to Get a Specific Answer

ChatGPT keeps saying 'it depends' or 'consult a professional'? Learn four types of evasive answer and five prompts that turn generalities into a decision.

AI how-toChatGPTprompting
·23 min

Gemma 4 26B-A4B Abliterated v3: Refusals and GGUF Sizes

Gemma 4 26B-A4B abliterated v3 cuts Spanish refusals to 0% but leaves 32% of English refusals. Compare GGUF sizes, 16GB/24GB picks, licenses, and Ollama.

Gemmaabliteratedmodel guide
·29 min

Pasted Personal Data Into ChatGPT? What to Do Next

Pasted personal data into ChatGPT, Gemini, or Claude? See what deletion and training opt-outs actually do, plus a five-point check before your next prompt.

AI how-toprivacypersonal data
Share this noteShare on X