DeepTrap framework automatically mines vulnerabilities in agent execution context on OpenClawRed-Teaming Agent Execution Contexts: Open-World Security Evaluation on OpenClaw
DEEPTRAP searches for tampered execution contexts on OpenClaw; the authors state that most models can achieve attack goals while completing benign tasks.
Black-box contextual adversary: cannot modify the benign instruction u, nor directly modify the policy πϕ; before execution can use admissible payload p to inject memory, skills, auxiliary artifacts, or configuration through Γ into restricted channels. Success means the trajectory realizes the target risk, and the benign task still appears completed.
- An agent's files, memory, tools, and skills can change behavior while user instructions remain benign. The authors argue that looking only at the final response is insufficient: tool calls or file operations in the trajectory may already have achieved the attack goal, while the visible task still appears completed.
- DEEPTRAP formulates context tampering as black-box trajectory optimization: it injects payloads into allowed channels, scores full rollouts by risk, task preservation, and covertness, then updates proposals with beam search and reflection summaries.
- The 42 cases cover six risk types and seven scenarios, with nine target models. The authors state that on most non-Claude models both attack scores and utility scores are high, while Claude-Sonnet-4.6 has lower AGS. The average AGS across all models and risks is 0.65 at iteration 0 and 0.75 at iteration 5.
- The paper does not separately list method limitations. The Conclusion suggests future defenses add context integrity checks, execution trajectory audits, and risk-aware tool governance. The experiments include nine target models and 42 cases; it does not report the scoring model, search hyperparameters, number of repetitions, or agreement between reviewers and humans.
- Evaluated models
- GPT-5.4Claude Sonnet 4.6GLM-5Qwen3.5-PlusMiniMax-M2.5DeepSeek-v4-FlashDeepSeek-v4-ProMiMo-v2.5MiMo-v2.5-Pro
- Benchmarks
- 42-case benchmark (six vulnerability classes, seven operational scenarios)
- Metrics
- AGSUGS
The researchers propose DeepTrap, an automated framework for OpenClaw to discover security vulnerabilities in variable execution contexts such as files, memory, tools, and skills. The method models adversarial context manipulation as a black-box trajectory-level optimization problem that balances risk achievement, benign task preservation, and covertness, combining risk-conditioned evaluation, multi-objective trajectory scoring, reward-guided beam search, and reflection-based deep probing to locate high-value poisoned contexts. The authors built a benchmark of 42 cases covering six vulnerability types and seven operation scenarios, and evaluated nine target models with attack scores and utility scores. The results show that context poisoning can induce substantial unsafe behaviors while maintaining user task completion, indicating that evaluating only the final response is insufficient. The paper has been accepted by the ICML 2026 Workshop, and the code is publicly available.
Paper analysis
What problem does this paper attempt to solve?
To discover covert risks that can be triggered by tampering only with OpenClaw's execution context without changing user instructions.
The core question is: when user instructions remain benign, can OpenClaw's variable execution context induce unsafe trajectories while the task appears completed.
- Scenario: The authors argue that files, memory, tools, skills, and configuration all enter execution; the effects of unsafe actions can persist beyond a single response.
- Existing gaps: The authors argue that prior work mostly modifies user-visible instructions, evaluations often simplify the environment, and few simultaneously require covertness and task success.
- Core observation: The search target is discrete context artifacts; one must simultaneously achieve risk, preserve the task, and remain covert; the authors treat OpenClaw as a black-box stochastic policy.
- Proposal: DEEPTRAP performs trajectory-level search over admissible payloads and evaluates nine target models with 42 cases, six risk types, and seven scenarios.
- Threat model
- Goal: Given risk class r, make the trajectory achieve that risk while the benign task still appears completed; do not modify instruction u.
- Knowledge: The authors formulate the optimization as black-box; they cannot directly modify policy πϕ, only observe trajectories through rollouts.
- Capability: Before execution, use payload p and transformation Γ to modify restricted contexts; channels include memory, skill, auxiliary artifacts, or configuration. P constrains location, content, and allowed forms.
- Victim system: OpenClaw agent. Evaluation looks at full observations, actions, and context updates, not just the final response.
What related research exists?
Related work covers agent risks and automated red teaming; the authors place the gap in covert context attacks under benign requests.
Risks in Agent Systems
- OpenClaw: Liu et al. 2026a, Wang et al. 2026a, Dong et al. 2026, Wang et al. 2026c. The paper states it has high-privilege vulnerabilities, deployment misconfigurations, and supply-chain risks from unverified components.
- External reports: The paper states empirical studies report 63% of networked instances lack authentication, and 26% of 31,000 analyzed skills contain exploitable vulnerabilities.
- Injection and components: The paper classifies Greshake et al. 2023, Nikishin et al. 2023, Wang et al. 2025b, Yao et al. 2025 as prompt injection; Zhan et al. 2024, Wang et al. 2025a as memory injection; Schmotz et al. 2026, Jia et al. 2026, Liu et al. 2026c, Guo et al. 2026 as malicious skills; Huang et al. 2026 as malicious MCP.
- Evaluation environments: AgentDojo (Debenedetti et al. 2024), Agent Security Bench (Zhang et al. 2024), MCP Security Bench (Zhang et al. 2025), MCPTox (Wang et al. 2026b). The paper lists them as ecosystem safety evaluations without numerical comparison to this paper.
Automated Red Teaming
- HarmBench (Mazeika et al. 2024): The paper states it provides a foundational evaluation and adversarial training protocol, and states modern methods place more emphasis on dynamic, context-aware strategies.
- Single-agent: RAT (Bai et al. 2025) shifts to reinforcement learning strategies; AgentPoison (Chen et al. 2024) poisons retrieval memory; AdvAgent (Xu et al. 2025) uses direct preference optimization for black-box prompt injection.
- Orchestration and others: He et al. 2025, Yuan et al. 2026, Xu et al. 2026 do multi-agent collaboration; Jia et al. 2026, Duan et al. 2026 automate skill attacks; CSRT (Yoo et al. 2025) examines multilingual safety misalignment; Longpre et al. 2024 discusses evaluation safe harbors. The paper also mentions Claude Mythos (Anthropic, 2026) zero-day discovery and autonomous exploit generation.
Gaps Identified by the Authors
- Instruction channel: The authors believe many works assume the adversary directly modifies user-visible instructions, and fewer studies cover benign requests plus controlled environmental context.
- Environment abstraction: The authors believe simplified settings may mask vulnerabilities in concrete execution dynamics; this paper targets OpenClaw persistent environments, tools, and module interactions.
- Success criteria: The authors believe existing formulations mostly look at whether harmful behavior can be elicited, and less at whether attacks can remain hidden while the task appears to succeed.
The authors position this paper as: searching OpenClaw mutable context under benign instructions, and jointly constraining with risk, task preservation, and stealth, rather than optimizing only the user prompt. The experiments do not list the above attack methods as comparison baselines.
How does the paper address this problem?
DEEPTRAP uses black-box multi-objective trajectory scores to guide beam search, and uses reflection summaries to update context-payload proposals.
DEEPTRAP searches context payloads before execution, uses multi-objective scores of full rollouts for beam search, then uses reflection summaries to improve subsequent proposals (Figure 1, Section 4).
Formulation and Risk Categories
- Instance: I = (u, x0, r, Ωr). u is the benign instruction, x0 is the clean context, Ωr(τ)∈{0,1} indicates whether the trajectory exhibits that category of unsafe behavior.
- Context: x0 collectively denotes files, memory, tools, skills, auxiliary artifacts, and workspace state; the authors do not break it into separate submodules for formalization.
- Six-category description: Section 3.2 writes harness hijacking, obfuscated coding, unauthorized operations, supply-chain compromise, tool abuse, data exfiltration.
- Experimental naming: Section 5.1's R1–R6 are harness hijacking, privacy leakage, unauthorized execution, supply-chain risk, tool abuse, encoding obfuscation. The paper does not declare a one-to-one correspondence between the two sets of names.
Adversarial Objective
The adversary chooses p, yielding x̃0=Γ(x0,p), i.e., the initial context after injecting into allowed channels. Equation (8) maximizes expected risk score, and requires task score and stealth score not below thresholds. The relaxed trajectory score is J=λr Jrisk(τ;r)+λt Jtask(τ;u)+λs Jstealth(τ,p;r).
- Three components: Jrisk checks whether the target risk is realized, Jtask checks whether the benign task still appears completed, Jstealth checks whether the unsafe behavior is hard to detect.
- Estimation: The expectation is estimated by the average over n(p) rollouts; when executed only once it equals that single-run score. Experimental values for thresholds, weights, and n(p) are not given in the paper.
Beam Search
- Proposal model: πφ samples new payloads conditioned on u, x0, r, the parent payload, and reflection summaries; it only proposes, scores still come from full OpenClaw execution.
- Expansion: At depth ℓ, each payload in the previous beam is expanded into B candidates, scored by Equation (9), and the K with the highest empirical scores are kept.
- Pruning: When D>1, the threshold rises linearly from 0 at the first layer toward β; if an entire layer is pruned, it falls back to the unpruned set.
- Starting point: Starts from the empty payload p∅, corresponding to clean context. Values of B, K, D, β are not given in the paper.
Reflection and Selection
- Summary: Every α layers, summarize recent failures, partial successes, useful patterns, and differences between expectation and observation. α is not given.
- Boundary: Summaries only condition subsequent proposals, not as an additional scoring signal; candidate quality is still determined by actual trajectories.
- Selection: The final payload is the highest empirical score among all evaluated candidates C, not just the last beam. The authors state strong mid-layer candidates may disappear in later pruning due to stochastic rollouts.
Trajectory Scoring
- Deterministic checks: Used for behaviors identifiable from structured traces, such as whether forbidden resources were accessed or whether a certain category of tool action occurred.
- Semantic scoring: Used for behaviors requiring interpretation, such as whether the final reply looks like it completed the user request or whether the trajectory shows clear signs of compromise.
- Stealth score: Checks whether the payload is embedded in a plausible artifact, whether intermediate actions are consistent with the benign task, and whether the final output avoids obvious unsafe evidence.
What experiments did the paper conduct?
Across 42 cases and nine models, the authors state that most non-Claude models have both high AGS and UGS.
Experimental Setup
- Benchmark: 42 cases, 7 per category. S1–S7 are documentation and action items, code and configuration review, research and onboarding documents, deployment and logs, sales data analysis, content drafting and data transformation, system administration (Section 5.1).
- Construction roles: When generating cases, the target model is Qwen3.5-Plus, attacker/proposer is Claude Sonnet 4.6, judge is DeepSeek-v4-Pro.
- Tested models: GPT-5.4, Claude Sonnet 4.6, GLM-5, Qwen3.5-Plus, MiniMax-M2.5, DeepSeek-v4-Flash, DeepSeek-v4-Pro, MiMo-v2.5, MiMo-v2.5-Pro. The hyphenation in the table differs slightly from the main text.
- Metrics: AGS measures whether the attack objective is achieved in the trajectory, UGS measures whether the benign task is completed; both are normalized scores. Higher respectively means the attack is more successful and utility is better preserved.
- Scoring: Risk and task scores combine deterministic checks with LLM semantic scoring. Table 1/2 does not specify the scoring model. The paper does not report the number of repetitions or statistical tests.
- Baselines: No comparison results from other attack methods. Scores are aggregated by risk category and scenario index; the aggregation function is not specified in the paper.
Main Results
The table below is an AGS slice of Table 1, with R2 UGS attached. R1 harness hijacking, R2 privacy leakage, R4 supply-chain risk, R6 encoding obfuscation. Qwen3.5-Plus is the target model when constructing cases. MiMo-v2.5 omitted. R3, R5 not listed.
Swipe horizontally to read the table
Model R1 AGS R2 AGS R4 AGS R6 AGS R2 UGS GPT-5.4 0.77 0.84 0.61 0.53 0.83 Claude-Sonnet-4.6 0.51 0.58 0.25 0.20 0.69 GLM-5 0.81 0.93 0.83 0.88 0.90 Qwen3.5-Plus (construction target) 0.93 0.93 0.74 0.97 0.92 MiniMax-M2.5 0.86 0.89 0.66 0.89 0.95 DeepSeek-v4-Flash 0.90 0.96 0.90 0.94 0.96 Deepseek-v4-Pro 0.90 0.96 0.87 0.86 0.91 MiMo-v2.5-pro 0.74 0.83 0.58 0.53 0.90 - Authors' interpretation: The authors state that on most evaluated models, risk and utility can co-occur, and traps transfer beyond the constructing Qwen3.5-Plus. Claude has lower AGS; the authors believe it may be more resistant to the tested attacks, or less likely to follow tampered artifacts.
- Cells not listed: Claude-Sonnet-4.6's R3 and R5 AGS are 0.37 and 0.38; its R3 and R4 UGS are 0.55 and 0.45. MiniMax-M2.5's R5 UGS is 0.74 (Table 1).
- Omitted model: MiMo-v2.5's R1–R6 AGS are 0.86, 0.87, 0.71, 0.73, 0.57, 0.60 (Table 1). The authors state privacy leakage is the most consistently activated category.
Scenario-Level Results
- What is measured: Table 2 reports AGS/UGS by S1–S7. The authors state these risks are not tied to a single task template.
- Higher scenarios: The authors state S2, S3, S6, S7 are stronger across multiple models. Qwen3.5-Plus's S3 AGS is 1.00; that row is the construction target. DeepSeek-v4-Flash's S2 AGS is 0.97.
- Lower cells: Claude-Sonnet-4.6's S5 AGS is 0.16 and S1 is 0.33; MiMo-v2.5-pro's S5 AGS is 0.46. The authors believe difficulty depends on the scenario and execution strategy.
Iteration and Review
- Iteration: Figure 2 has Iteration 0–5 on the x-axis)Skip, AGS on the y-axis, six subplots for the six risk categories, legend for nine models. The main text states all-model all-risk average AGS goes from 0.65 to 0.75. The text of individual curve endpoints is not listed.
- Gains: The authors state encoding obfuscation has the largest average improvement, followed by privacy leakage and tool abuse; hijacking and unauthorized execution are more moderate. The authors state Qwen3.5-Plus gains about 0.18 on average across risks, followed by the two DeepSeek variants and MiniMax-M2.5.
- Review: Table 3 does not state the target model or the metric name. Deepseek-v4-Pro's R1–R6 are 0.88, 0.88, 0.63, 0.69, 0.73, 0.63; Python's are 0.70, 0.84, 0.80, 0.68, 0.69, 0.83. The authors state the LLM is higher on semantic categories, while Python is more competitive on execution or encoding traces.
Qualitative Cases
- Selection: From the full 42-task run. The authors state attack success, utility preservation, and stealth are all high, but give no scores. The opening names three mechanisms, and the main text expands only two.
- Tool abuse: Figure 3. A style check completes the visible readability task while writing the API key into style_report.md. The authors state looking only at the natural-language reply would miss the unsafe file write.
- Harness hijacking: Figure 4. A modified playbook creates etc/cron.d/health_check beyond the baseline outside health checks. The authors call it a control-flow failure; the reply still looks like a normal report.
Other Ablations and Analyses
- Beyond Table 3 and Figure 2, the paper does not report other ablation numbers.
- The paper does not report ηt, ηs, λr, λt, λs, K, B, D, α, β, or the number of rollouts per payload.
- The paper does not report stealth scores in tables; the qualitative cases only state stealth is high.
What are some points that can be further explored?
The paper does not separately list method limitations; the Conclusion suggests future work on context integrity, trajectory audits, and tool governance.
Limitations and future directions noted by the authors
- Method limitations: The paper has no dedicated Limitations or Future Work section, nor does it frame DEEPTRAP's shortcomings as limitations.
- Future defenses: The Conclusion states that future defenses should incorporate context integrity checks, execution-trace auditing, and risk-aware tool governance.
Experimental coverage
- Models: The tested targets are the nine OpenClaw models listed in Section 5.1. The construction-stage target is Qwen3.5-Plus, the proposal model is Claude Sonnet 4.6, and the judge is DeepSeek-v4-Pro.
- Data: 42 cases, 7 per category across six categories, seven scenarios; Table 1 aggregates by risk, Table 2 aggregates by scenario.
- Other results: Table 3 compares Deepseek-v4-Pro with a Python checker; Figure 2 in the main text gives the average AGS across all models and risks for iterations 0 and 5; Section 5.4 expands on two trajectories.
- Unreported items: The scoring model for Tables 1/2, the number of rollouts per payload, the number of repetitions, the number of queries, and the values of the task/stealth thresholds, reward weights, and beam search hyperparameters.
- Unreported scores: The aggregate stealth score, and reviewer-human agreement. The three types of defenses mentioned in the Conclusion have no corresponding experiments.
Summarize the main content of the paper
DEEPTRAP uses trajectory-level search to discover OpenClaw context risks; the authors state that one cannot look only at the final response.
DEEPTRAP is an automated red-teaming framework for OpenClaw that searches pre-execution rewritten files, memory, skills, tool metadata, or configuration, rather than modifying user instructions.
- Problem: The authors believe the security boundary has extended beyond explicit prompts. Tampered context can achieve attack objectives across multi-step tool, file, and memory interactions, while the task results users see still look completed.
- Approach: Given a benign instruction, clean context, and target risk, inject admissible payloads into allowed channels. Full trajectories are scored on risk realization, task preservation, and stealth; reward-guided beam search expands candidates, and reflection summaries are used only to improve proposals. The final payload is the highest-scoring one across the whole run.
- Setup: 42 self-built cases, six risk categories, seven scenarios. The construction phase uses Qwen3.5-Plus as the target, Claude Sonnet 4.6 as proposer, DeepSeek-v4-Pro as judge, then reports AGS and UGS on nine target models.
- Results: In Table 1, non-construction targets DeepSeek-v4-Flash and DeepSeek-v4-Pro both have AGS 0.96 on privacy leakage; Claude-Sonnet-4.6 has encoding obfuscation AGS 0.20, supply-chain risk AGS 0.25, and scenario S5 AGS 0.16. The authors state most non-Claude models still have high UGS, and state traps transfer beyond the construction model. The all-model all-risk average AGS goes from 0.65 at iteration 0 to 0.75 at iteration 5.
- Authors' conclusion: The authors state tampered execution context can induce unsafe behavior while preserving benign task utility, so final replies alone cannot be checked. The Conclusion suggests future defenses incorporate context integrity checks, execution-trace auditing, and risk-aware tool governance. The authors state the code has been released.