Grok Bot 团队 Lauren 提出信任 Agent 工作成果的四层倒金字塔框架
Grok Bot 团队的 Lauren 给出一套让 Agent 干活更让人放心的方法:优先改代码库而不是写提示词,提示词只排第三等。做 AI 编程的都该看看。
Grok Bot 团队的 Lauren (@poteto) 提出一个四层倒金字塔框架,用于提升对 AI Agent 工作成果的信任。第一层是代码库改进(架构、类型系统、模块边界),投入精力最多,因为 Agent 倾向复制已有代码、走最短路径,让最短路径就是正确路径。第二层是静态分析,包括 lint 规则、测试、CI 和 TLA+ 形式化验证,能在早期以低 token 成本确定性拦截问题。第三层是文字性指导如 AGENTS.md 和代码注释,因无法强制执行只能最少使用;第四层人工审查最难规模化,精力应投向设计让 Agent 默认做对的环境。
怎么才能更信任你的 Agent 的工作呢? Grok Bot 团队 @poteto 提出了一套如何信任 AI Agent 工作成果的四层“倒金字塔”框架。她认为,与其花精力“管教” Agent,不如花精力改造代码库本身! # 四层倒金字塔 (精力投入从上到下递减) 第一层:代码库改进 (投入最多) 更好的架构、更强的类型系统与不变量、清晰的模块边界。 Lauren 认为这本质上“就是好的软件工程”。理由在于 Agent 的天性:Agent 倾向于复制已有代码、走最短路径;所以与其对抗这个天性,不如让最短路径本身就是正确路径。 第二层:静态分析 Lint 规则、测试、CI、形式化验证(如 TLA+)。这是性价比很高的第二道防线,用极低的 token 成本在问题早期就拦截它,出错反馈是确定性的,不依赖 Agent “理解”了什么。 第三层:文字性指导 (最少使用) 代码注释、规则文件 (如 AGENTS.md)、Skills 描述等。这一层的共同弱点是无法强制执行,它要求 Agent 自行判断是否遵守,而 Agent 的判断并不总是可靠,所以只能作为补充,用在确实需要主观判断的场合。 第四层:人工审查 (最难规模化) 人的精力有限,不应消耗在逐行检查 Agent 产出上,而应投向更上游的事:设计出让 Agent 默认就做对的环境。 为什么金字塔是“倒置”的? 传统上团队把大量精力放在金字塔底部 (写规范、人工审查),而 Lauren 主张反转: · 越往上层,手段越是确定性的 (代码结构直接决定 Agent 能走什么捷径) 且token 高效的(不需要反复沟通纠偏); · 越往下层,越依赖不可靠的理解与不可扩展的人力。 这和业界近年 “从 prompt engineering 转向 context/engineering 工程” 的共识是同一方向;但 Lauren 把它推到了更根本的层面:连提示词本身都只是第三等手段,真正的杠杆在代码库里。 lauren @poteto how do you trust your agents' work more? copy this post/link and give it to your @bot or agent! 1. codebase improvements: this is just good software engineering - better architecture, stronger types and invariants, clear boundaries. agents love to copy what exists and take the shortest path, so make the easy thing the right thing. categorically eliminate problems through code and you won't need to think about it again. 2. static analysis: lint rules, tests, CI, verification (eg TLA+). very token efficient ways to catch issues ahead of time. 3. prose: comments, rules, AGENTS.md, skills - anything that can't be enforced and requires agent judgment. use it minimally, but do use /create-verification-skill. 4. human review: the hardest to scale. at the rate agents land code, it's pretty much impossible to thoroughly review every PR, so spend that effort on the highest leverage point, designing an environment where agents do the right thing by default. this forms an inverse pyramid: you want most of your effort at the top, least at the bottom. codebase improvements are deterministic, making it more token efficient, and lets you sleep more soundly at night. install github.com/cursor/plugins… and create a new Project: 1. look through my slack/chat messages and code review comments where i've given feedback on PRs, code, architecture 2. use /recall on my past transcripts to learn how i steer agents 3. /poteto-mode use /correct and /architect on past commits to find the most common pitfalls agents fall into, then propose a plan to rearchitect the code i own so it's more agent friendly. answer open questions with prototyping rather than defer to me, and back the plan with real data. 4. before you begin, use /sharpen + /in-your-own-words and confirm this prompt with me 🔗 View Quoted Tweet 💬 3 🔄 1 ❤️ 3 👀 276 📊 4 ⚡
- Viking10-15 07:49原文