Gate News 消息,3 月 25 日,蚂蚁集团工程师、前端框架 Umi.js 作者陈成逆向了 Claude Code 2.1.81 的源码,完整还原了 Auto Mode 的决策机制。核心发现:每一次工具调用都要经过四层决策流水线,只有前三层都无法判断时,才会调用独立的 AI 分类器做安全审查。
四层流水线依次为:第一层检查已有的权限规则,命中直接放行;第二层模拟 acceptEdits 模式(允许编辑文件的权限级别),如果在该模式下就会通过,说明风险很低,跳过分类器;第三层检查只读工具白名单(Read、Grep、Glob、LSP、WebSearch 等),这些不修改任何状态,无条件放行;以上都不满足时,才进入第四层,发送独立的 API 请求给 Claude Sonnet 做安全分类。
分类器的关键设计细节包括:始终使用 Sonnet 而非 Opus,是成本和延迟的权衡;temperature 设为 0 以确保输出确定性;分类器被定义为「自主 AI 编程 Agent 的安全监控员」,保护三类风险(提示词注入、范围蔓延、意外损害);用户的 CLAUDE.md 配置文件会被注入分类器上下文,作为判断用户意图的依据。
拦截规则覆盖 22 个以上类别,包括 force push、直推 main 分支、下载并执行外部代码、生产部署、数据外泄、自我修改权限、创建远程代码执行面、凭证泄露等。放行例外有 7 类:测试用的硬编码密钥、工作目录内的本地文件操作、只读 GET 请求、安装已声明的依赖、官方工具链安装、读取配置凭证发送到目标提供商、推送到当前工作分支。
系统还设置了熔断机制:连续 3 次被拒绝或累计 20 次被拒绝后,系统降级为手动确认;headless 模式下直接中止 Agent。分类器不可用时,由一个 feature flag 控制是「fail-closed」(直接拒绝)还是「fail-open」(降级为手动确认)。
Auto Mode 下的行为提示词注入有精细的频率控制:每 5 轮对话注入一次,每 5 次注入周期中第 1 次是完整版(约 800 字,包含「立即执行、减少打断、行动优于计划」等六条指令),其余 4 次是一行精简版,在上下文窗口占用和行为稳定性之间取得平衡。
Disclaimer: The information on this page may come from third parties and does not represent the views or opinions of Gate. The content displayed on this page is for reference only and does not constitute any financial, investment, or legal advice. Gate does not guarantee the accuracy or completeness of the information and shall not be liable for any losses arising from the use of this information. Virtual asset investments carry high risks and are subject to significant price volatility. You may lose all of your invested principal. Please fully understand the relevant risks and make prudent decisions based on your own financial situation and risk tolerance. For details, please refer to
Disclaimer.
Articoli correlati
Macro Recovery Drives Risk Asset Inflows; Crypto Market Shows Divergence Between Mainstream and Altcoins
Global risk appetite rose on easing Middle East tensions, lower energy prices, and strong institutional support, pushing equities to new highs; gold held gains while crypto and ETFs posted modest moves.
Global risk sentiment improved as tensions eased and energy prices fell, with equities at highs, gold firm, and crypto modestly higher; regulatory steps included France backing euro stablecoins and Circle's USDC Bridge.
GateNews8h fa
35% of European Investors Would Switch Banks for Better Crypto Services, MiCA Adoption Accelerates
Gate News message, April 22 — A survey by Boerse Stuttgart Digital found that 35% of European investors would consider switching banks for better cryptocurrency services, highlighting how digital assets are beginning to influence banking relationships across the continent.
The survey covered
GateNews8h fa
Eightco Holdings Discloses $336M Total Assets, Including 283.5M WLD and 11,068 ETH
Eightco's updated portfolio totals $336M, with Worldcoin at 23% (~$77M), OpenAI at 27% (~$90M), Beast Industries at 7% (~$25M), and $118M in cash/stablecoins; ETH remains at 11,068 tokens.
Abstract: Eightco Holdings discloses a $336 million asset mix led by Worldcoin, OpenAI investments, and Beast Industries, plus cash/stablecoins and an unchanged ETH holding of 11,068 tokens.
GateNews12h fa
Survey: 35% of European Investors Would Switch Banks for Better Crypto Services
Gate News message, April 22 — A survey by Börse Stuttgart Digital, the digital asset arm of Stuttgart Stock Exchange, found that 35% of European investors would consider switching banks if other institutions offered better cryptocurrency investment options. The study covered approximately 6,000 inve
GateNews12h fa
DDC Enterprise Reports Record $39.2M Revenue, Holds 2,383 BTC Worth $182M
DDC Enterprise reports 2025 revenue of $39.2M (+4.6%), holds ~2,383 BTC (~$182M) in the top 30, and unveils the AI-driven DDC Treasury Intelligence Platform for optimized Bitcoin fund management.
GateNews13h fa
Deutsche Bank Survey Shows US Bitcoin Adoption Rose to 12% in March, Up from 7% in February
Gate News message, April 21 — An investor survey by German banking giant Deutsche Bank revealed that cryptocurrency adoption in the US rose to 12% in March, up from a low of 7% in February, returning to levels projected for July 2025.
The report highlighted recovery in institutional demand as a
GateNews04-21 13:12