Model Editing as a Double-Edged Sword: Steering Agent Ethical Behavior Toward Beneficence or Harm

Baixiang Huang, Zhen Tan, Haoran Wang, Zijie Liu, Dawei Li, Ali Payani, Huan Liu, Tianlong Chen, Kai Shu

Abstract

Agents based on Large Language Models (LLMs) have demonstrated strong capabilities across a wide range of tasks. However, deploying LLM-based agents in high-stakes domains comes with significant safety and ethical risks. Unethical behavior by these agents can directly result in serious real-world consequences, including physical harm and financial loss. To efficiently steer the ethical behavior of agents, we frame agent behavior steering as a model editing task, which we term Behavior Editing. Model editing is an emerging area of research that enables precise and efficient modifications to LLMs while preserving their overall capabilities. To systematically study and evaluate this approach, we introduce BehaviorBench, a multi-tier benchmark grounded in psychological moral theories. This benchmark supports both the evaluation and editing of agent behaviors across a variety of scenarios, with each tier introducing more complex and ambiguous scenarios. We first demonstrate that Behavior Editing can dynamically steer agents toward the target behavior within specific scenarios. Moreover, Behavior Editing enables not only scenario-specific local adjustments but also more extensive shifts in an agent's global moral alignment. We demonstrate that Behavior Editing can be used to promote ethical and benevolent behavior or, conversely, to induce harmful or malicious behavior. Through comprehensive evaluations on agents based on frontier LLMs, BehaviorBench shows the effectiveness of Behavior Editing across different models and scenarios. Our findings offer key insights into a new paradigm for steering agent behavior, highlighting both the promise and perils of Behavior Editing.

Introduction

As Large Language Models (LLMs) transition from simple chatbots to autonomous agents making decisions in healthcare, finance, and law, their ethical reliability becomes a "high-stakes" issue. Traditional alignment methods like Reinforcement Learning from Human Feedback (RLHF) are computationally expensive, require massive datasets, and focus on broad, global values. They often struggle with fine-grained, context-dependent ethical nuances.

Researchers have introduced Behavior Editing, a method to surgically steer the ethical conduct of LLM agents toward either benevolent or malicious outcomes without expensive retraining. This approach treats moral alignment similarly to factual knowledge, allowing for precise modifications to an agent's moral reasoning.

Methods: Surgical Ethics for LLMs

The authors frame ethical steering as a Behavior Editing task, exploring two primary strategies:

  1. Behavior-as-target: Directly modifying the action an agent takes in a specific scenario.
  2. Judgment-as-target: Altering the underlying moral evaluation the agent uses to justify an action.
Conceptual overview of Behavior Editing: steering agents toward benevolent or malicious outcomes.

They tested several model editing categories:

  • Locate-then-edit (e.g., ROME, MEMIT): These methods identify specific "knowledge neurons" or layers responsible for a behavior and modify them directly.
  • Parameter-Efficient Fine-Tuning (e.g., FT-M, LoRA): Selectively updating a small subset of model weights to minimize unintended changes.
  • In-Context Editing (ICE): A parameter-preserving approach that uses specialized prompts at inference time to shift behavior without changing the underlying model weights.

BEHAVIORBENCH: A Multi-Tier Evaluation

To systematically study this approach, the study introduces BEHAVIORBENCH, a multi-tier benchmark grounded in psychological moral theories (like Kohlberg’s stages of development). It consists of 1,001 moral scenarios across 10 datasets, organized into three tiers:

  • Tier 1: Moral Sensitivity: Detecting if a situation has moral relevance (using Social Chemistry 101).
  • Tier 2: Moral Judgment: Making and justifying decisions in low-ambiguity environments (using ETHICS and Jiminy Cricket).
  • Tier 3: Moral Agency: Acting and reasoning in complex, high-ambiguity dilemmas (using MoralChoice).

Key Results and Insights

The efficacy of Behavior Editing is remarkably high across various models and scenarios. Parameter-modifying methods like ROME and FT-M achieved near-perfect efficacy in steering open-weight models like Llama-3 and Mistral.

Efficacy of different editing methods (ICE, ROME, FT-M) across various models and moral benchmarks for both malicious and benevolent editing.

The Global Shift and Stealthiness

A single targeted edit doesn't just change one response; it can induce a "global" shift in the agent's moral alignment across many different scenarios. This suggests that moral reasoning is deeply interconnected within the model's architecture. Furthermore, behavior editing is remarkably "stealthy." The researchers found that they could radically change a model's ethical behavior while maintaining its performance on general knowledge (BoolQ) and reasoning (GSM8K) benchmarks. The model still looks smart, even if its "soul" has been edited.

Resistance of Reasoning Models

Newer, "reasoning-capable" models (like OpenAI’s o1/o3 and Claude 3.7) are significantly more resistant to malicious editing than older models. They seem to have a more robust internal "moral anchor" that resists being steered toward harmful behavior via in-context prompts. Additionally, for proprietary models, In-Context Editing (ICE) was much more effective at making models "nicer" than making them "meaner," likely due to existing safety filters.

Conclusion and Future Work

The findings highlight both the promise and perils of Behavior Editing. While it offers a surgical way to "fix" an agent's moral compass, it also represents a significant security risk. Because these edits are so precise and maintain general performance, they are incredibly difficult to detect.

The authors call for urgent research into defense mechanisms and detection tools to prevent malicious actors from using these techniques to bypass ethical safeguards. Future work will focus on creating "un-editable" moral cores and more robust auditing tools for edited models, as well as exploring how these edits translate to physical robotic agents.

Summary updated

Abstract

Agents based on Large Language Models (LLMs) have demonstrated strong capabilities across a wide range of tasks. However, deploying LLM-based agents in high-stakes domains comes with significant safety and ethical risks. Unethical behavior by these agents can directly result in serious real-world consequences, including physical harm and financial loss. To efficiently steer the ethical behavior of agents, we frame agent behavior steering as a model editing task, which we term Behavior Editing. Model editing is an emerging area of research that enables precise and efficient modifications to LLMs while preserving their overall capabilities. To systematically study and evaluate this approach, we introduce BehaviorBench, a multi-tier benchmark grounded in psychological moral theories. This benchmark supports both the evaluation and editing of agent behaviors across a variety of scenarios, with each tier introducing more complex and ambiguous scenarios. We first demonstrate that Behavior Editing can dynamically steer agents toward the target behavior within specific scenarios. Moreover, Behavior Editing enables not only scenario-specific local adjustments but also more extensive shifts in an agent's global moral alignment. We demonstrate that Behavior Editing can be used to promote ethical and benevolent behavior or, conversely, to induce harmful or malicious behavior. Through comprehensive evaluations on agents based on frontier LLMs, BehaviorBench shows the effectiveness of Behavior Editing across different models and scenarios. Our findings offer key insights into a new paradigm for steering agent behavior, highlighting both the promise and perils of Behavior Editing.
BibTeX
@misc{huang2025model,
  author = {Baixiang Huang and Zhen Tan and Haoran Wang and Zijie Liu and Dawei Li and Ali Payani and Huan Liu and Tianlong Chen and Kai Shu},
  title = {{Model Editing as a Double-Edged Sword: Steering Agent Ethical Behavior Toward Beneficence or Harm}},
  year = {2025},
  eprint = {2506.20606},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.20606},
}
Figure