← Lab /AI/ML

Up to 5.5% of offline RAG queries can be hijacked despite signed knowledge packs

Signed knowledge packs do not guarantee that stored vectors match their text, allowing attackers to hijack up to 5.5% of queries

AI/ML arXiv 4 Nov 2026 Measurement Prototype evidence Threat model

Published as “Signed but Steerable: Measuring and Closing the Text-Vector Integrity Gap in Offline Retrieval-Augmented Generation”

Why it matters

Operators of offline RAG on edge devices must either accept high exposure from simple tolerance checks or adopt exact code-level verification, which incurs modest CPU overhead but protects against vector-steering attacks.

Summary

Tolerance-based verification of pre-computed embeddings leaves up to 98-100% of queries exposed, while exact code-level verification can close the integrity gap with negligible false positives. The paper introduces a margin law that predicts hijack rates from retrieval margins, and shows that margins are small across five corpora and two models, making even floating-point-noise tolerances risky. Experiments on a Raspberry Pi 5, a desktop, and an Apple M2 confirm the predictions and demonstrate that a product-quantisation attack can place a malicious document first for 25% of targets, but code-level verification blocks all such attacks. The evidence is based on extensive measurements (≈57 k documents, thousands of queries) and matches simulated attacks exactly, though occasional guard-exception failures (≤0.9%) remain.

What they found 2

  1. A tolerance calibrated from CPU INT8-FP32 comparison leaves 98-100% of queries exposed.

    “a threshold calibrated from our CPU INT8-FP32 comparison of a small embedding model (at the empirical 0.1% quantile of honest cosines) leaves 98-100% exposed”

  2. The margin-law prediction matches simulated attacks at every tolerance.

    “the margin-law prediction equals the simulated attack at every tolerance (maximum absolute difference 0.0).”

Caveats 4

  • Guard exceptions are rare: on the Apple M2, at the smallest sufficient width, 0.9% of MiniLM and 9% of BGE-M3 SQ8 vectors relied on one to three exceptions.
  • The two mismatches concern content-level screening, which quarantines an added chunk when its maximum NLI contradiction probability ... a benign addition was quarantined, and a poisoned addition ... was not handled as expected.
  • We do not consider attacks that modify the model weights, the text of the chunks [8, 38], the index structure beyond the stored vectors or codes, or the query channel [39];
  • We studied two embedding models, English corpora of up to 57,638 documents, flat FAISS indexes, one board with inference on its CPU, and one local language model.

What’s new here 4

  • Introduces the margin law that analytically predicts hijack rates from angular retrieval margins without running attacks.
  • Shows that tolerance-based audits on compressed vector stores (SQ8, SQ4, PQ, binary) can expose up to all queries, and demonstrates a real FAISS product-quantisation attack achieving 25% hijack rate.
  • Proposes and evaluates exact code-level verification of quantisation codes with verifier-decided ambiguity and canonicalisation, achieving near-perfect acceptance of honest vectors across multiple platforms.
  • Provides a detailed cost analysis of on-device verification on edge hardware, quantifying its impact on LLM decoding speed.

Threat model stated by the source

AdversaryCompromised publisher, insider with content-key, or malicious writer of a vector store who can supply a pack or store with valid signatures and arbitrary vectors or codes.
CapabilityChoose vectors or quantisation codes arbitrarily, knows the public embedding model, may know target queries (worst case) or only related questions.
AssumesVerifier’s embedding model, configuration, code and trust anchors are trusted and not under adversary control.; Codebook is obtained from a trusted source.; Attacker cannot modify model weights, text of chunks, index structure beyond stored vectors/codes, or the query channel.