如何构建足够健壮、有效的自动化智能体?
Anthropic 的这篇文章给了我们一个模版和工具,我提取出 8 点核心设计思想:
1. 清晰的系统边界:数据源 / agent 沙箱 / 发布目标 / 记忆系统 / 定时任务 / 安全护栏 。各模块职责分离,按读写权限控制系统输入、输出范围
2. 凭证与 agent 沙箱分离:凭证(vaults)保存在独立的可信凭证库中,agent 沙箱内部只能看到凭证占位符,通过指定的工具和白名单访问凭证
3. agent loop 是一个定时任务,下一次启动时如何保证读取的数据源 "恰好" 与上一次接续而不丢不重?它不以固定时间窗口来读取数据,而是通过一个 bookmarks.json 来记录每个数据源的最后成功读取时间。这样每次接续窗口会根据上一次的任务执行情况自动收缩
4. 失败处理原则:不隐藏失败、不中断整体执行。失败会在输出简报中明确告知用户,同时单个数据源失败不阻断整体执行
5. 记忆系统的写入时机:只有在发布成功后才会将标识成功的标记写入记忆,并通过补偿规则来保障发布不丢不重(分布式系统中的 exactly-once 问题)
6. 配置和执行分离:agent.md 用来维护一份包含 模型、提示词、工具 的配置;deployment.md 维护部署配置;preferences.md 维护可变配置项等
7. 读写分离和权限:preferences 对于 agent 只读,state 对于 agent 可读写
8. 设计护栏:所有的外部输入都应默认不可信,以避免提示词注入风险。通过有限的读写权限控制、以及额度保护,控制最坏情况的底线可控(这里我觉得还可以设计的更安全些,比如引入 system one 系统做执行前的门控)
从以上的 8 点设计思想可以看出,设计一套健壮可靠的智能体自动化流程,更多的是整体系统架构和边界设计(更偏 harness 层面),而不仅仅是 单个模型/skill 层面的调优
**形式化验证的基本概念**
形式化验证(Formal Verification)是用数学方法证明一个系统(软件、硬件或协议)是否满足某些属性,而不是像传统测试那样只检查有限的输入案例。
核心思想是:
- 你先用形式化语言描述系统的行为(状态、转换)以及你期望的“不变式”(invariants,即必须始终为真的属性,例如“不会死锁”“余额总和始终为零”“不会出现未定义行为”)。
- 然后用工具(模型检查器、定理证明器或类型检查器)进行数学证明或穷举探索所有可能的执行路径。
- 结果要么是“证明通过”(在指定范围内属性始终成立),要么给出反例(找到一个违反属性的具体路径)。
它主要关注两类属性:
- **安全性(Safety)**:坏事永远不会发生(例如不会越界、不会溢出、不会进入非法状态)。
- **活性(Liveness)**:好事最终会发生(例如请求最终会被响应)。
与测试相比,形式化验证能覆盖所有可能情况(在状态空间可管理的前提下),但历史难点在于建模成本高、证明难写、且容易与实际代码脱节。推文中提到的新工具正试图降低这些门槛,让 AI 代理也能借助它写出更正确的代码。
**推文中提及的方式及其支持的语言**
推文重点提到了三种方式:
1. **TLA+**
这是 Leslie Lamport 设计的规范语言,专门用于建模并发、分布式系统和状态机。它本身不是编程语言,而是独立的规格语言。你用它描述系统“应该如何行为”,再用 TLC 模型检查器或证明系统验证属性。
**支持范围**:语言无关。你可以建模任何语言实现的系统(Java、Go、Python、C++ 等),但验证的是设计/规格层面,而不是直接检查具体实现代码。适合发现并发、协议、状态机相关的逻辑 bug。
2. **Kani**
这是专门针对 **Rust** 的模型检查器。你在 Rust 代码中直接写证明 harness(类似测试,但用 `kani::any()` 表示任意输入),它会自动检查未定义行为、panic、整数溢出、自定义断言和函数契约。
**支持语言**:**仅 Rust**。证明代码就写在 Rust 文件里,不需要另起一套独立语言。特别适合验证 unsafe 代码块和关键正确性属性。
3. **Bend(Bendlang)**
这是一个完整的编程语言(语法接近 Python,带有依赖类型)。你直接用 Bend 写程序,同时在 `LAWS.bend` 中声明“法则”(laws,即必须始终成立的属性),证明写在类型系统中。编译器会机械地检查这些证明是否成立。
**支持语言**:**Bend 本身**。代码即规格,证明即代码的一部分,没有独立的建模语言。它还支持高性能并行和 GPU 执行,目标是让 AI 生成的代码能通过数学证明保证正确性。
总结来说,推文中的技能是一个“元技能”,可以根据你想验证的特性(例如并发状态机、Rust 未定义行为、或 Bend 的法则)自动生成相应的验证套件。TLA+ 更偏高层设计建模(语言无关),Kani 专攻 Rust,Bend 则是自带证明能力的编程语言。
pstack v0.15.27 ships with a new skill /create-formal-verification-skill!
it's still in beta, and similar to /create-verification-skill, this is a meta-skill that creates a new skill and formal verification suite based on the characteristics you want to verify. for example, you may want to model state machines and systems with concurrency using TLA+, or use kani in rust to check for undefined behavior.
if you're new to formal verification, think of it as mathematically proving properties and invariants (something that must always be true) or "laws" of your system. usually, this means modeling your programs in a separate language like with TLA+ and then running the solver on that spec. newer approaches like with kani and @bendlang take a different approach where there is no separate language: you write kani in rust, and bend in bend (it's also a programming language, and the proofs are written as laws and expressed in its type system).
historically formal verification never reached mainstream status because of the difficulty in modeling and writing proofs. it's quite difficult to model your business requirements and keep them in sync! but i expect that we will see more innovation in formal verification in the future as being able to formally verifiy that the code does what you intended gives your agents superpowers in writing correct software.
in the meantime though, i've been experimenting with modeling our code with TLA+ and have already found several bugs with the skill created by /create-formal-verification-skill.
try it out and let me know how it goes!
梁圣归来😆
看这张帕累托前沿图是真夸张啊
🚀 DeepSeek-V4.1-Flash-1017 is here!
Stronger benchmark performance, faster task completion, and shorter outputs than the previous version—a Pareto improvement in performance and cost. Now live on our website, app, and API.
🛠️ Optimized for @DeepSeekHarness, Tencent CodeBuddy, WorkBuddy, and more. Upgrade to DeepSeek Harness v0.2.1-rc.1 or later for the best experience with the new model.
1/4
独立测评者的测评结果,超过之前的国模第一 mimo-v2.6-pro 了:
xitter.cf/pawelhuryn/status/2111…
So I tested DeepSeek V4.1 Flash 1017 on real work. 2 repos. 105 hidden bugs. Find and fix what you can.
The first results:
Muse Wonder Full 1.0 (max): 42
Opus 5.5 (max): 41.7
Gemini 4 Argon (high): 40.7
DeepSeek V4.1 Flash 1017 (max): 34 🟣
Grok 4.7 (xhigh): 29
Qwen3.8-Max (max): 25.7
DeepSeek V4.1 Flash (max): 21.7 🟣
GLM-5.3 (max): 19
A great improvement. Strange that the model wasn't labeled V4.2.
763B params. The weights are already on Hugging Face.
I expect the score to change by ~1.7 points after repeating the test 3 times.
More data and results at different effort levels dropping in this thread very soon 🧵
我开源的 pi-matt-implement-flow 上线3周,在 pi.dev 的 mattpocock 关键词搜索结果排第一了 🥳🥳🥳
虽然下载量只有区区 1000+/month ,毕竟还是说明有人切实在用的。我自己也是开发项目时 dogfooding 一直在用,接下来会持续优化
简单介绍下:pi-matt-implement-flow 是用来替代 Matt Pocock 工作流中 /implement 的 pi 扩展工具,可以一键执行整个 spec 的所有 tickets ,每个 ticket 有独立 reviewer agent、以及最终的 final-reviewer。可中断续跑,可选生成审计报告(如下图1)
jev 1.14 预览版发布了,支持识图、以及可选的4倍上下文长度
查了一下:AA前两天刚刚上线了 System One 这类模型的评测,打分最高的并不是 jev,而是 d1-ultra
artificialanalysis.ai/articl…
we announced Jev 1.14 on 10.14 at 1:14pm PT 🔥
a new and improved model, along with experimental features for our dreamers:
• images
• a new box type
• longer context
surprise, Jev was already able to see you! 👁️
BUT our bar for production-grade intelligence is quite high, so builders beware, these are preview features.
enter the ~*~ danger zone ~*~ at your own risk. 🚨























