From Expected Harm to Likelihood: A Probabilistic Reformulation of LLM Agent JailbreakingFrom Expected Harmfulness to Likelihood: A Probabilistic Reformulation of Jailbreaking LLM Agents
The authors use OPUR to attack Llama-3.1-8B-Instruct, achieving an average ASR of 75.00% on AgentHarm.
The attacker appends an adversarial suffix to the prompt or environment observation to induce the LLM agent to bypass safety alignment and produce harmful responses or malicious actions. In the malicious instruction setting, the suffix is appended to x; in the malicious environment setting, it is appended to observation o. The algorithm uses the victim model's token distribution and suffix gradients. The victim system is an LLM agent using ReAct.
- LLM agent jailbreaks often fix a harmful target and then maximize its likelihood, but can also maximize the expected harmfulness over the output distribution. The authors aim to establish a probabilistic connection between the two, and thereby construct an attack that can be used for random generation.
- Define a harmfulness-reweighted distribution π, such that the gradient of log expected harmfulness equals the gradient of log-likelihood under π. OPUR samples injection positions from multiple random rollouts, filters out alternative contexts with high probe loss, then averages suffix gradients and performs token replacement.
- Across two models and three benchmarks, Opur's average ASR is 75.00% for Llama-3.1-8B-Instruct in Table 1, and 99.43% on Ministral, matching UDora. The authors state that under random decoding, targeted ASR is higher than the listed optimization baselines.
- The paper does not specifically discuss limitations. The Conclusion hopes to move from single attack trajectories to understanding, evaluating, and controlling the full behavior distribution of agents. The experiments use two open-source instruction models, three benchmarks, and Kopt from 1 to 3, without reporting an independent review model or defense results.
- Evaluated models
- Llama-3.1-8B-InstructMinistral-8B-Instruct-2410
- Benchmarks
- AgentHarmInjecAgentWebShop
- Metrics
- ASR
The study proposes a probabilistic reformulation framework for jailbreaking LLM agents, proving that the gradient of the log expected harmfulness with respect to the input equals the expected input gradient of the model's log-likelihood under a harmfulness-reweighted output distribution, thereby unifying expected harm maximization and target likelihood optimization. Based on this connection, it proposes the sampling distribution OPUR to generate high-harm target outputs and guide likelihood-based input optimization. Experiments show the method can effectively jailbreak LLM agents.
Related events and news
1 events · 1 news mentions
- This event's paper
提出OPUR概率重构方法越狱LLM Agent
News that mentions this paper
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:决策性模型护栏也能被攻击者绕过
From Expected Harmfulness to Likelihood: A Probabilistic Reformulation of Jailbreaking LLM Agents(https://arxiv.org/abs/2610.09973)
Paper analysis
What problem does this paper attempt to solve?
The authors connect maximizing expected harmfulness with target likelihood optimization and propose OPUR for agent jailbreaking.
Connects maximizing expected harmfulness with target likelihood optimization and uses it to jailbreak LLM agents.
- Scenario: The authors state that the attacker aims to bypass the agent's safety alignment and induce harmful responses or malicious actions. A common approach is to first define a harmful target and then increase its generation probability.
- Difficulty with distributional objectives: Another approach is to maximize expected harmfulness. The authors state that when sampling from pθ early on, ψ(y)≈0, so REINFORCE has almost no gradient; Geisler et al. (2025) acknowledge this and instead use heuristically constructed harmful responses.
- Observation: The authors define a harmfulness-reweighted distribution π, written as the normalized product of the model's response distribution and a harmfulness preference. They state that it emphasizes responses that are both more likely and more harmful.
- Approach: The authors provide an identity between the gradient of log expected harmfulness and the gradient of log-likelihood under π, and propose OPUR: using model rollouts to construct a surrogate objective, then guiding suffix optimization.
- Threat model:
- Goal: Induce harmful responses or malicious actions. The injected segment a is an adversarial tool name on InjecAgent and AgentHarm, and the target product ASIN on WebShop.
- Knowledge: The paper does not use white-box, black-box, or no-box labels. The algorithm uses the victim model's token distribution and cross-entropy gradients on the one-hot suffix.
- Capabilities: Under malicious instructions, the suffix s is appended to the prompt x; under malicious environments, it is appended to the observation o, including attacker-controlled tool returns. The suffix consists of discrete tokens, updated via gradient-guided replacements.
- Victim system: LLM agent M; experiments use ReAct prompting.
What related research exists?
Related work covers prompt search, jailbreak objectives, and agent attacks; the authors state that this paper rewrites the optimization objective.
Prompt Search Jailbreaks
- Optimization-based methods: GCG (Zou et al., 2023) uses gradients to guide discrete suffixes toward a predefined affirmative objective. Similar works include AutoDAN (Liu et al., 2024b), BEAST (Sadasivan et al., 2024), AdvPrompter (Paulus et al., 2024), and COLD-Attack (Guo et al., 2024).
- Black-box and automated strategies: PAIR (Chao et al., 2025), TAP (Mehrotra et al., 2024), as well as DRA, MASTERKEY, LLM-Fuzzer, DeepInception, persuasive jailbreaks, and AutoDAN-Turbo. The paper only categorizes them without comparing each one.
Jailbreak Objectives and Probabilistic Attacks
- Objectives, rewards, and suffix distributions: AdvPrefix (Zhu et al., 2026) selects model-dependent objectives; Geisler et al. (2025) use REINFORCE to optimize adaptive semantic rewards; AmpleGCG (Liao & Sun, 2024) models diverse adversarial suffixes.
- Search variants and evaluation protocols: The paper also lists adaptive search, black-box optimization, output prefix forcing, trigger-level objectives, iterative generation, and attacks exploiting random generation or output distributions (Beyer et al., 2026; Fu et al., 2026). Several benchmarks are used to point out that results are sensitive to generation and evaluation protocols (Chao et al., 2024; Souly et al., 2024; Chu et al., 2025; Scholten et al., 2025).
Agent Jailbreaks
- Attack surfaces and benchmarks: Greshake et al. (2023) and Mo et al. (2024) discuss tools, memory, retrieval, and multi-step actions. InjecAgent, AgentDojo, Agent Security Bench, and AgentHarm are used to evaluate these vulnerabilities.
- Attacks targeting agent mechanisms: UDora (Zhang et al., 2025b) dynamically hijacks reasoning; BadAgent inserts and activates backdoors; AgentPoison does red-teaming by poisoning memory or knowledge bases.
Baselines and Benchmarks
- Baseline methods: GCG, REINFORCE-GCG, and UDora's Sequential and Joint variants.
- Benchmarks: AgentHarm for malicious instructions; InjecAgent and WebShop for malicious environments. The evaluation protocol follows UDora.
The authors state that the above prompt search works mainly advance how prompts are searched or constructed; unlike agent-specific mechanisms targeting reasoning, memory, or behavior, this paper derives a computable likelihood objective from expected harmfulness.
How does the paper address this problem?
OPUR uses random rollouts to construct harmful and reachable alternative contexts, then updates the adversarial suffix with likelihood gradients.
The authors connect expected harmfulness and target likelihood via a harmfulness-reweighted distribution π, and then use OPUR to construct alternative contexts in the high-probability region of π from rollouts, and perform likelihood-style suffix optimization on these contexts. The abstract calls OPUR a sampling distribution that generates high-harmfulness target outputs; the main text implements it as an alternative distribution over rollouts.
Problem setting and reweighted distribution
- Object: pθ(·|x, s) is the response distribution of a model with parameters θ given input x and adversarial suffix s. ψ(y)≥0 denotes the harmfulness of response y, and does not explicitly depend on s.
- Expected harmfulness: One goal of the suffix is to maximize E[ψ(Y)]. Theorem 1, under assumptions such as interchangeability of differentiation and expectation, writes its gradient as ψ(Y)∇s log pθ sampled from pθ. The proof is in Appendix A.
- Target likelihood: Given a harmful response yharm, another goal is to maximize log pθ(yharm|x, s). The suffix consists of discrete tokens; Zou et al. (2023) use gradients to select token replacements and then perform greedy coordinate updates.
- π: When expected harmfulness is greater than 0, the authors define π(y ∣ x, s)=pθ(y ∣ x, s)ψ(y)/𝔼Y∼ pθ[ψ(Y)]. It has the same product form as Zhang et al. (2024; 2026): the model distribution corresponds to pdis, and harmfulness corresponds to pvic. The caption of Figure 1 states that looking at either side alone would favor responses that are more likely but not harmful enough, or harmful but not very likely.
Gradient identity
- Local alignment: If the response for the likelihood objective is drawn from π, the authors give in Theorem 2 ∇slog𝔼[ψ(Y)]=𝔼Y∼π[∇slog pθ(Y∣ x, s)]. The meaning is: for fixed s, the gradient of the log expected harmfulness equals the expectation of the log-likelihood gradient under π.
- Difference from REINFORCE estimates: The authors state that both formulations update the likelihood gradient, but the sampling distributions differ. Geisler et al. (2025) estimate from pθ; this paper takes the expectation under π. The authors state that π concentrates mass on harmful responses, thereby avoiding the early region where samples are almost all benign and gradients lack information.
- Not directly sampled: The authors state that the response space is discrete and combinatorial, and when harmful responses are rare, it is difficult to sample directly from π, so an alternative objective is needed.
How the alternative objective is derived
- Motivation: Alternative contexts are taken from the agent's own trajectories. The authors state that the same input under random decoding yields different trajectories and position scores, and deterministically selecting the highest position may overfit to a single rollout.
- Position score: For eligible positions, the score consists of the number of target tokens matched by successive argmax, the average target token probability before the first mismatch, and the target token length at that position plus 1. A Softmax with temperature τ is used for sampling, rather than always taking the highest score. The experimental settings in the main text do not give τ; the appendix example writes scores/0.2.
- Position set: After sampling, that position and overlapping positions are removed and renormalized. The set contains at most ℓ non-overlapping positions; the experimental settings do not give a unified ℓ. Replacing these segments with the target a yields alternative contexts used only for optimization.
- Filtering: With the current suffix fixed, the alternative loss LU from Zhang et al. (2025b) is used: the ratio of same-type matches is negated; losses for multiple target segments are summed. Contexts with lower probe loss are kept.
Suffix update and stopping
- Rollout: At each step, the victim model is queried Kopt times with the same attacked input and current suffix, recording responses and token probability trajectories. If every rollout satisfies Succ(zk, a), optimization stops.
- Aggregated update: For the kept contexts, the gradient of the target sequence cross-entropy with respect to the suffix one-hot is computed and averaged. The aggregated gradient produces token replacement candidates; the one with the lowest average LU on the kept contexts is chosen as the next suffix.
- Two attachment positions: In the malicious instruction setting, s is appended to the prompt x; in the malicious environment setting, it is appended to the observation o. Figure 2 is a schematic; the authors state that in that example UDora still focuses on the original calendar task, while OPUR moves to the attacker-specified tool call.
What experiments did the paper conduct?
The authors report Opur's average ASR across three benchmarks; on Ministral's AgentHarm it matches UDora at 99.43%.
Experimental Setup
- Models: Llama-3.1-8B-Instruct and Ministral-8B-Instruct-2410. Agents all use ReAct.
- Benchmarks: AgentHarm for malicious instructions, split into Detailed/Simple Prompt and with/without Hint; InjecAgent for malicious environments, split into Direct Harm and Data Stealing; WebShop for interactive e-commerce, split into four types of mismatch. The paper does not report Ntotal.
- Baselines: GCG, REINFORCE-GCG, UDora Sequential, UDora Joint. UDora's num locations are 2 and 4, respectively, which the authors say correspond to their strongest greedy configuration.
- Metrics: ASR=Nsuccess/Ntotal×100%. The success criterion is denoted as Succ(zk, a) in the algorithm. The paper does not mention an independent review model or human agreement.
- Optimization Configuration: For InjecAgent and WebShop, search width, gradient top-k, and steps are 128, 32, 500; for AgentHarm, they are 256, 64, 1000. The suffix is initialized with 25 repeated x's. Opur samples 4 position sets per rollout and keeps the 2 with the lowest probe loss. The compared Kopt values are 1, 2, 3.
- Evaluation Decoding: During optimization, each baseline uses its original random rollout configuration. Final evaluation uses Keval=1, temperature 0.7, top-p=0.9. The paper does not report the number of repetitions. Tables 1–3 do not indicate Kopt.
Main Results
Average ASR is based on Tables 1–3. Percentages in Table 2 follow that table's formatting, without adding two decimal places.
Swipe horizontally to read the table
Benchmark and Model GCG REINFORCE-GCG UDora Seq UDora Joint Opur AgentHarm, Llama-3.1-8B-Instruct 37.50% 50.57% 61.93% 61.36% 75.00% AgentHarm, Ministral-8B-Instruct-2410 89.20% 98.30% 99.43% 99.43% 99.43% InjecAgent, Llama-3.1-8B-Instruct 30% 47% 44% 46% 49% InjecAgent, Ministral-8B-Instruct-2410 31% 38% 27% 28% 40% WebShop, Llama-3.1-8B-Instruct 0.00% 6.67% 18.33% 16.67% 26.67% WebShop, Ministral-8B-Instruct-2410 6.67% 6.67% 28.33% 20.00% 36.67% - AgentHarm: The authors state that there are improvements across all prompt settings on Llama, and claim to exceed the strongest UDora by 13.07%; Appendix B writes this gap as 13.07 percentage points under Kopt=3. The authors state that Ministral is near saturation, with Opur matching the strongest UDora variant. In Table 1, for Detailed Prompt w/o Hint, Opur is 97.73%, and both UDora variants are 100.00%.
- InjecAgent: The authors state that the average ASR for both models is the highest in the table, 2 percentage points higher than the strongest baseline, with a smaller gain than AgentHarm, but consistent across both model families. Not all categories are the highest: on Llama's Data Stealing, Opur is 50% and UDora Joint is 56%; on Ministral's Direct Harm, Opur is 42% and REINFORCE-GCG is 44%.
- WebShop: The authors state that both models exceed the strongest baseline by 8.34%, with Llama best in three of four categories and Ministral best in all four. In Table 3, for Llama's Price Mismatch, Opur is 13.33%, lower than REINFORCE-GCG's 26.67% and UDora Joint's 20.00%; on Attribute Mismatch, Opur and UDora Sequential are both 40.00%.
Optimization Rollout Budget
- Variables: Kopt controls the number of random rollouts used per suffix update, taking values 1, 2, 3. The corresponding UDora results are in Appendix B.
- Table 4: On Llama, AgentHarm is 56.82%, 63.07%, 75.00%, WebShop is 5.00%, 15.00%, 26.67%; InjecAgent is 46.00%, 45.00%, 49.00%. On Ministral, InjecAgent is 30.00%, 34.00%, 40.00%, WebShop is 11.67%, 16.67%, 36.67%. For AgentHarm on Ministral, only Kopt=1 is reported at 99.43%, with the cell marked as “–”.
- Authors' Interpretation: Larger Kopt generally improves Opur, but it is not strictly monotonic across benchmarks. The appendix states that increasing Kopt on WebShop consistently improves Opur's average ASR for both models; on InjecAgent, Llama goes from 46.00% to 45.00%, then to 49.00%.
Appendix Trajectory Examples
- What was tested: Figures 3–5 in Appendix C each show one trajectory, corresponding to the three benchmarks. The alternative segments are used only for optimization and do not rewrite the agent's actual generation.
- Quantities in the examples: Figure 3 states that Rollout 1 has only 1 feasible interval, with the distribution degenerating to a single choice; Rollout 2 has 300 intervals, sampling 4 sets and keeping 2. The captions of Figures 4 and 5 also give the number of intervals and sampled sets for that trajectory.
- Points the authors use for illustration: The initial rollout may not contain the target action; the context after position sampling and probe filtering is used to update the suffix. These are single examples, not aggregate statistics. Do not paraphrase the original request text.
Other Ablations and Analyses
- Table 5, Llama, Kopt=2, Opur's four cells are 68.18%, 63.64%, 61.36%, 59.09%, averaging 63.07%.
- Table 6, Llama, Kopt=2, Opur's Direct Harm is 32.00%, Data Stealing is 58.00%, averaging 45.00%.
- Table 6, Ministral, Kopt=1, Opur's Direct Harm is 38.00%, Data Stealing is 22.00%, averaging 30.00%.
- Table 6, Llama, UDora Sequential's average ASR is 44.00% at Kopt=1 and 39.00% at Kopt=3.
- Table 7, Llama, Kopt=1, Opur's four categories are 0.00%, 6.67%, 13.33%, 0.00%, averaging 5.00%.
- Table 7, Ministral, Kopt=3, Opur's four categories are 33.33%, 53.33%, 40.00%, 20.00%, averaging 36.67%.
What are some points that can be further explored?
The paper does not specifically discuss limitations; the Conclusion hopes to move toward the full behavior distribution.
Limitations and Future Directions Noted by the Authors
- The paper does not specifically discuss limitations: There is no dedicated Limitations, Discussion, or Future Work section in the full text, and the appendix does not frame any result as a shortcoming.
- Future directions: The Conclusion hopes that future work will not only look at single attack trajectories but shift toward understanding, evaluating, and ultimately controlling the full distribution of behaviors that LLM agents may exhibit.
Experimental Coverage
- Models: The tested models are Llama-3.1-8B-Instruct and Ministral-8B-Instruct-2410, which Section 5.2 describes as open-source instruction-tuned models.
- Benchmarks and prompts: AgentHarm, InjecAgent, WebShop; the former corresponds to malicious instructions, the latter two to malicious environments. The agents use ReAct (Sections 5.1–5.2).
- Baselines and budget: Baselines are GCG, REINFORCE-GCG, UDora Sequential and Joint. Opur's Kopt takes values 1, 2, 3; for Ministral on AgentHarm only Kopt=1 is reported, which the authors say is due to saturation (Section 5.4).
- Decoding and search parameters: Final evaluation uses Keval=1, temperature 0.7, top-p=0.9. For InjecAgent and WebShop, search width, gradient top-k, and optimization steps are 128, 32, 500; for AgentHarm they are 256, 64, 1000 (Section 5.2).
- Items not reported in the paper: Ntotal for each benchmark, number of experimental repetitions, independent review models, and results under defense settings. Tables 1–3 also do not indicate the corresponding Kopt.
Summarize the main content of the paper
OPUR connects expected harmfulness with target likelihood and reports higher or equal average ASR on three agent benchmarks.
OPUR is a suffix optimization attack for LLM agents that connects expected harmfulness with target likelihood.
- Problem: The attacker appends a discrete suffix to the user prompt or environment observation, hoping the agent produces a harmful response or specified action. Maximizing only the likelihood of a single harmful string and maximizing expected harmfulness over the entire output distribution were previously treated separately.
- Connection: The authors define a harmfulness-reweighted distribution π. Theorem 2 states that at a fixed suffix, the gradient of the log expected harmfulness equals the expected log-likelihood gradient when sampling from π. Directly sampling π is difficult because harmful responses may be rare.
- Method: OPUR performs Kopt random rollouts, scores injectable positions, samples a set of non-overlapping positions via temperature Softmax, replaces the corresponding segments with target a, and uses a probe loss to retain context. It averages suffix cross-entropy gradients over these contexts and updates the suffix via token replacement. The target a is an adversarial tool name on two tool benchmarks and a product ASIN on WebShop.
- Results: Final evaluation uses temperature 0.7, top-p=0.9, Keval=1. In Table 1, Opur's AgentHarm average ASR is 75.00% for Llama-3.1-8B-Instruct and 99.43% for Ministral-8B-Instruct-2410, the latter matching both UDora variants. Table 2's InjecAgent is 49% and 40%. Table 3's WebShop is 26.67% and 36.67%. In Table 4, Llama's InjecAgent at Kopt=2 is 45.00%, lower than 46.00% at Kopt=1.
- Authors' conclusion: The authors argue that agent safety is distributional, and attacks push probability mass toward harmful behavior; likelihood optimization can serve as an interface between behavioral risk and adversarial optimization. They hope future work evaluates and controls the full distribution of possible agent behaviors, not isolated trajectories.