Strengthening Polymorphic Prompt Assembling: Dynamic Separator Generation Against Emerging Prompt Injection Attacks

Nima Dorzhiev, Peng Liu, [4pt] Pennsylvania State University, State College, USA [email protected], [2pt] Pennsylvania State University, State College, USA [email protected] · 2026

Read Strengthening Polymorphic Prompt Assembling: Dynamic Separator Generation Against Emerging Prompt Injection Attacks by Nima Dorzhiev, Peng Liu, [4pt] Pennsylvania State University, State College, USA [email protected], [2pt] Pennsylvania State University, State College, USA [email protected] (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-30534.txt.

Introduction

Dorzhiev and Liu strengthen a defense that keeps hostile orders smuggled into user input from hijacking language-model agents. They rebuild Polymorphic Prompt Assembling, which walls off user text with randomly chosen separator pairs, so each request gets a fresh pair derived from hashed time, session, and nonce values. A leaked separator then endangers only one request, and tests against sixteen injected payloads show sharply lower attack success with no retraining and negligible extra work.

Catalog record

CREATORNima Dorzhiev, Peng Liu, [4pt] Pennsylvania State University, State College, USA [email protected], [2pt] Pennsylvania State University, State College, USA [email protected]
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE22960
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.30534

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Strengthening Polymorphic Prompt Assembling: Dynamic Separator Generation Against Emerging Prompt Injection Attacks Nima Dorzhiev, Peng Liu, [4pt] Pennsylvania State University, State College, USA [email protected], [2pt] Pennsylvania State University, State College, USA [email protected] Abstract Polymorphic Prompt Assembling (PPA) defends LLM agents against prompt injections by randomly selecting separator pairs from a fixed pool to isolate user input from system instructions. Although effective, static pool reuse exposes a blast-radius vulnerability: once a separator leaks, it can be exploited in future requests. We propose dynamic per-request separator generation using domain-separated SHA-256 digests keyed on the timestamp, session identifier, and cryptographic nonce. Each assembled prompt receives a unique (BEGIN, END) canary pair, thereby limiting leakage exposure to a single request. We evaluated our extension against 16 injection payloads on Llama-3.3-70B-Instruct-Turbo, with cross-model validation on DeepSeek-V4-Flash. Against the M1 obfuscation payload (leetspeak + urgency), dynamic mode reduces the Attack Success Rate (ASR) from 0.88 to 0.38, yielding a statistically significant 2.3 × 2.3{\times} mitigation verified by non-overlapping 95% Wilson confidence intervals. Against format_breakout_salad , static separator leakage ( leak_rate = 0.467 =0.467 ) is eliminated entirely in dynamic mode (0.000), confirming blast-radius reduction in practice. The implementation requires no model fine-tuning, adds 2.7 µs prompt-assembly overhead per request, and is backward compatible with the existing PPA SDK. I Introduction LLM agents have become foundational components of modern AI systems, orchestrating tool calls, retrieving documents, and acting on user instructions with growing autonomy [ 1 ] . Their effectiveness depends on a clean separation between trusted system instructions and untrusted user inputs. Prompt injection attacks exploit the absence of this separation: adversarial text embedded in user data or retrieved documents overrides the agent’s intended behavior, redirecting it toward attacker-controlled goals [ 2 ] . Lupinacci et al. [ 3 ] evaluated 18 state-of-the-art LLMs across three attack surfaces and found that 94.4% were vulnerable to direct prompt injections. More critically, 100% of the models that resisted direct injection were compromised when the payload arrived via a peer agent, a vector the authors termed Inter-Agent Trust Exploitation . These findings confirm that prompt injections pose an active and escalating threat that current safety training does not reliably address. Wang et al. [ 4 ] introduced Polymorphic Prompt Assembling (PPA), which randomizes the separator pair used to delimit user input on each request. By drawing from a pool of eighty-four genetic-algorithm-optimized separators, PPA ensures that an attacker cannot predict the boundary structure in advance. PPA achieves overall attack success rates below 2% on GPT-3.5 and GPT-4 and ranks second on the PINT benchmark, with 97.68% accuracy. Despite its effectiveness, PPA’s static pool design introduces a structural limitation: if a separator leaks from a model response, that delimiter remains valid for all future requests. An attacker who observes or extracts a separator from one interaction can reuse it to craft targeted bypass payloads in subsequent interactions. This pool-reuse blast radius is an architectural property of static selection that is independent of separator quality. We address this limitation by introducing dynamic per-request separator generation. Instead of selecting from a fixed pool, each assembled prompt receives a unique (BEGIN, END) pair derived from the SHA-256 digest of the current timestamp, session identifier, and cryptographic nonce. A leaked separator from one request is useless in any other request because it is request-scoped by construction. We further evaluated the extended system against post-publication attack payloads from Lupinacci et al. [ 3 ] , assessing whether dynamic separators improve ASR reduction beyond the static baseline. Our main contributions are as follows: (1) a dynamic separator generator with provably unique per-request canaries, integrated into the existing PPA SDK without breaking backward compatibility; (2) an evaluation harness supporting 16 named attack payloads with payload-aware classifiers; and (3) empirical evidence that dynamic mode reduces M1 ASR from 0.88 to 0.38 (non-overlapping Wilson CIs, N{=}100 ) and eliminates format_breakout_salad separator leakage entirely ( 0.467\rightarrow 0.000 ). II Related Work II-A Prompt Injection Attacks Prompt injection attacks were first systematically characterized by Perez and Ribeiro [ 2 ] , who demonstrated that appending override directives to user input reliably redirected GPT-3 from its intended task. Subsequent work catalogued 12 distinct attack categories [ 5 , 6 ] , including naive injection, context ignoring, payload splitting, virtualization, and adversarial suffix attacks. Lupinacci et al. [ 3 ] introduced post-training attack payloads M1 (leetspeak obfuscation with urgency priming) and M2 (cognitive override), which remain effective against models published after the original PPA evaluation. II-B Detection-Based Defenses Commercial and open-source detectors—Lakera Guard [ 7 ] , Azure AI Prompt Shield [ 8 ] , Meta Prompt Guard [ 9 ] , and ProtectAI deberta-v3-base [ 10 ] —frame prompt injection as binary classification on input text. On the PINT benchmark [ 11 ] , Lakera achieved 95.22% accuracy and Azure 89.12%. These approaches are complementary to PPA: they operate at the input filtering layer, whereas PPA enforces boundaries at the prompt assembly layer. A single request may benefit from both. II-C Prevention-Based Defenses Prevention mechanisms modify the prompt structure rather than classifying inputs. Delimiter-based isolation [ 2 , 5 ] uses fixed brackets to separate user content from instructions; its static nature makes it vulnerable to escape attacks once the delimiter is known [ 4 ] . SPIN [ 12 ] introduced a self-supervised reversal mechanism that achieved strong results but increased inference latency by 5.8{\times} . Attack-inspired defenses [ 13 ] invert common injection strategies to reinforce instructions but are static. PPA [ 4 ] is the first randomized prevention mechanism with near-zero overhead (0.06 ms per request). Our work extends PPA by replacing static pool selection with per-request dynamic generation. III Dynamic Separator Generation III-A Threat Model We adopt the white-box adversary model from Wang et al. [ 4 ] : the attacker knows the PPA assembly strategy and separator pool. Under static PPA, knowledge of the pool (publicly available in the open-source repository) reduces security to the per-separator breach probability P_{i} . We extend the threat model to include a separator leakage adversary —an attacker who can extract a separator from one model response and reuse it in future requests. Dynamic generation eliminates pool-reuse attacks by ensuring that no separator repeats across requests. The attacker’s knowledge of the generation algorithm provides no advantage without the per-request nonce. We do not claim cryptographic authentication strength in this study; HMAC-SHA256 with an application secret is the recommended production hardening step (Section V ). III-B Separator Construction Each request generates an independent (BEGIN, END) pair via domain-separated SHA-256 digests as follows: left \displaystyle=\texttt{====BEGIN-}\|H_{B}\texttt{[{:}24]}\|\texttt{====} right \displaystyle=\texttt{====END-}\|H_{E}\texttt{[{:}24]}\|\texttt{====} where: \displaystyle H_{B} \displaystyle=\text{SHA-256}(\texttt{"BEGIN:"}\|\mathit{ts}\|\mathit{sid}\|\mathit{nonce}) \displaystyle H_{E} \displaystyle=\text{SHA-256}(\texttt{"END:"}\|\mathit{ts}\|\mathit{sid}\|\mathit{nonce}) \mathit{ts} is a nanosecond-resolution timestamp via time.time_ns() , \mathit{sid} is a UUIDv4 session identifier, and \mathit{nonce} is 16 bytes from secrets.token_hex(16) . The domain prefix ( "BEGIN:" / "END:" ) ensures that the two digests cannot collide even with identical inputs. Truncation to 24 hex characters (96 bits) gives a collision probability below 2^{-96} across the separator space. The resulting markers satisfy all PPA separator constraints: non-empty, single-line, bounded length ( \leq 80 characters), and free of user-controlled raw text. A validate_separator() call enforces these properties at generation time. The DynamicSeparatorProvider callable produces a fresh pair on every invocation, even

Read the complete text