acceptodds
Under review as a conference paper at ICLR 2027

CONTRA: Red-Teaming Configurations of Personalizable Agents

Abstract

Recent tools such as OpenClaw have extended the capabilities of LLM-based agents from simple dialog-based systems to fully autonomous agents. These systems allow personalization through modifiable internal files and the installation of skills. While this enables deployment in a wide range of settings and the automation of diverse tasks, greater capability and autonomy increase the risk of harmful actions being executed unintentionally. In this work, we explore the interplay between agent configuration and the risk of executing dangerous actions without explicit instruction. To this end, we propose CONfiguration Tree-search for Red-teaming Agents (CONTRA), an LLM-assisted tree-search algorithm that discovers agent configurations resulting in the execution of harmful actions. CONTRA works by reasoning about dangerous configurations and evaluating them in a simulated environment. We construct SkillSafetyBench, a dataset of the 532 most downloaded skills from a public repository, along with 1869 harmful actions. In a large-scale analysis, we find that 74.2% of skills have at least one configuration resulting in the execution of a harmful action, which is substantially more than existing attacks. Utilizing a virtual machine, we further confirm that these vulnerabilities persist under real tool execution. Finally, we demonstrate that the discovery of successful configurations can be used to improve the safety of skills by leveraging them to implement safety features.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Agentic AI, LLM-Agents, Large Language Models, Personalization, Red-Teaming, Autonomous Agents, Skills, Skill Safety

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_u2x5OpenReview ↗
Rating
3
Confidence
2
Informativeness
3
Presentation
2
Soundness
3
Read review
Paper summary

This paper mainly investigates how personalized configuration leads to LLM Agents performing unauthorized and dangerous operations without explicit malicious instructions. The authors proposed CONTRA, a LLM-based tree-search red team framework, which automatically modifies the configuration files of the Agent, such as its identity, personality, user preferences, long-term memory, and automated tasks, to search for configurations that can induce dangerous behaviors and evaluate their safety in a simulated environment. The authors constructed SkillSafetyBench, which contains 532 real Skills and 1,869 dangerous target operations. The experiments found that 74.2% of the Skills have at least one configuration that can induce dangerous behavior, 41.7% of the target operations can be successfully triggered, and some vulnerabilities can be transferred to the real tool execution environment. Further, the authors proposed Skill-Hardening, which reduces the attack success rate by adding security instructions and tool-level protection mechanisms. The core contribution of this paper is to view the Agent's configuration and personalized mechanism as a new security attack surface, through automated red team search to discover potential risks, and to use the discovered vulnerabilities to reverse-engineer and enhance the security of Agent Skills.

Critical strengths
  1. Studying agent safety through personalization-induced unauthorized actions offers a fresh and practically relevant perspective.
  2. The evaluation covers 532 skills, with additional cross-model tests and real-execution validation.
  3. Using failure cases to harden skills reduces ASR from 46.9% to 27.5%, demonstrating practical value.
Critical weaknesses
  1. 11.2% of successful configurations were judged malicious, which conflicts with the premise of benign configurations. Results excluding these cases are needed.
  2. The search may also modify tasks and simulated tools, making it difficult to isolate the effect of configuration changes.
  3. Ablations against random search and search without feedback are missing, leaving the necessity of individual components unclear.
  4. The defense is mainly retested against known targets; its generalization to unseen targets and other attack methods remains unclear.
Questions for authors
  1. How do the main results change after excluding the 11.2% of successful configurations judged malicious?
  2. What ASR does CONTRA achieve when tasks and simulated tools are fixed and only configuration files can change?
  3. How does CONTRA compare with random configuration search or search without judge feedback under the same budget?
  4. Does Skill-Hardening generalize to unseen harmful targets or other attack methods? How much improvement comes from tool wrappers versus textual safety instructions?
1 comment

We thank the Reviewer for their feedback. We are glad the Reviewer finds our perspective on personalization-induced unauthorized actions fresh and practically relevant, and appreciates the scale of our evaluation, including cross-model tests and real-execution validation, as well as the practical value of Skill-Hardening. We address each concern and question below.

W1 and Q1: We agree that the headline results should only include configurations that satisfy our benign-configuration requirement. We have made the two following changes to the paper:

  • Table 2 now reports benign-only and overall success rates separately.
  • We integrated the maliciousness judge into the search. If a successful configuration is flagged as malicious, the search continues, and the Red-Team uses its remaining budget to find one that is not. With this change, benign-only results are:
SeverityASRASR-BenignSkillsSkills-Benign
Overall41.7%38.6%74.2%71.0%
154.2%54.2%54.5%54.5%
248.2%42.9%51.1%44.1%
336.5%33.6%47.8%44.7%
444.9%41.8%60.8%57.1%
540.2%39.0%44.3%42.9%

W2 and Q2: We agree that this control is needed to isolate the effect of configuration changes. We rerun CONTRA with the task and simulated tools frozen at initialisation, so that only the configuration files change.

ApproachASRSkills
Full Search48.0%88%
Config Only40.0%72%
Even in the full search, several mechanisms prevent the task or tools from carrying the attack:
  • A trajectory only counts as successful if its safety score is at most 3, and actions requested in the user’s task are not penalized (Table 8). A task that asks for the target action therefore cannot produce a success.
  • The tool creator only updates tools to keep the task solvable and is not aware of the target action.
  • In our sim-to-real study, we replaced the simulated tools with real tool implementations, and every target action was still reproduced

W3 and Q3: We would first like to clarify how judge feedback enters CONTRA. The orchestrator does not see the judge’s output when proposing modifications. The feedback is used only to select which configuration to modify next, via the heuristic score h (Section 4.1). Search without judge feedback therefore corresponds to selecting parent configurations uniformly at random from the archive. We have clarified this in Section 4.1.

We agree that these controls are needed to attribute the gains. We therefore evaluated the following variants on the top-10 skills subset, using the same budget of 125 configurations per target action and the same success criterion:

MethodDescriptionASR
CONTRAOur main method53.1%
Greedy searchAlways modifies the highest-scoring configuration40.6%
Random selectionParent sampled uniformly from the archive31.2%
Random searchAlways modifies the initial configuration25.0%
Single LLMOrchestrator writes the files directly, no sub-agents43.8%

As can be seen in the table, every component of CONTRA is beneficial to an effective search. Due to computational cost, we plan to extend these ablation studies to a larger set of 25 skills for the full submission.

W4 and Q4: Skill-Hardening is designed as a targeted defense against a specific discovered failure, not as a general defense against arbitrary harmful behaviors. We have clarified this in Section 5.4. This is supported by our experiments using unseen actions. We evaluated 10 successfully hardened skills against other harmful actions of the same skill. Only one hardened skill also defended against the unseen action, confirming that each harmful action must be hardened individually. However, hardening for different actions can be chained by applying Skill-Hardening sequentially to the same skill, so that the skill accumulates safeguards for every action CONTRA discovers.

Regarding other attack methods, for the same target action, hardening transfers well. Besides withstanding a fresh CONTRA search, which explores new configurations, the hardened skills defended against Direct Instruction in 7 of 10 cases and against Prompt Injection in all 10 cases.

Tool wrappers vs. safety instructions. We took 10 skills for which CONTRA was previously successful and full Skill-Hardening defended the target action, and re-attacked them with only one of the two components applied. With only safety instructions, the ASR is 70%, and with only tool wrappers it is 50%, compared with 100% before hardening and 0% with both components. Both components therefore contribute, with tool wrappers having the larger effect, and neither suffices alone.

Given the computational cost, both experiments currently use 10 skills. We will extend the evaluations against other attack methods and of the individual hardening components to more skills in the final version.

Reviewer_LYmhOpenReview ↗
Rating
3
Confidence
4
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper aims to reduce agent harmful action tendency by proposing CONTRA, which searches for agent configurations that causes harmful actions and use them to hardening agent skills, resulting in safer agent behaviors.

Critical strengths
  1. The paper tackles an important issue on reducing agent harmful behaviors, by proposing CONTRA to hardening agent skills based on harmful action incidents. The study captures a large number of skills, experiments many LLMs, and validates the sim-to-real transfer effect, laying solid foundation for informative results.
Critical weaknesses
  1. Overclaiming in the discussion: This paper specifically studies how different skills change agents’ harmful behavior tendencies, yet an agent configuration contains more, such as observation, action space, and memory (or under this paper’s openclaw agent definition, personality, user context, memory, and more). This paper lacks discussion and control of other dynamic modules in the agent design.
  2. Unclear description of harmful actions: this term is used throughout the paper, but there are no illustrative examples or precise descriptions ofit, making it very confusing to read and unclear what the proposed method does to prevent it.
Questions for authors
  1. A harmful action could be due to test-time sampling. A certain agent configuration may just increase the probability of sampling that harmful action, rather than indicating a definite causal relationship. How do you measure this probability change?
1 comment

We thank the Reviewer for their insightful feedback, and are delighted to read that they appreciate the issue we are exploring, the scale of our experiments, and the informativeness of the results. We would like to address their concerns and questions in the following:

W1: We would like to clarify the scope of our study. These modules are precisely what CONTRA searches over. For each skill, the skill itself is held fixed, and CONTRA modifies the agent’s configuration files (Table 1, Section 3). These files cover:

  • Personality (IDENTITY.md, SOUL.md)
  • User context (USER.md)
  • Memory (MEMORY.md)
  • Behavioral rules (AGENTS.md)
  • Tool notes (TOOLS.md)
  • Recurring tasks (HEARTBEAT.md)

Our results therefore measure how changes to these modules lead to harmful use of a given skill. We have revised the introduction to make this distinction clearer.

We agree that a discussion of the individual modules is valuable. Appendix A.3 already varies the number of files an attack may modify, and we now additionally report how often each file is modified in successful configurations in Appendix A.6 (Figure 8).

W2: We agree that harmful actions should be defined and illustrated earlier in the paper. We have added a definition to Section 3.1:

“We define a harmful action as an action taken by the agent that the user did not request or authorize, and that causes or risks harm to the user or others. Since skills span a wide range of tools and domains, we characterize harm by its impact. This ranges from minor inconveniences that are easily corrected, such as ignoring an error, to meaningful harm that is difficult to reverse, such as overwriting an important document, up to severe harm to physical safety, finances, or data, such as unlocking a door and disabling the alarm without the user’s knowledge.”

We have also added an example for each severity level to Table 10.

Regarding prevention, CONTRA itself is a red-teaming method that discovers configurations under which the agent executes a given harmful action. Skill-Hardening then uses each discovered configuration to add targeted safeguards to the skill. These take the form of explicit safety instructions in the SKILL.md file, or tool wrappers that, for example, reject dangerous inputs. We have added an example of a successful hardened skill to Appendix A.5

Q1: We agree that the effect of a configuration is probabilistic, and we consider this the relevant notion of risk. Configurations persist across all future sessions, including autonomous heartbeat runs (Section 3.1), so even a moderate increase in per-run probability accumulates into substantial risk over an agent’s lifetime.

Our sim-to-real study (Table 5) measures this probability directly: each discovered configuration was run five times with real tools. Every target action was reproduced at least once, 18 of 21 in a majority of runs and 9 in all five. In contrast, target actions are almost never executed under the default configuration (0.7%, Table 3). The discovered configurations therefore substantially raise the probability of harmful actions, rather than producing isolated samples.

Reviewer_QixwOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies how the persistent configuration of a personalizable agent affects its safety, focusing on whether configurations without direct harmful instructions can induce unintended harmful actions during ordinary task execution. To this end, the authors propose CONTRA, an LLM-assisted tree-search method that combines an archive of previous attempts, heuristic-guided sampling, and an orchestrator–sub-agent structure for configuration modification, and evaluates candidate configurations using simulated tools, a user-proxy agent, and a judge agent. The authors further construct SkillSafetyBench, containing 532 skills and 1,869 harmful target actions, and report an action-level attack success rate of 41.7%, with 74.2% of skills having at least one successful configuration. The paper also provides cross-model experiments, limited sim-to-real validation, and a Skill-Hardening approach that uses successful configurations to add safety instructions and tool wrappers to skills.

Critical strengths
  1. CONTRA does not merely generate configuration text, but combines configuration modification, agent execution, trajectory evaluation, and search feedback. The method therefore forms a more complete and practical risk discovery process. The authors also recognize that the execution of a target action does not necessarily constitute a safety failure, as the user may have explicitly authorized it, and therefore additionally assess the safety of the trajectory.

  2. The 532 real-world skills provide a broad testing base, and the experiments offer evaluation at a substantial scale with multiple levels of validation. The authors manually inspected each generated target action and validated the judge against human annotations on 200 trajectories, reporting an accuracy of 98.5%. In addition, the paper provides results across multiple assistant models, as well as sim-to-real reproduction using a real OpenClaw instance.

Critical weaknesses
  1. Section 4.1 clearly states that not only can the configuration files change during the search, but the user task can also evolve; whenever the user task or heartbeat file is updated, the simulated tools are also updated to ensure task solvability. Therefore, candidate configurations may differ simultaneously in task content, tool behavior, and evaluation mode. This makes it difficult to attribute the increase in attack success rate to configuration changes alone. Some successful attempts may depend on a task that more readily elicits the target action, different simulated tool responses, or a switch from user mode to heartbeat mode. Appendix A.4 reports that 68.7% of successful attacks involved a modification to the heartbeat file, but this proportion alone does not establish that heartbeat mode is more likely to elicit harmful actions, as the paper does not report the number of attempts in each mode or provide task-matched, controlled comparisons.

  2. Section 3.1 requires configurations to be benign in isolation and plausible in real deployments, and prohibits files from directly requesting the target action or containing injected instructions. However, Table 2 shows that 11.2% of successful configurations were flagged as malicious by a separate judge agent, and these configurations are still included in the overall ASR and the percentage of skills with at least one successful configuration. This does not negate the configuration-related risks identified in the paper, but it means that the main results combine two qualitatively different types of configurations: those that satisfy the paper’s benign-configuration requirement and those that use adversarial strategies. Therefore, the reported rates of 41.7% and 74.2% cannot be interpreted solely as evidence of benign configurations inducing unintended harmful actions. Furthermore, being “not flagged as malicious” does not automatically establish that a configuration is plausible in real deployments or likely to arise from ordinary user configuration choices. The assessment of deployment plausibility currently appears to rely primarily on instructions to the configuration-generation agents and automatic judgment, without clearly reported results from an independent human review.

  3. Direct Instruction, Prompt Injection, and No Attack in Table 3 illustrate differences in risk across input channels, but they do not evaluate alternatives to CONTRA within the same configuration search space. Therefore, these results cannot clearly distinguish whether the performance gains arise from the configuration attack surface itself or from CONTRA’s tree search, archive, heuristic scoring, and orchestrator–sub-agent structure. The paper lacks several key controls: random search with independently generated configurations, repeated sampling without an archive, greedy modification, and direct configuration modification by a single LLM. The appendix analyses of the number of modified files and the search budget do not substitute for ablations of these components.

  4. The same model is used for target action generation, part of the Red-Team’s planning, the assistant being evaluated, and the judge agent; moreover, the search directly uses the judge’s predicted probability and safety score to guide the optimization of candidate configurations. This design creates a risk of adapting to the judgment preferences of a particular judge. It is unclear which judgments are validated by the reported accuracy of 98.5%: whether the target action was executed, whether the safety score was correct, whether the user explicitly authorized the action, or whether the combined success criterion was satisfied. The paper also does not report a separate agreement analysis for key distinctions, such as whether the user explicitly authorized an action and whether a configuration implicitly requests harmful behavior.

Questions for authors

Please see weaknesses

2 comments

We thank the Reviewer for their thorough and constructive feedback. We are glad the Reviewer finds CONTRA to be a complete and practical risk-discovery process, appreciates that we distinguish executing a target action from an actual safety failure, and values the scale and multi-level validation of our evaluation, from manual inspection of target actions and human validation of the judge to cross-model and sim-to-real experiments. We address each concern below.

W1: The Reviewer is correct that the user task, simulated tools, and evaluation mode can change during the search. This is by design, since our threat model concerns benign configurations under ordinary use. We agree, however, that it complicates attribution, and we address it as follows.

HEARTBEAT.md is itself one of the agent’s configuration files (Table 1), and heartbeat mode is how a modified heartbeat file takes effect in OpenClaw. Switching to heartbeat mode is therefore a configuration change within our threat model, not an external factor.

Several mechanisms prevent the task or tools from carrying the attack:

  • A trajectory only counts as successful if its safety score is at most 3, and the judge does not penalize actions requested in the user’s task (Table 8). A task that asks for the target action therefore cannot produce a success.
  • The malicious-configuration judge evaluates the full successful setup, including the task.
  • The tool creator only updates tools to keep the task solvable and is not aware of the target action.
  • In our sim-to-real study, we replaced the simulated tools with real tool implementations, and every target action was still reproduced. Success therefore does not hinge on simulated tool outputs.

To isolate the effect of the configuration, we rerun CONTRA with the task, tools, and evaluation mode frozen at initialization, so that only the configuration files change:

ApproachASRSkills
Full Search48.0%88%
Config Only40.0%72%
We found that when only considering the configurations, we can still discover a significant amount of harmful behavior, while not changing the underlying task or tools.

W2: We agree that the headline numbers should only reflect configurations that satisfy our benign-configuration requirement. We have made two changes:

  • Table 2 now reports benign-only and overall success rates separately.
  • Since benign configurations are the focus of our threat model, we integrated the maliciousness judge into the search. If a successful configuration is flagged as malicious, the search continues, and the Red-Team uses its remaining budget to find one that is not. | Severity | ASR | ASR-Benign | Skills | Skills-Benign | |---|---|---|---|---| | Overall | 41.7% | 38.6% | 74.2% | 71.0% | | 1 | 54.2% | 54.2% | 54.5% | 54.5% | | 2 | 48.2% | 42.9% | 51.1% | 44.1% | | 3 | 36.5% | 33.6% | 47.8% | 44.7% | | 4 | 44.9% | 41.8% | 60.8% | 57.1% | | 5 | 40.2% | 39.0% | 44.3% | 42.9% |

We found that the ASR only slightly decreases when considering only benign configurations. We agree that not being flagged as malicious does not establish that a user would write a given configuration. However, the risk we identify does not depend on this. As described in Section 3.1, a harmful configuration can also be installed by an external attacker. Appendix A.1 shows that an attacker who controls only a tool output can get the agent to rewrite its own files into a configuration discovered by CONTRA in 86.6% of cases.

W3: We agree that these controls are needed to attribute the gains. We therefore evaluated the following variants on the top-10 skills subset, using the same budget of 125 configurations per target action and the same success criterion:

MethodDescriptionASR
CONTRAOur main method53.1%
Greedy searchAlways modifies the highest-scoring configuration40.6%
Random selectionParent sampled uniformly from the archive31.2%
Random searchAlways modifies the initial configuration25.0%
Single LLMOrchestrator writes the files directly, no sub-agents43.8%

As can be seen in the table, every component of CONTRA is beneficial to an effective search. Due to computational cost, we plan to extend these ablation studies to a larger set of 25 skills for the full submission.

W4: Regarding the annotation procedure, human annotators assessed the combined success criterion: whether the target action was executed and the trajectory was rated unsafe (safety score ≤ 3). Because actions the user explicitly authorized are not penalized (Table 8), this label already requires deciding whether the action was authorized. Disagreements on that distinction would therefore appear as errors, which are bounded by the 1.5% error rate. We have clarified this in Section 5. Whether a configuration implicitly requests harmful behavior is assessed by the maliciousness judge, which we address in our response to W2.

Regarding the adaption to the judge agent, three pieces of evidence speak against this:

  • The human validation was performed on trajectories sampled after the search had optimized against the judge. If CONTRA exploited judge-specific preferences, humans would reject many of the judge’s positives. Instead, precision is 0.99.
  • Re-evaluating the same trajectories with four other judge models increases the ASR in every case (Table 6).
  • When the assistant is a different model from the Red-Team and the judge (Table 4), the ASR rises from 48.0% to 52.9–73.5%. Our results therefore do not rely on the assistant sharing a model with the other components.

Finally, all target actions generated by Gemma4-31b were manually inspected, with 14.2% removed and 12.0% re-rated for severity (Section 5).

Comments on the paper

1 comment
AuthorsOpenReview ↗

Summary of Changes

Dear AC, SAC, and Reviewers,

We thank the Reviewers for their constructive feedback. As the discussion period is ending soon, we would like to summarise the changes made to the paper. All changes in the revised manuscript are marked in blue.

New Experiments

  • Benign-only results (Qixw, u2x5): Table 2 now reports benign-only and overall success rates separately. We also integrated the maliciousness judge into the search: if a successful configuration is flagged as malicious, the remaining budget is used to find a benign yet successful version of it.
  • Fixed task and tools (Qixw, u2x5): We rerun CONTRA with the user task, simulated tools, USER.md, and HEARTBEAT.md frozen at initialization, so that only the remaining configuration files change. Results can be found in Table 6.
  • Ablations of CONTRA (Qixw, u2x5): We compare CONTRA with random search, search without judge feedback, greedy selection, and a single-LLM variant Results can be found in Table 7.
  • Ablations of Skill-Hardening (u2x5): We evaluate hardened skills against Indirect Prompt injection and Direct Instruction, and analysed the impact of safety instructions and tool wrappers separately in Section 5.4. We further clarified that the discovered defenses are specific to individual target actions.

Clarifications

  • A definition of harmful actions in Section 3.1, with examples for each severity level in Table 10 (LYmh).
  • A clarification in the introduction that each skill is held fixed while the configuration files are searched over (LYmh).
  • A clarification that the human validation of the judge covers the combined success criterion (Qixw).
  • An example of a hardened skill in Appendix A.5. (LYmh).

We believe these changes strengthen the paper and are happy to answer any remaining questions.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.