Lauren Tan 谈让 Agent 写出更正确代码的起点:自我验证
Lauren Tan 提出,让 Agent 更自主工作的最基本切入点是赋予其自我验证能力,即像真实用户一样实际运行和操作应用,覆盖 CLI、API、UI 等接口。验证应产出可审查的工件,证明工作正确、符合意图且比通读整个 PR 更易审查,UI 工作常用视频和截图。她指出 skill 包等都是可选的附加项,并提醒并非所有领域都易于验证,验证只是近似、仍可能出错。
okay now that we're past that tired discussion, let's talk about how we get agents to write more correct code (note: this won't mean the code will be Good, but it should at least work)
this is the entrypoint into your most basic agentic loop: verification. it means giving your agent the ability to verify its own work, most commonly by actually running and interacting with it like a real user would. whether your interface is a cli/api/ui/whatever, you want to start here so that your agents can close the loop. if you want you can even have your agents model the problem in TLA+ and attempt to verify if you have things like state machine bugs.
the point is to give yourself confidence in the agents' work by them producing some kind of artifact that proves that 1) that the work is correct, 2) that it matches what you intended, and 3) is easier to review than reading the whole PR. most commonly this would be a video and/or screenshots for UI work.
everything else like skill packs are really bonus and optional, all you need is a way for your agents to verify their own work to start using them more autonomously. some caveats are that not all domains can be verified easily yet, and that verification is just approximation and can still be wrong. it's no different than trusting that a human actually ran the code they wrote and trusting it
so start here!
来源:Lauren Tan · x.com