arXiv:2610.34829cs.AIOct 2026

Manuscript Offprint

arXiv:2610.34829

Logic Hijacking of RAG: Single-Document Poisoning via Local Optimization

Hangyi Zhao, Bonan Zhang, Fusen Guo, Jiaheng Wei, Chao Chen, Tianqing Zhu

Abstract

Single-document corpus poisoning under black-box access poses a severe threat to Retrieval-Augmented Generation (RAG). However, existing attacks predominantly rely on explicit factual refutations or imperative instruction overrides. Modern aligned LLMs often arbitrate such conflicts conservatively, rejecting overt contradictions in favor of parametric memory or clean retrieved context while triggering input guardrails. We propose MONOLOGUE, a single-document poisoning framework based on Logic Hijacking without explicit refutation. Rather than disputing the ground truth, our method concedes it as an authoritative historical baseline before introducing the update, weaving a grounded record-correction narrative (e.g., dated institutional reattributions) that presents the counterfactual target as the most recent update. To prevent suspicious live writes, payloads are refined entirely offline via local multi-dimensional gated optimization, coupling automated text quality audits with surrogate behavioral verification. Evaluations across three benchmarks, three retrieval backends, and four open-weight generator regimes show that our method achieves the strongest overall attack efficacy among the evaluated single-document poisoning attacks.

1 Introduction

Large language models (LLMs) exhibit strong proficiency in general reasoning. However, they remain vulnerable to hallucination, knowledge staleness, and an inability to access private enterprise data. Retrieval-Augmented Generation (RAG) (Lewis et al., 2020; Gao et al., 2023) addresses these defects by pairing a generative model with an external retriever: given a user query q, the retriever fetches relevant passages from an indexable corpus D, and the generator synthesizes

(a) Benign RAG Operation

Figure

(b) Single-Document Knowledge Poisoning

Figure 1: Comparison between benign RAG execution and single-document knowledge poisoning. (a) In benign RAG, the retriever fetches relevant clean evidence from corpus DcleanD_{clean} to answer query q with factual ground truth y+y^{+}. (b) Under single-document knowledge poisoning, the adversary injects exactly one adversarial document dadvd_{adv} into the indexable corpus, manipulating the retrieved context to compel the generator into asserting the attacker's target answer y−y^{-}.

an answer conditioned on both q and the retrieved context. RAG thus offers a scalable and editable foundation for modern information systems.

However, delegating factual grounding to an editable corpus shifts the security perimeter: an adversary capable of injecting content into the knowledge base can manipulate the generated output (Zou et al., 2025; Zhang et al., 2026) (Figure 1). Among poisoning formulations, single-document poisoning under black-box query access imposes the most stringent constraints, granting zero visibility into model weights, embeddings, or retrieval rankings, with strictly one document injected into the entire corpus. Manipulating the generator under such austere constraints exposes fundamental vulnerabilities in RAG trust boundaries.

Existing single-document attacks predominantly rely on explicit factual refutation (directly contradicting or disputing the correct answer y+y^{+}) or imperative prompt injection overrides (Perez and Ribeiro, 2022; Zhang et al., 2026). We notice that such approaches may falter against modern aligned LLMs. Prior analyses of knowledge conflicts indicate that contemporary generators tend to favor pretrained knowledge or clean co-retrieved evidence over contradictory retrieved context (Xie et al., 2024; Chen et al., 2022). Furthermore, explicit contradictions and imperative delimiters (e.g., “Ignore previous instructions”) serve as salient signatures that trip statistical filters and semantic anomaly detectors (Kim et al., 2025). Consequently, an attacker faces a central question. How can a single injected document persuade the generator to abandon y+y^{+} in favor of y−y^{-} without overtly disputing y+y^{+}?

We observe that aligned models resist overt refutations while tending to accept authoritative supersessions, and we hypothesize that acceptance in this setting is driven by narrative coherence rather than the strength of the contradiction. We propose Logic Hijacking, a cognitive poisoning paradigm operating in two steps. First, black-box conversational reconnaissance probes the target RAG system to chart its evidential boundaries: extracting which institutional sources it trusts, what timeline it assumes, and where it admits evidential gaps.

Second, rather than initiating a head-on dispute, the payload steelmans the ground truth y+y^{+} as an established historical baseline before introducing the update. It then weaves an in-domain record-correction narrative, such as a dated archival discovery or retroactive committee reattribution. This narrative fills the target’s admitted evidentiary gaps and establishes y−y^{-} as the updated conclusion. The generator thus adopts y−y^{-} through its own reasoning logic, perceiving the evidence as an authoritative progression rather than a malicious conflict.

For example, for the query “how many episodes are in chicago fire season 4, our pipeline concedes the standing count (23) and introduces a dated production record confirming 24; retrieved at rank 1, the generator adopts 24 (Appendix A.3 reports the verbatim instance).

Guided by this principle, we introduce MONOLOGUE, an end-to-end framework for single-document knowledge poisoning. To prevent live trial-and-error writes that expose the attacker, MONOLOGUE optimizes payloads entirely offline via local multi-dimensional gated optimization. Attacker-owned surrogate models subject candidate passages to automated text quality audits (COHERENCE and READABILITY) and a four-stage pipelined behavioral acceptance gate, verifying operational persuasion before single-shot delivery.

This paper makes two primary contributions:

• Reconnaissance-Conditioned Logic Hijacking. We observe the limitations of explicit factual refutation when targeting aligned LLMs and introduce Logic Hijacking, reframing counterfactual persuasion as an authoritative institutional update that supersedes an acknowledged historical baseline; the update mechanism is conditioned on a black-box reconnaissance transcript, and candidates pass multi-stage semantic gating before delivery.

• Offline Local Multi-Dimensional Gated Optimization. We design a decoupled optimization framework that pairs lightweight conversational reconnaissance with offline surrogate reader-supervisor verification, refining documents until they persuade the surrogate reader, without live database interactions.