重构开发流程:用 Vercel Eve 构建 AI 代码审查与自动准入系统 How I AI 2026-08-05

PR 泛滥危机:重塑人机协同审查

随着 AI 辅助编程工具的普及,无论是资深工程师还是编程新手,都能以极高的效率编写代码并推送到 GitHub 仓库。然而,这种生产力的爆发也带来了一个严峻的副产品——PR 队列积压(PR backlog)。工程团队往往需要花费大量时间进行人工审查,使得代码评审成为整个交付流程中最严重的瓶颈。事实上,在 AI 时代,我们并不需要对每一个 PR 都进行 1:1 的人工审查。通过在评审流程中引入 AI Agent,对 PR 进行自动化风险分级并对低风险修改实现自动审批(Auto-Approval),可以让团队将精力集中在真正需要人类经验的高风险逻辑修改上。

这一实践并非天马行空,诸如 Intercom 等行业先驱已经成功落地并验证了该方案的可行性。Intercom 通过引入 AI 代码评审 Agent,在保障代码安全和合规性的前提下,将其 PR 吞吐量提升了数倍。数据显示,AI 评审的 PR 审批速度比纯人工评审快 5 倍,且由于 AI 编写的代码和自动化审查的严密性,其线上故障回滚率(Revert Rate)反而大幅下降。同时,在 SOC 2 或 HIPAA 等需要严格审计的合规环境下,只要在安全和变更管理策略中明确定义 AI 的职责和评估规则,并保持审批流程的可追溯与可防御性,AI 评审便完全能够满足合规合规审查要求。

Original English Source

Everybody is drowning in AI created PRs. When anyone can code, anyone can cook and anyone can vibe anything to GitHub. That means that a lot of us are sitting on a big queue of pull requests that then we have to review. If you are an engineering leader or a software engineer in a company that has embraced AI in any way, shape, or form, you feel this pain. And I get this question all the time. We've figured out how to code with AI. Now, what do we do with all these PRs? Well, people smarter than us have figured this out. And you know what the answer is? You don't have to review all your PRs. Yep, you heard it here first. You do not actually have to review one-on-one by a human all those PRs. So, in today's episode, I'm going to show you how to build your own PR review, risk scoring, and automatic approval bot so you can take all the low-risk PRs off your plate, get those to production, and focus on the ones that really require your human expertise. This episode is inspired by a couple folks, especially our past how I AI guest Brian from Intercom, who has led the way in autoc scoring and auto approval of PRs, but I'm going to show you exactly how it gets done and we're going to get it done very quickly in this 30 minute how I AI mini episode. Let's get to it.

...

Okay, I know what you all are thinking. You're thinking, Claire, you are crazy. Of course, I have to review every PR that comes out of AI. That's just how it's done. We review all of our human PRs, so I have to review all of our AI PRs. And I am telling you in 2026, the answer is you can safely not review PRs by putting AI in the loop. And I want to call attention to two blog posts that have really inspired me in this process. One is from Intercom about how they made AI approved PRs safe. If you don't know, Intercom has 2x 3x their PR throughput. They are shipping a lot of code. That means they had a lot of code to review and so they built a PR review agent that scores their PRs and then auto approves them. And what I love about what Intercom has done here is they don't just worry about speed and velocity and volume. Yes, they've multiplied the PRs across their R&D organization. Yes, they want to get those PR cycle time down and those reviews out quickly. But what they really think and what they've proven with their adoption of AI is that AI approved PRs and AI written code in general can be even safer and even higher quality than what you're doing with just a human in the loop. And so they have used AI as an advantage when it comes to safety and quality as opposed to a disadvantage for safety and quality. And to set the vision of what you can expect here, I love that they shared some metrics. One is that AI approved PRs are approved faster, actually five times faster than their human PRs. So one, you are getting some speed. Two, they are seeing higher quality. So the revert rate, the amount of code that has to be fixed after it hits production is much lower when they write that code with AI. And then they figured out how to label and trace and audit all those changes and approvals so that they are in compliance with all of their required compliance frameworks whether those are SOCK 2, HIPPA, etc. So I often get this objection from folks. They say well I'm in a sock 2 environment. I couldn't possibly auto approve PRs. But in fact, there are frameworks. As long as it's in your risk policies, as long as it's in your code review policies, as long as it's auditable, queryable, and defensible, you can do this within your compliance framework, although work with your security and compliance teams to figure out how this can work for you. And so, I really love just this whole concept. I also took some inspiration who took inspiration from Intercom on this rewindbot, which is a little bit more of the technical way that they review PRs. And so this blog post about Diff Vader, which I love, shows a couple components of how they've scored risk, whether it's blast readiness, how correct it is, if all the actions have run, etc. And so between these two blog posts, I had a really good starting point for building an agent.

基于 Vercel Eve 的轻量级 Agent 落地

构建这样一个 PR 风险评估与自动审查机器人的门槛已经显著降低。无需依赖复杂的重量级 Agent 部署框架,直接使用 Vercel Eve 就能非常便捷地在企业内部环境中落地。Eve 的核心优势在于将 Agent 的定义简化为了包含 instructions(指令)、skills(技能)和 typescript/markdown 代码的轻量级目录,这与传统的 OpenClaw 等工具相比更为直观和容易开发。

更重要的是,通过 Vercel Connectors 提供的开箱即用式凭证管理与第三方系统接入,团队可以轻松避开传统 GitHub App 或 Slack Bot 繁琐的 OAuth 授权、刷新 Token 维护以及网络监听配置。在实际开发中,你甚至可以直接使用 Codeex 结合 Chrome 浏览器控制(Browser Use: 基于浏览器的自动化工具)在后台代理登录并自动完成全部的 SaaS 权限配置,开发者只需要关注核心的业务逻辑审查代码。

Original English Source

I knew that I wanted to do this for chat PRD. I knew we had a lot of low-risk PRs that were just sitting in the queue because my colleague and I were not getting to review them. It was kind of boring, especially a lot of like Devon authored PRs. And so, this was going to be a really high impact thing that I knew I could build. And it also let me work with a new framework that I'm excited to demo for you all here on how I AI. So, we're going to go to this codeex vibecoded deck and we're going to walk through how I built a code review risk scoring bot with Versell's Eve. So, if you have not heard about Eve, I'm a little bit obsessed with Eve. Why do I like Eve? Well, Eve has become the simplest way for me to deploy AI agents in the enterprise in Slack and GitHub without the torture and pain of something like Hermes agent or my beloved OpenClaw. So when I'm working and helping other companies sort of like think about how to deploy agents, if they're using Verscell, I tell them to use Eve. Why do I tell them to use Eve? Well, what's awesome about Eve is a lot of it is just a directory. An EVE agent is very similar to OpenClaw, just a directory of instructions, skills, code, and it can talk to you in channels that are out of the box in Verscell. So again, it's like very easy to set up the agent. It's very easy to give it skills, which we all use. It's very easy to give it tools. It can even have a sandbox in which it can execute things, including your code if you're doing a code review. And then my favorite part is managing talking to the agent in specific channels and connecting it to enterprise data is super easy. So because Verscell has shipped a Verscell connectors, which are like managed connections inside your Verscell account, you can just literally go through like a little wizard to hook up Slack to your Eve agent, a little wizard to hook up GitHub to go through your agent and it's all set up. The refresh tokens, all that stuff. Everything that's painful about creating an agent is just taken care of. And I sound totally like a Versel shill. Um, I've just tried a bunch of stuff and this has been the easiest framework to get up and running. It uses the chat SDK behind the scenes and if you are creating any sort of chatbot in Slack, Teams, WhatsApp, whatever. I mean, bless. I have I was asking for this chat SDK for a long time. It got built. This is an open source framework that I think is so useful whether or not you use Eve or not to stand up a chatbot. It just like takes away all the complexities of managing like multi-channel agents. It handles all like the Slack configuration. It gives you a manifest for Slack. Like I love it that chat pier Slackbot and Teamsbot actually runs on the chat SDK, but it's even better when it's bundled into this e framework. And so, and I highly recommend you try E framework. Again, like they didn't pay me to say this. I just really like it. And I found it super easy to use. And now every agent that I'm creating that I want to interact with in Slack for an internal use case if I don't already have an openclaw, I'm porting over to Eve. So, how did I actually build this? What does the agent do? Well, I built it in codeex. And so I'm going to show you the amazing prompt where I started this PR review bot which is says I want to make an internal GitHub bot/app that reviews PRs after all CJ checks that's checks are green and grades low medium high-risisk and approves the low risk oh my god you guys I can't type all all the typos approves the low risk PRs automatically that's all I did and then I interrupted it I steered it and said we could design it as a Verscel Eve agent if you want and it said, "Sure, that seems like a good good idea." And it was off to the races. And so, instead of going through kind of like the chat on Codeex on how I built this, this took a couple turns, but really not that many. I would say a couple things that were like magical as I ran codeex is not that it did the code for the Eve agent and the repo. That was fine. That was interesting. And I'll tell you a little bit about how the code actually works in a sec. But what was actually awesome is if you've ever set up a Slackbot or a GitHub app, you have to like click through a bunch of configuration screens. You have to pick permissions. You have to do all this stuff. And so what I did is my favorite hack is I had it use Chrome browser use and I let it navigate Slack bot setup. I let it navigate um GitHub set up and I just like clicked buttons in 2FAD and just double checked that it was right. And so I said, you know, is it configured yet? It said no. It needs to configure all this stuff and the permissions on the GitHub bot. I was like, great, you're logged into Chrome. And then I was like, I can press save. It was having a hard time press save. And so if you're just sort of like metatip if you ever have to do like complex SAS configuration set up an app you're like uh I'm fine writing code but I don't want to do the configuration in somebody's third party service using Chrome browser use is such a useful hack to get that stuff done. So again I just built this in codeex. I actually didn't give it any instructions on scoring. I didn't give it any instructions on configuration. I didn't give it any instructions on risk. I just said kind of like oneish shot it few shot this into production. And so I want to talk a little bit about what the agent does and how it works.

系统工作流与多维风险评分机制

该 PR 审查机器人的核心工作流十分清晰:

  1. 事件触发与沙盒运行:一旦 PR 提交并且所有 CI/CD 单元测试检查项全部通过(Status checks green),由 Vercel 托管的 GitHub 接入程序将被触发。Eve 自动拉取当前 PR 对应的分支代码并将其检出到安全沙盒(Sandbox)中。
  2. 差异与元数据分析:Agent 自动调用 GitHub API 读取 PR 所有的 Diff 内容及关联元数据,开始评估修改意图。
  3. 风险分级与决策:调用内置的评分算法,生成 1 到 100 之间的量化分数。
    • 低风险(<24分):如纯文档(Docs)更新,由机器人自动审批通过。
    • 中风险(25-64分):如涉及关键业务逻辑修改,但存在一定的范围可控性,仍需人工接入。
    • 高风险(>65分):涉及核心 API 逻辑变更、认证机制修改或存在数据库迁移(Schema Migrations)等大影响面操作,会立即挂起审批并通知人类。
  4. 两步合规准入与 Slack 提醒:受限于许多团队为了合规设置的“分支保护规则”(Branch protection rules,例如必须有至少一位注册开发者的物理审批),机器人在评分通过后并不会强行强推合并,而是将评估的详细报告与快捷链接直接推送到团队专属的 Slack 频道。工程师仅需确认 AI 盖章的“低风险结论”,便可在 Slack 中双击一键通过并完成代码合并。

具体的多维风险评估标准主要围绕以下六个核心维度进行打分:

评估维度 核心考量点
变更面与爆炸半径(Blast Radius) 该变更影响的模块数量以及用户流量占比。
可逆性难度(Reversibility) 变更发生异常后,是否能够轻松通过回滚(Revert)快速修复。
数据与信息安全(Data Security) 是否涉及用户敏感数据处理、计费(Billing)或身份验证(Auth)逻辑。
运维稳定性影响(Operations Impact) 是否需要伴随复杂的线上配置变更或基础架构拓扑调整。
测试完整度差距(Verification Gap) 该 PR 的单元测试覆盖率是否充足,核心路径是否皆被覆盖。
代码冲突与阻碍点(Blocking Blockers) 即使评估分值再低,PR 若本身存在合并冲突(Merge Conflicts)或 CI 失败,也会被扣分至挂起状态。

在完成上述逻辑配置后,团队还需要建立面向 AI Agent 的 评估基准与反馈闭环(Evals: 离线与在线效果评测机制)。每一次机器人的决策和打分数据均会持久化至企业内部的评估看板上,开发人员可以定期审计“AI 打分是否合适”、“是否存在误判”,从而持续调优 Agent 的 Prompts 和权重规则。

Original English Source

Well, it's pretty simple. If you were building a PR review agent, this is what I would suggest suggest you do, which is it reads the PR. It looks at the exact diff um and it scores the risk and it publishes the evidence to the risk. If it's low risk, if it's assessed that it's a lowrisisk PR, it submits an approval on the PR. If it needs a human, it escalates to human. And if there's a blocking um requirement, then it stops and it it will require a a request change. So, it's like very similar to how a human would do code review. How does it work from a technical flow perspective? So, the GitHub I have a GitHub app. It keys off an event after all of the PR changes are done. Verscel's GitHub integration, picks that up in the GitHub Versel channel, and it sends it a little bit of information. Verscell spins up its sandbox. It checks out the repo. It runs it and looks at the diff. It runs a couple skills and tools to assess the risk and quality of the PR. And then on the end it outputs like a thumbs up check uh like it needs changes and a comment. And then one fun thing that it does is after it does that review, it pings my colleague and I in Slack to say this PR is ready for review or it needs some help. So if you were to set up your EVE agent to be similar to mine, what would it have? Well, it would have a couple things. It needs to have the GitHub um channel. It needs to have instructions, which I can show you a little bit of the instructions. It needs a skill to review the PR. It needs two tools, read like all the files and information around the PR and then how to actually put a risk decision in. And then it has, you know, a couple things like a Slack notifier. So, this is not that many files. It's pretty simple. I will show you our instructions just to make this like very clear how easy it is to set this up. It's a chat par engineering agent. It reviews PRs. It calls the risk context. It scores it and then it has a couple instructions. This is it. There is no scrolling. It is like four four or five paragraphs, a couple bullet points, and it's ready to go. You do not need to overengineer this. And it works really really well. So, this is again why I like this Eve agent framework because you're just working in natural text or in Typescript and it's super easy to implement. setting up the GitHub app. You can ignore this. I mean, I guess like point your agents to this instructions. I did not do any of this. Again, Chrome browser use did this on our behalf. And so, it just has to have access to the pull request, the contents of your files, um, CI checks and a action checks and then some metadata. And I just had forcell set all that up. It has a couple rules on when it's triggered. So you don't want it triggered on every PR before checks are done. So I kind of had to like reduce some noise in the PR rules and then there's just two basically steps to this. It reads the PR. It's like a skill to read the PR. I will show it to you. It's not that thrilling, but again just showing you how simple it is. It reads and reviews the PR. It has a couple repo specific uh risk kind of categories. So like docs are low risk, feature log logic is medium risk and then like authentication billing is high risk. Diff size does not set risk and then it gives some like instructions on writing. Again, this is it. It's like not that much. Maybe one page of text. I did not write any of this. I refined it. And so what I'm trying to reinforce to you is like writing these agents is not that hard. It is literally just writing instructions and skills. That is what it takes to create an agent like this. And that's why I like this e framework because you can do a lot of it in markdown. And then once it reads the code, it scores the risk. And so it looks at six things. How big is the change surface and blast radius? Is it easily reversible? Right? Like a huge data migration may be harder to reverse. Does it touch data security and does it cover data security? Does it change anything about our operations? And verification gap is like are our tests complete? Did CI complete? Can we actually test a couple ways that this is true? And then it has sort of like a script that it runs to calculate a score. And then anything under 24 points I again I did not like choose these thresholds. Anything below 24 points is low risk. Medium risk is 25 to 64 and then 65 and above is high risk. Medium and high risk PRs require human approval. Um, so it's pretty simple. There's some logic in here to only review the latest changes, which I like. And then the final piece is it escalates us to us in Slack for final action. So we have repo rules probably very similar to all of you that requires a review in our GitHub to like match all of our our sock 2 compliance requirements. It just makes auditing and um management of our compliance really easy. I went through a couple ways where the bot could like quote unquote act like a human to do the review. It just didn't seem worth it. So, what it does is escalate to Slack and then it says this one's been automatically reviewed. You can punch the approve button and merge and you're good good to go. And so, we sort of like built in an operational process here as well. But let's see what this actually looks like in action. So, I have three PRs for you. Um, just to show you kind of how this works. Now, the the PR bot's called Merge Mommy. She is Merge Mommy, the PR review bot. Um, you know, when you make internal bots, we don't have Div Vader. We have Merge Mommy because we're fun at ChatPD. And this was a docs only update automatically done by Devon. And typically, I just like smashed the approval button on these, merged them, but I found that like we were just getting queued up of a lot of Docs changes that didn't really need a bunch of review. And so what happens on um once the PR is ready to go, Merge Mommy runs, it gives a risk score 6 out of 10. It's very low risk because it only changes docs, but it's not auto approved because it has merge conflicts. So that's one of the scoring issues that it has to check. And then there are some detailed notes here about why it's blocked in the approval blocker is the pull request has merge conflicts. A cleaner example here is this doc which I already merged which again went through and said it's 7 out of 10 low risk. It's auto approved and you can see up here merge mommy gave a little check that said it's approved. Now what we do with these approved PRs as I said is we send them to a Slack channel. And so the Slack channel says, "Hey, either of you can take this, approve it. The risk is low, the checks are green. You just need to smash that approve button and merge it." So, it's just like a really nice automated flow. Now, why do we have to have a human do it? As you can see, this check mark is gray. A bot cannot actually meet our repository rules for required approval. And so, we can either skip those rules, hack around it. We just decided this check would be a signal that our humans can approve it without really looking at it and then merge it as we want. And then let's show one where merge mommy did not approve it. This is a deprecation PR. So we had chat v1 and chat prd and we're moving to chat v2. We kind of like refactored a bunch of code but we left the old stuff behind a feature flag and it was like ready to delete. So there's like 35 changes big red diff that we wanted to delete. And you can see here, Merge Mommy, I'm sorry. I can't take myself seriously when I say it, but I'm going to say it anyways. Merge Mommy gave it a 45 out of 100, a medium risk, and it was not approved by a human because both it had some code issues as well as the policy said it changed server API behavior. it was a large change service and so it's medium not low and it can't approve the PR. Now we can run this against every PR that goes through our process and again we're going to just keep getting these notifications in Slack um that just let us know hey this can be approved or this requires human review. Again I like to say this thing where we can put AI to work for us or we can have AI put us to work. And this is an example where you do both. I've put AI to work, this lovely EVE agent. I put AI to work to review and score the PR and tell me if there's any risk and like be detailed eyes on it. And then I have AI put me to work by escalating into Slack for the final action and making it like a twoclick process to get this thing to production. Now, I just have to say this is something that I was really intimidated to build. I thought this was going to take me like days and days and days. I was like, I don't want to set up the GitHub app. I actually had tried this before Codeex like browser use was really good and before the Eve agents had come out and it was just like not easy to do. But now that we have these open source frameworks, now that we have these agent building frameworks, now that kind of like everybody's agreed that we need Slack bots that do AI, a lot of these problems have been solved and then Codex browser use was just like the cherry on top that made building this agent super super super simple. So to just recap for you all in this lightning fast mini episode about how to build a PR risk score and review bot use Verscell's EVE agents give it instructions and a skill to read a PR and calculate a score based on a couple components. Hook up that Verscell agent to GitHub and to Slack. Let it read from GitHub and give you a little gray check for approval and then have it slack you in Slack for that final human review and merge and your cycle time will be super super fast and your PR velocity will go through the roof. Now I want to hear from you all. Is this crazy? Can you pull this off at your company? and what would you put into your risk scoring that I haven't thought of? The final bonus piece off this, which I didn't show, but a lot of great folks do, especially the the folks at Intercom do as part of this process, is they run evals on this internal agent. So, every time this review is run, it gets logged into, I think it's like an internal eval platform, and an engineer looks at it and says, "Did the agent get this right? Did the agent get this wrong? Are we happy with the scoring mechanism? So, very similar to how you'd use evals to improve your customerfacing AI products, you're going to want to use evals to improve your internally facing AI bots, especially ones that touch really critical things like code. That has been my mini episode on how to build a PR approval and review bot here at Howai. I cannot wait to hear if you think this is crazy or this is the way of the future. Thank you so much for joining and we'll see you soon. Thanks so much for watching. If you enjoyed this show, please like and subscribe here on YouTube or even better, leave us a comment with your thoughts. You can also find this podcast on Apple Podcasts, Spotify, or your favorite podcast app. Please consider leaving us a rating and review, which will help others find the show. You can see all our episodes and learn more about the show at howiaipod.com. See you next time.

📌 文中提及的人物和组织

公司/组织: Vercel, Intercom, GitHub, OpenAI

产品/模型: Vercel Eve, Devon, Codeex

关键字: ai-agent code-review vercel-eve devops-automation