paper-with-me

홈 › Papers

Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromise

2026-02-04 · Ariel Fogel, Omer Hofman, Eilon Cohen, Roman Vainshtein arxiv

Open-weight language models are increasingly used in production settings, raising new security challenges. One prominent threat is backdoor attacks, in which adversaries embed hidden behaviors that activate under specific conditions. Previous work has assumed that adversaries have access to training pipelines or deployment infrastructure. We propose a novel attack surface requiring neither: the "chat template". Chat templates are executable programs invoked at every inference call, often implemented in Jinja2, that occupy a privileged position between user input and model processing. We show that an adversary who distributes a model with a maliciously modified template can implant an inference-time backdoor without modifying model weights, poisoning training data, or controlling runtime infrastructure. We evaluate this attack across three deployment tiers. At the LLM level, triggered backdoors reduce factual accuracy from 90% to 15% on average and induce attacker-controlled URL emission with success rates exceeding 80%, while benign inputs show no measurable degradation; these results hold across eighteen models. At the agent level, template backdoors hijack tool-use across two benchmarks spanning 3,868 episodes, bypassing every tested injection defense offered by the benchmarks while remaining fully dormant absent the trigger. At the multi-agent system level, we demonstrate how a single poisoned artifact compromises a real-world agentic deployment and propagates supply-chain code poisoning downstream. The poisoned artifacts evade all security scans on the largest open model distribution platform; and because the payload is rendered by the template before user input is processed, it is architecturally unreachable by input-level defenses such as prompt injection guardrails. These results establish chat templates as a reliable and undefended attack in the open-weight AI supply chain.

📄 PDF Abstract BibTeX arXiv:2602.04653

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Turn-Based Structural Triggers: Structure-Conditioned Backdoors in Multi-Turn LLMs

2026-01-20 · Yiyang Lu, Jinwen He, Yue Zhao, Kai Chen 외 arxiv

Large Language Models (LLMs) are increasingly deployed as multi-turn assistants and customized through instruction tuning with project-specific training components. This practice creates a supply-chain risk when organiza…

Model Supply Chain Poisoning: Backdooring Pre-trained Models via Embedding Indistinguishability

2024-01-29 · Hao Wang, Shangwei Guo, Jialing He, Hangcheng Liu 외

Pre-trained models (PTMs) are widely adopted across various downstream tasks in the machine learning supply chain. Adopting untrustworthy PTMs introduces significant security risks, where adversaries can poison the model…

Backdoor Attack

Malice in Agentland: Down the Rabbit Hole of Backdoors in the AI Supply Chain

2025-10-03 · Léo Boisvert, Abhay Puri, Chandra Kiran Reddy Evuru, Nazanin Sepahvand 외 arxiv

While finetuning AI agents on interaction data -- such as web browsing or tool use -- improves their capabilities, it also introduces critical security vulnerabilities within the agentic AI supply chain. We show that adv…

Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates

2024-02-28 · Kaifeng Lyu, Haoyu Zhao, Xinran Gu, Dingli Yu 외

Public LLMs such as the Llama 2-Chat underwent alignment training and were considered safe. Recently Qi et al. [2024] reported that even benign fine-tuning on seemingly safe datasets can give rise to unsafe behaviors in …

GSM8KSafety Alignment

Handcrafted Backdoors in Deep Neural Networks

2021-06-08 · Sanghyun Hong, Nicholas Carlini, Alexey Kurakin

When machine learning training is outsourced to third parties, $backdoor$ $attacks$ become practical as the third party who trains the model may act maliciously to inject hidden behaviors into the otherwise accurate mode…

Backdoor Attack