展示HN:将网页应用逆向工程为代理工具
大家好!我们开发了一个基于浏览器的代理,它在经过身份验证的网页应用程序内部运行,监控应用程序如何调用其自身的API,并自动将这些API转换为代理工具。你可以把它想象成一个自动生成的MCP服务器,随着主应用的变化而自我更新。
最终的结果是一个熟练的AI助手,能够与任何产品(不仅仅是聊天和RAG)深度集成,且几乎不需要额外的努力。
请查看下面这些简短的演示,展示了你可能熟悉的软件中的代理功能:
- Jira: [https://demo.frigade.com/hn?skill=jira](https://demo.frigade.com/hn?skill=jira)
- Spotify: [https://demo.frigade.com/hn?skill=spotify](https://demo.frigade.com/hn?skill=spotify)
- Hacker News(哈哈): [https://demo.frigade.com/hn?skill=hackernews](https://demo.frigade.com/hn?skill=hackernews)
- 完整演示: [https://demo.frigade.com/hn?skill=full-demo](https://demo.frigade.com/hn?skill=full-demo)
正如你在示例中所看到的,你可以做得比通常通过点击操作更快更多。而且我们甚至没有接触这些产品的源代码!
为什么要这样做?
在理想的世界中,每个应用程序都有一个MCP服务器或易于理解的API,供AI代理使用。然而,实际上我们发现,即使是非常现代的软件,往往也会有一张复杂的API和服务的蛛网,AI代理无法直接使用。安全性也是一个巨大问题,因为应用程序对如何保护端点(JWTs/ cookies/两者混合)有不同(通常是自定义的)标准。最后,让一个实际的浏览器代理代替用户使用应用程序(即计算机使用),实在是太脆弱、太慢,并且消耗大量令牌。
我们利用现有的浏览器代理,该代理已经经过训练,可以使用和学习经过身份验证的应用程序,并增加了一个额外步骤,自动将应用程序的身份验证API转换为“配方”。配方包含以下内容的组合:
- API端点 + 方法
- 身份验证方法(以及如何获取刷新身份验证令牌/ cookies)
- 响应模式
- 输入模式(用于POST/ PUT)
- 工具功能的可读描述
将这些整合在一起,这些就成为了可重用的工具供大型语言模型(LLMs)使用,完全不需要编写或维护任何代码。即使API发生变化,我们的代理也能识别并用更新版本替换工具的配方。
以这种方式为AI代理添加工具变得非常简单:
- 我们的代理在应用程序上进行训练并构建配方
- 应用程序所有者从我们的仪表板启用发现的工具
- 代理现在可以直接在应用程序内部代表用户采取行动。例如,像“邀请我的团队成员加入我的工作区”这样的请求将安全地调用现有的邀请用户的API端点,而无需通过第三方进行代理或转发。
当然,当你尝试这样做时,会遇到很多边缘情况——每个应用程序本质上都是不同的,尽管有多少“标准”存在。有趣的是:在标准化配方时,graphql是最难处理的API。
期待你的反馈和评论!
查看原文
Hey HN! We built a browser-based agent that runs inside an authenticated web app, watches how the app calls its own APIs, and automatically turns those into agent tools. You can think of it as an auto-generated MCP server that self-updates as the host app changes.<p>The result is a skilled AI assistant that actually integrates deeply with any product (not just chat and RAG) with minimal effort.<p>Check out these short demos below that show the agent in software you're probably familiar with:<p>- Jira: <a href="https://demo.frigade.com/hn?skill=jira">https://demo.frigade.com/hn?skill=jira</a><p>- Spotify: <a href="https://demo.frigade.com/hn?skill=spotify">https://demo.frigade.com/hn?skill=spotify</a><p>- Hacker News (lol): <a href="https://demo.frigade.com/hn?skill=hackernews">https://demo.frigade.com/hn?skill=hackernews</a><p>- Full Demo: <a href="https://demo.frigade.com/hn?skill=full-demo">https://demo.frigade.com/hn?skill=full-demo</a><p>As you can see in the examples, you can do way more (and faster) than what you normally would be able to via point and click. And we never even touched the source code of these products!<p>Why do this?<p>In an ideal world, every application has an MCP server or an easily-digestible API available for AI agents to feed from. In practice, we found that even very modern software tends to have a spider web of confusing APIs and services that AI agents simply cannot use out of the box. Security also becomes a huge issue as applications have different (often homebrewed) standards for how endpoints are secured (JWTs/cookies/mix of both). Finally, having an actual browser agent go in and use the application on behalf of the user (i.e. computer-use), is simply too brittle, slow, and burns a lot of tokens.<p>We took our existing browser agent that’s already trained to use and learn authenticated applications, and added an extra step that automatically turns the app’s authenticated APIs into "recipes". A recipe is a mix of the following:<p>- API endpoint + method<p>- Authentication method (and how to retrieve refresh auth tokens/cookies)<p>- Response schema<p>- Input schema (for POST/PUT)<p>- Human readable description of what the tool does<p>Putting it all together, these become reusable tools for LLMs, all without writing or maintaining any code. Even if the APIs change our agent figures this out and replaces the recipe for the tool with the updated version.<p>Adding tools to an AI agent becomes super simple this way:<p>- Our agent trains on the app and builds the recipes<p>- The app owner enables discovered tools from our dashboard<p>- The agent can now take actions on the user’s behalf directly inside the application. For instance, saying something like "invite my teammate to my workspace" would securely call the existing API endpoint for inviting users without proxying or relaying through a third party.<p>Of course, there's a ton of edge cases you run into when you try to do this - every application is intrinsically different despite how many "standards" exist. Fun fact: graphql was by far the worst API to work with in standardizing the recipes.<p>Looking forward to your feedback/comments!