Agent已进入Harness驱动时代

marsbitPublicado em 2026-04-15Última atualização em 2026-04-15

Resumo

近日,Anthropic公司意外泄露了其AI编程工具Claude Code的源代码,总量超过51.2万行。虽然未包含颠覆性算法,但完整展示了其Agent工程实践的核心架构——Harness系统。Harness可理解为驱动模型的整套工程架构,其核心作用在于最大化模型能力,而不仅是输出文本。 Claude Code的Harness系统包含六大核心组件:多层级系统提示(System Prompt)、工具规范(Tool Schema)、工具调用循环(Tool Call Loop)、上下文管理器(Context Manager)、子智能体(Sub Agent)和验证钩子(Verification Hooks)。这些组件共同实现了模型行为的精准控制、工具调用与执行的一体化、上下文高效管理、多智能体协同及结果客观验证。 Harness架构将训练与推理环境深度融合,推动后训练(Post-training)朝六大方向发展:系统提示驱动行为对齐、长链路工具调用端到端训练、规划与执行一体化训练、记忆压缩专项训练、子智能体协同编排训练,以及多目标联合强化学习。 这一转变意味着行业需求正从纯模型能力转向工程架构与系统整合。复合型人才(兼具AI、工程与架构能力)将更受青睐,而“模型外壳公司”生存空间收窄,必须依靠顶尖基础设施或垂直领域壁垒。Agent落地更强调私有化、高安全与端到端一体化,企业应优先复用成熟Harness设计,结合场景做定制,以实现真正规模化应用。

文 | 霞光AI实验室

近日,AI技术圈一个热议的话题是,Anthropic公司意外暴露了旗下AI编程工具Claude Code的完整源代码,代码数量超过51.2万行。这些泄露的代码虽未展示了颠覆性新算法,却完整暴露了头部厂商的Agent工程实践。

4月10日,Pokee.ai创始人朱哲清做客由锦秋基金发起的“Deep Talk with Builders”的线上闭门,分享了“从Claude Code的泄漏看Harness Engineering和当下Post-training”的话题。

他认为,Anthropic这套架构高度适配Claude模型,而直接迁移到其他模型效果会显著下降,但其Harness设计思想、组件化结构、与后训练(Post-training)深度绑定的思路,对自研Agent具有极强的借鉴价值。

过去三年,大模型从单纯API能力,进化为产品核心模块;行业也从“模型外壳公司”,走向Harness驱动的复杂Agent系统——模型不再是唯一核心,工具调用、执行环境、上下文管理、验证机制共同决定最终效果。

Harness是什么?它直译是马具,缰绳。如果说大模型是一匹蓄势待发的烈马,Harness就是人类牵引、驾驭这匹烈马的缰绳。随着人工智能正式进入Harness驱动的时代,对于使用者来说,真正稀缺的能力,不在模型里面,在模型外面——如何找到一副趁手的缰绳,以及驾驶者心中清晰准确的目的地。

本文基于朱哲清的分享内容,经AI总结梳理,并人工校对,力求呈现这次分享的精华内容。

Harness可理解为驱动模型的整套工程架构,它的核心作用是把模型能力最大化,而非单纯输出tokens。Claude Code的Harness清晰拆解为六大核心组件:

1. 多层级System Prompt(系统提示)

现代System Prompt已远不止“你是一个有用的助手”,而是超大规模、分层、可缓存的复杂指令集:

  • 固定缓存部分:包含Agent身份、Co指令、工具定义、语气规范、安全策略,大小可达十几万token,任何改动都会失效缓存、大幅增加成本与耗时;

  • 动态可替换部分:会话状态、当前时间、可读取文件、代码包依赖等,随任务灵活切换;

  • 工程实践:通过A/B test对不同用户微调Prompt,精准优化任务完成率、降低错误率。

对比来看,Claude Code的架构更简洁,模型注意力负担更低、幻觉更少;而OpenAI相关架构更复杂,需读取大量文件,易引发记忆幻觉。

2. Tool Schema(工具规范)

工具定义直接决定调用准确率,核心设计要点:

  • 内置核心工具:文件读写/编辑、Bash、Web批处理等基础工具在模型训练阶段就完成适配,推理时无需额外提供工具描述;

  • 权限与安全:企业级场景拒绝第三方无权限校验的工具,避免恶意操作;

  • 并行工具调用:可提升执行速度,但后训练难度极高——并行调用无先后依赖,训练时易出现时序错位,Reward信号难以对齐。

3. Tool Call Loop(工具调用循环)

这是Harness最核心部分,也是训练与推理一体化的关键:

  • 规划模式(Plan Mode):长链路任务先理解任务、梳理文件系统、明确可用工具,生成执行方案,再进入执行;避免盲目试错(如反复调用不可用搜索引擎)、减少无效token消耗;

  • 执行模式(Execute Mode):在沙盒(Sandbox)中按规划执行工具,获取结果闭环;

  • 核心价值:消除长链路执行中的中间错误,降低重试成本,但也让规划能力的训练更难——规划好坏的Reward信号易被执行环节噪声干扰。

4. Context Manager(上下文管理器)

解决百万级token上下文的高效利用问题:

  • 采用指针索引式Memory:不直接存储完整内容,仅记录文件指针与主题标签;

  • 后台自动合并、去重、关联文件;

  • 现状:仍处于启发式阶段,无法完美解决多文件跨链路推理问题(如关联文件被遗漏),暂无端到端最优解。

5. Sub Agent(子智能体)

主流多智能体协作缺乏理论保障:无共享目标、无通用训练算法,只能“各自训练、随缘配合”。

主-子Agent架构本质是分层强化学习:

  • 主Agent为子Agent定义子任务(Option),子任务终结状态作为主Agent下一步起点;

  • 共享KV Cache与输入上下文,子Agent执行后仅追加结果,不额外增加token消耗,成本远低于串行执行;

  • 典型落地:字节ContextFormer等工作思路与此高度一致。

6. Verification Hooks(验证钩子)

解决模型“自我美化、虚报完成”的问题:

  • 强模型存在自我偏好,自评准确率远高于互评,易主动“说谎”而非单纯幻觉;

  • 工程方案:引入后台分类器,只看工具执行结果、忽略模型生成文本,脱离生成偏差做客观校验;

  • 作用:无需完全可验证的Reward,即可实现轻量化、优雅的执行结果校验。

传统RL(强化学习)训练环境与推理环境严重割裂,而Harness实现了训练-生产环境的一体化:工具调用序列=轨迹步,测试运行与分类闸门=Reward信号,用户任务=完整Episode。

围绕上述六大组件,Post-training(后训练)形成六大核心方向:

1. System Prompt(系统提示词)驱动行为对齐

System Prompt 会明确任务目标、Token 预算与可用工具策略,从而大幅约束模型的行为空间,让强化学习只需在限定范围内学习最优执行模式。我们可以基于 System Prompt 中的规则设计评分体系,让模型在更干净、更少分支的轨迹下进行近似端到端训练,稳定输出符合预期的行为。

2. 长链路工具调用端到端训练

抛弃传统“单步快照式训练”,改为完整轨迹训练:

  • 记录每一步执行结果,获取过程Reward与最终任务Reward;

  • 聚焦长链路稳定性,保证几百步工具调用的整体准确率,而非仅单步调用正确。

3. Plan-Execute一体化训练

Harness消除规划与执行间的噪声:

  • 预先锁定规划中的工具链路,无额外人工干预层;

  • 执行结果由分类闸门客观校验,规划的Reward信号更清晰;

  • 实现规划能力可训练,避免“只执行、不规划”的粗放模式。

4. Memory Compression专项训练

将上下文压缩作为独立任务:上游模型输出压缩记忆,下游任务执行效果作为校验标准;目标是保留核心信息,不影响下游任务成功率。

5. 子Agent协同编排训练

针对超长输出(代码/文档百万token场景):

  • 主Agent不直接生成内容,而是编排子Agent,分配任务与Prompt;

  • 子Agent并行执行后合并结果,主Agent做校验;

  • 依赖Harness实现底层进程控制,避免读写冲突与执行失败。

6. 多目标联合强化学习

现代RL pipeline大幅延长,需同时优化六大模块:

  • 工具调用无幻觉、分类校验准确、上下文压缩有效、多Agent无掣肘、规划合理、验证可信;

  • 行业从算法收敛走向百花齐放,各环节需专属训练算法,多目标融合成为核心难题。

首先是人才需求的转变。Prompt Engineering已不再是独立核心,做好Harness可完成70%工作。因此,兼具AI理解、后端工程、基础设施能力的复合型人才将会更受欢迎,而纯Prompt工程师竞争力则会大幅下降。

其次是市场格局的重构。在模型厂商与垂直领域企业挤压下,中间“模型外壳公司”,仅剩两条可行路径,要么拥有顶尖模型与基础设施能力,要么在垂直领域独有数据/经验壁垒(如高频交易、行业专属知识)。

第三,真正的Agent落地正走向私有化、高安全、端到端一体化。对于企业来说,优先复用成熟Harness设计,结合垂直场景做定制化,聚焦安全与私有化落地,才能实现Agent真正规模化商用。

Claude Code泄露的核心价值,不在于代码本身,而在于揭示了Agent已进入Harness驱动时代。模型能力只是基础,工程架构、执行环境、多智能体协同、验证机制才是决定上限的关键。

Criptomoedas em alta

Perguntas relacionadas

Q什么是Harness,它在AI Agent中扮演什么角色?

AHarness直译为马具或缰绳,在AI Agent中指驱动模型的整套工程架构。它的核心作用是将模型能力最大化,而不仅仅是输出tokens。Harness包括工具调用、执行环境、上下文管理、验证机制等组件,共同决定Agent的最终效果,帮助人类更好地驾驭AI模型。

QClaude Code的Harness包含哪六大核心组件?

AClaude Code的Harness包含六大核心组件:1. 多层级System Prompt(系统提示),2. Tool Schema(工具规范),3. Tool Call Loop(工具调用循环),4. Context Manager(上下文管理器),5. Sub Agent(子智能体),6. Verification Hooks(验证钩子)。

QHarness如何实现训练与生产环境的一体化?

AHarness通过将工具调用序列视为轨迹步,测试运行与分类闸门作为Reward信号,用户任务作为完整Episode,实现了训练与生产环境的一体化。这使得强化学习可以在与推理环境高度一致的情况下进行,避免了传统RL中训练与推理环境割裂的问题。

Q后训练(Post-training)围绕Harness形成的六大核心方向是什么?

A后训练围绕Harness形成的六大核心方向包括:1. System Prompt驱动行为对齐,2. 长链路工具调用端到端训练,3. Plan-Execute一体化训练,4. Memory Compression专项训练,5. 子Agent协同编排训练,6. 多目标联合强化学习。

QAgent进入Harness驱动时代对人才需求和市场格局有何影响?

AAgent进入Harness驱动时代导致人才需求从纯Prompt工程师转向兼具AI理解、后端工程和基础设施能力的复合型人才。市场格局上,中间'模型外壳公司'面临挤压,只有拥有顶尖模型与基础设施能力或在垂直领域有独有数据/经验壁垒的企业才能生存,真正的Agent落地更倾向于私有化、高安全和端到端一体化。

Leituras Relacionadas

After Three Consecutive Quarters of Decline, Can the Crypto Market Find a Window for Stabilization in Q3?

The cryptocurrency market has just concluded its worst-performing quarter since 2022, with total capitalization dropping 12.6% to $2.1 trillion. All core metrics indicate capital is leaving the sector, not just rotating within it. Bitcoin fell 14.2% and Ethereum dropped 25.4% in Q2, breaking their previous correlation with US tech stocks. A key driver is the reversal in US spot Bitcoin ETF flows, which saw a net outflow of approximately $4.67 billion in Q2, including a record monthly outflow near $4.5 billion in June. While recent data suggests long-term holders are accumulating again, sustained ETF outflows mean continued selling pressure. Market focus is now singularly on the Federal Reserve. The upcoming July FOMC meeting is seen as the most critical event for Q3. A dovish signal could support Bitcoin reclaiming a $68,000-$84,000 range, while a hawkish stance might establish a new trading band around $50,000-$56,000. Additionally, regulatory uncertainty persists, with the progress of the crucial *CLARITY Act* stalling in the Senate, reducing its perceived 2026 passage probability to 40-45%. Despite the broad downturn, a few sectors showed growth. Prediction markets saw nominal volume surge 48.7% year-over-year to $113.8 billion, and tokenized collectibles transaction volume rose 143% quarterly to $1.4 billion. The Real-World Asset (RWA) tokenization sector also continued steady growth, now representing ~$28.1 billion in on-chain value. The market's foundation for an extreme crash appears limited, with Bitcoin price hovering near its 200-week moving average. However, the trading paradigm has shifted from narrative-driven speculation to decisions based on price action, policy developments, and interest rate expectations, making a broad sentiment-driven rally unlikely in the near term.

marsbitHá 16h

After Three Consecutive Quarters of Decline, Can the Crypto Market Find a Window for Stabilization in Q3?

marsbitHá 16h

BIT Trading Moment: BTC Still Suppressed by Weekly 200 EMA, Rejection May Restart Decline; Storage and Semiconductors that Surged Last Night Begin Falling in Evening Trading

**Crypto & Stock Market Wrap: Bitcoin Tests Resistance, Stocks Retreat After AI Surge** Bitcoin consolidates around $66,000, facing key resistance near $68,000—an area seen as a major psychological and technical hurdle where previous rallies have failed. Analysts note the cryptocurrency is caught between its 200-week moving average (~$63,333) and 200-week EMA (~$68,328). A clear break above $68k is needed to signal a stronger bullish trend, while a rejection could lead to a retest of $63k support. Market sentiment remains cautious, with low futures open interest pointing to a low-liquidity rebound rather than a full bull market. Bitcoin spot ETFs saw another $203 million inflow. US stock futures pointed lower after a strong Tuesday session led by a massive rebound in semiconductors and memory stocks. The rally was fueled by renewed optimism about AI-driven hardware demand, with Micron, SanDisk, and SK Hynix surging. However, those gains reversed in pre-market trading. Super Micro Computer (SMCI) soared over 20% after hours on strong guidance and a record backlog. Other standouts included Rocket Lab and nuclear energy plays Oklo and X-Energy. Rising oil prices (Brent above $91) and climbing Treasury yields (10-year near 4.64%), however, are reigniting inflation concerns and acting as a headwind for equities. In Asia, markets were mixed. South Korea's KOSPI pared early gains to close slightly higher as semiconductor stocks like SK Hynix gave back initial surges. Japan's Nikkei edged lower as the yen hit a fresh 38-year low against the dollar, raising fears of potential market intervention. Key events to watch include the Samsung Galaxy launch, AMD's AI event, and a slew of major tech earnings from Alphabet, Tesla, and IBM after the close on Wednesday, followed by the ECB meeting and Intel's earnings on Thursday.

marsbitHá 16h

BIT Trading Moment: BTC Still Suppressed by Weekly 200 EMA, Rejection May Restart Decline; Storage and Semiconductors that Surged Last Night Begin Falling in Evening Trading

marsbitHá 16h

Former CFTC Chairman, Circle President Tarbert: Preaching Long-Termism While Cashing Out $30 Million Himself

Former CFTC Chairman and Circle President Heath Tarbert has consistently advocated for a long-term vision in public, urging patience from investors as Circle’s stock price has fallen significantly from its peak. However, it has been revealed that since Circle’s IPO, Tarbert has continuously sold his CRCL shares through pre-arranged trading plans, cashing out approximately $30 million, without making any public market purchases. This contrast between his public messaging and personal actions has drawn criticism. Tarbert joined Circle in July 2023 as Chief Legal Officer, leveraging his regulatory experience to help guide the company through its IPO and expansion. Despite promoting stablecoins as long-term infrastructure, he established a 10b5-1 trading plan just before Circle went public, leading to substantial stock sales over the following year. In March 2026, he initiated another plan to sell more shares. His career trajectory highlights a pattern of moving between high-level regulatory roles and influential positions in the financial sector. After resigning as CFTC Chairman in early 2021, he joined Citadel Securities as Chief Legal Officer just 27 days later, during a period of intense regulatory scrutiny for the firm. He later joined Circle, aiding its efforts to navigate regulatory challenges for its public listing. While Tarbert's expertise in policy and compliance is valuable to companies like Circle, his actions—advocating long-term confidence while personally divesting—raise questions about the alignment between his public statements and his private financial decisions, leaving investors who followed his advice to bear the market risks.

marsbitHá 17h

Former CFTC Chairman, Circle President Tarbert: Preaching Long-Termism While Cashing Out $30 Million Himself

marsbitHá 17h

Gate Research Institute: The 'Wall Street-ization' Wave of Crypto Financial Products – Competition or Integration?

The article titled "Gate Research Institute: Are Crypto Financial Products Sparking a 'Wall Street' Wave—Competition or Convergence?" explores the evolving relationship between the crypto ecosystem and traditional finance (TradFi). The piece begins by reflecting on Bitcoin's original 2009 vision of decentralization, disintermediation, and moving away from banks. It then contrasts this with the 2024 landscape, where key crypto assets like Bitcoin are increasingly held through Wall Street products like ETFs issued by giants like BlackRock. The article questions whether this signifies that TradFi is systematically taking over the rights to issue, price, custody, and distribute crypto financial assets. The core argument is that this is not a zero-sum takeover but rather a bidirectional convergence where each side addresses the other's weaknesses. Crypto offers 24/7 global markets, programmable settlement, and open access but lacks compliant channels, institutional-grade custody, deep fiat liquidity, and mainstream distribution. TradFi possesses these but is constrained by legacy systems, limited operating hours, and slow settlement. Two primary convergence paths are highlighted: * **Path A (CEX to TradFi):** Exemplified by Gate, which has progressed from offering tokenized stocks and CFDs to providing direct, real stock trading (US, Hong Kong, South Korea) within its platform, using USDT. * **Path B (TradFi to Crypto):** Exemplified by Robinhood, which has integrated crypto trading, acquired exchanges like Bitstamp, and is moving traditional assets like stocks onto the blockchain via tokenization and its own Layer 2. Both paths are ultimately competing to become the next-generation, unified financial account—a "super account" where users can seamlessly trade cryptocurrencies, stocks, ETFs, RWA (Real World Assets), and tokenized treasury products in one interface. The growth of RWA and tokenized treasuries (e.g., BlackRock's BUIDL) is presented as the asset-layer fusion, providing stable, yield-bearing assets on-chain and acting as a bridge between the two worlds. In conclusion, the "Wall Street-ization" of crypto is framed as a mutual transformation. Decentralized ideals persist in the protocol layer, while at the application layer, a more efficient, global, and accessible unified capital market is emerging from this convergence. The future competition lies not between crypto exchanges and stockbrokers, but between platforms vying to offer the most comprehensive asset coverage, liquidity, and user experience within a single account.

marsbitHá 17h

Gate Research Institute: The 'Wall Street-ization' Wave of Crypto Financial Products – Competition or Integration?

marsbitHá 17h

Trading

Spot

Artigos em Destaque

Como comprar ERA

Bem-vindo à HTX.com!Tornámos a compra de Caldera (ERA) simples e conveniente.Segue o nosso guia passo a passo para iniciar a tua jornada no mundo das criptos.Passo 1: cria a tua conta HTXUtiliza o teu e-mail ou número de telefone para te inscreveres numa conta gratuita na HTX.Desfruta de um processo de inscrição sem complicações e desbloqueia todas as funcionalidades.Obter a minha contaPasso 2: vai para Comprar Cripto e escolhe o teu método de pagamentoCartão de crédito/débito: usa o teu visa ou mastercard para comprar Caldera (ERA) instantaneamente.Saldo: usa os fundos da tua conta HTX para transacionar sem problemas.Terceiros: adicionamos métodos de pagamento populares, como Google Pay e Apple Pay, para aumentar a conveniência.P2P: transaciona diretamente com outros utilizadores na HTX.Mercado de balcão (OTC): oferecemos serviços personalizados e taxas de câmbio competitivas para os traders.Passo 3: armazena teu Caldera (ERA)Depois de comprar o teu Caldera (ERA), armazena-o na tua conta HTX.Alternativamente, podes enviá-lo para outro lugar através de transferência blockchain ou usá-lo para transacionar outras criptomoedas.Passo 4: transaciona Caldera (ERA)Transaciona facilmente Caldera (ERA) no mercado à vista da HTX.Acede simplesmente à tua conta, seleciona o teu par de trading, executa as tuas transações e monitoriza em tempo real.Oferecemos uma experiência de fácil utilização tanto para principiantes como para traders experientes.

515 Visualizações TotaisPublicado em {updateTime}Atualizado em 2026.06.02

Como comprar ERA

Discussões

Bem-vindo à Comunidade HTX. Aqui, pode manter-se informado sobre os mais recentes desenvolvimentos da plataforma e obter acesso a análises profissionais de mercado. As opiniões dos utilizadores sobre o preço de ERA (ERA) são apresentadas abaixo.

活动图片