Agent MechSuits: white-box safety steering for multi-turn CLI agents by intervening in a 10-dimensional subspace of one layer
Agent MechSuits: Mechanistic Subspace Safety Steering for Multi-Turn CLI Agents
Weidi Luo, Qiming Zhang, Yihao Quan, Mingyu Jin, Jie Cai, Chaowei Xiao, Jingcheng Niu, Zhen Xiang
University of Georgia, University of South Florida, Rutgers University, University of Southern California, Johns Hopkins University, and Independent
Correspondence: zxiangaa@uga.edu
arXiv:2606.22673
Project page: https://eddyluo.com/Agent-MechSuits/
Abstract
Command-Line Interface (CLI) agents based on large language models (LLMs) demonstrate remarkable autonomous capabilities, but they also introduce significant safety and misuse risks during multi-turn interactions with external environments. Existing safety mechanisms mainly rely on external guardrails, which have a limited ability to perform fine-grained behavioral control during execution. Meanwhile, recent mechanistic interpretability methods for LLM safety are mostly confined to single-turn or jailbreak-style QA settings, limiting their ability to capture the evolving risk dynamics of multi-turn agent execution. In this paper, we investigate the safety of multi-turn CLI agents from an internal perspective. We propose Agent MechSuits (Mechanistic Subspace Intervention and Steering), a white-box defense framework that performs runtime safety detection and representation-level mitigation for CLI agents. Unlike conventional agent guardrails, Agent MechSuits detect harmful execution states from step-level hidden representations and mitigate unsafe behavior by intervening in a 10-dimensional subspace within a single layer. To support this research, we introduce the Mechanistic Agent Safety (MAS) benchmark, comprising comprehensively annotated multi-turn execution trajectories across 194 tasks using LLaMA-3.1-8B, Qwen-2.5-7B, and Gemma-2-9B. Extensive experiments show that Agent MechSuits achieves strong safety detection performance, provides preliminary evidence for lookahead risk anticipation, and substantially reduces harmful actions of the CLI agent, establishing a foundation for applying mechanistic interpretability to dynamic LLM agent safety.
Technical contributions (from the paper)
- The authors provide a mechanistic study of multi-turn CLI agent safety, showing that safety-relevant signals are linearly decodable from intermediate hidden states.
- They propose Agent MechSuits, a white-box safety framework that performs runtime detection and representation-level steering to suppress harmful CLI agent actions.
- They build the Mechanistic Agent Safety in CLI (MAS) benchmark: step-annotated trajectories generated by three white-box CLI agents in executable Docker environments across 194 tasks.
- Evaluated on LLaMA-3.1-8B, Qwen-2.5-7B, and Gemma-2-9B, Agent MechSuits achieves an average accuracy of 97.32% in current-step risk detection, shows up to 96.77% accuracy in lookahead anticipation, and reduces the average attack success rate by 72.63% across the evaluated models.
Main results (from the paper)
All three models achieve their strongest current-step probe performance in early-to-middle layers. LLaMA-3.1-8B reaches 99.15% accuracy at layer 12, Qwen-2.5-7B reaches 97.46% at layers 13, 14, 15, and 17, and Gemma-2-9B reaches 95.35% at layer 14.
On risk mitigation, Agent MechSuits reduces ASR from 73.80% to 16.70% on LLaMA-3.1-8B, from 91.30% to 4.35% on Qwen-2.5-7B, and from 92.86% to 14.29% on Gemma-2-9B. Averaged across the three models, ASR falls from 85.99% to 13.36%, a 72.63 percentage-point absolute reduction.
The improved safety comes with a generation-quality trade-off: the method increases the average collapse rate to 18.54%, compared with 2.24% for the vanilla agent. On benign tasks that the vanilla agent already completed, the protected pipeline retains success rates of 95.71%, 91.30%, and 93.18% (average 93.40%).
The authors note that the method requires white-box access, that lookahead examples are sparse, and that a practical deployment should combine internal monitoring with sandboxing, permission control, and review for high-risk cases.
https://arxiv.org/abs/2606.22673Reposted. Will be removed on request. All rights belong to the original author.
More from this batch
An independent tester added unreleased Qwen-4-Flash-Early (codename hawk) to GameFeel, with recapped scores of 49.9 vs 47.2 for Opus 5.5 XHigh
follistatindev says Alibaba granted early API access. Recaps of the tester’s charts list Flash-Early at 49.9, Opus 5.5 XHigh at 47.2 and an …
DoubleAI: an agent redesigns a network during training; DeepSeek-V4.1-Flash raising AIME/HMMT 2026 from 64% to 71% with a self-written code layer
The lab calls this mechanistic intervention: an agent reads internal state and changes data, objectives, update rules or architecture while …
HeliosLM: open Traditional Chinese (Taiwan) chat, speech recognition and safety models released on Hugging Face
Chat and safety models are based on Gemma 4 E4B-it; ASR models on Whisper large-v3. Self-reported CER on Common Voice zh-TW falls from 15.25…
claude-video:给代理看视频的 /watch 技能,下载、抽帧、转写后再交给 Claude 或 Codex
MIT 许可,Python,约 ★20188。把视频 URL 或本地文件变成带时间戳的帧和转写;优先用原片字幕,没有字幕可以用本地 WhisperX 或 Groq/OpenAI。可装进 Claude Code(桌面应用的 Code 会话、VS Code 或终端)、Codex 和其…
知乎热榜:54 岁大哥自学 AI 短剧登顶红果榜,普通人真能靠 AI 翻身吗?
这条问题以约 980 万热度出现在知乎热榜,讨论的是有人用 AI 做短剧登上红果榜、团队成员一年还清债务的传闻,以及普通人有没有可借鉴的路径。它更多是社会讨论而不是一手技术报告,但对想观察国内 AI 短剧商业化情绪的人,可以看出讨论已经从「能不能做」转到「普通人能不能靠它翻身」。
知乎热榜:张艺谋称 AI 带来「平视感」,「普通人都是导演、编剧」,怎么看?
热度约 99 万。讨论围绕张艺谋关于 AI 技术飞跃降低电影门槛、带来平视感的表态。这是文化评论而不是产品发布,但和近期国内 AI 短剧、AI 影像工具进入大众创作的讨论连在一起,可以看出影视圈对「人人都能当导演」这句话的分化反应。
Range 的理财规划师 Matt Ragone:没有编程背景的规划团队,怎样自己做出每天在用的 Agent 和技能
在 AI Engineer 的演讲里,财富管理机构 Range 的规划师讲他们的「选、教、打包、测、上线」五步:先挑每天重复的工作(现金流分析、保险评估),用真实案例和公司标准化文档教 Agent,打包成技能时让它先提问、并禁止直接发给客户,上线前用 5 到 10 个真实案例(含…
Tanmay Sah 和 Dolly Sah:编码代理做对任务,不代表它能撤回自己的错误
他们提出 Undo Bench:在 2880 次成对实验里,代理正常成功率约 84%,但一旦引入故障,这些原本能成功的实验里只有约 47% 能恢复;对「请求超时但外部操作其实已完成」这类情况,盲目重试在约 54% 的实验里造成了重复副作用。Git revert 只能撤回仓库里的改…
Addy Osmani: Your coding agents made you a manager
The Claude Code engineer argues that spending the day with coding agents is already management: choosing tasks, writing briefs, delegating, …
Rob Miles: I never want to use your AI assistant on your website. I want to use my AI assistant on your website
The AI safety researcher’s short post argues companies should let people bring their own agents rather than forcing a built-in assistant, a …
OpenAI’s Tibo: comparing GPT 6.1 Terra with Opus 5.5 is “pretty wild”; it isn’t meant to compete in the big leagues
Replying to a preference poll, Codex lead Thibault Sottiaux said Terra is a great model but not positioned against Opus 5.5, and that OpenAI…
The inventor of the bitter lesson has a bitter lesson for LLM scaling enthusiasts
The Decoder reports Richard Sutton’s latest reminder that raw compute is not enough, adds Jerry Tworek’s critique of a generation “reward-ha…