智能体
x.com ·
@rauchg
Vercel CEO 发布 gdp-ts:为 TypeScript 引入编译期授权证明
Guillermo Rauch 推出 gdp-ts,一个面向更安全 API 设计的库、linter 与 AI skill。该方案要求敏感函数携带调用方已执行授权检查的 proof,并由类型检查器在编译期验证,从而阻止团队与 agent 引入严重安全缺陷。作者称此类模式在 Haskell 等生态早已存在,但人工评审与认知/语法成本使其小众;如今 agent 写码量超过人工评审能力,硬约束反而更适配。README 以 Vercel API 产品中修改 Project 密码需特定角色与权益 proof 为例。
AI推荐理由 Vercel CEO 发布 gdp-ts,将 Haskell 的 Ghosts of Departed Proofs 模式引入 TypeScript,通过编译期 proof 约束敏感函数必须完成授权检查,并配套 linter 与 AI skill。其新意在于把类型级安全约束与 agent 写码场景结合,README 以 Vercel API 改密码需角色与权益 proof 为例。局限是仍处发布介绍阶段,无独立验证或采用数据,实际效果待观察。
78
浏览 29,321
点赞 599
评论 57
转发 29
正文
Introducing gdp-ts: Ghosts of Departed Proofs for TypeScript.
gdp-ts is a library, linter and AI skill for safer API design. Under this contract, sensitive functions require 'proofs' that the caller performed an authorization check.
The typechecker verifies these proofs at compile time, preventing your team and agents from shipping catastrophic security (and other kinds of) bugs.
While these patterns have existed for quite some time, especially in ecosystems like Haskell, ① human code review and ② cognitive and syntactic overhead made these solutions niche.
The situation is now inverted. Agents are writing more code than we can review, and they \*thrive\* in tight loops with hard constraints that would frustrate us. We see this with the rise of Rust, borrow checker, code aesthetics debate and all.
The README and examples model a real-world Vercel API product constraint: changing the password on a Project requires a proof of a certain role + a certain entitlement. Thanks to Matt Noonan and Ollie Charles for their research in this space.
[github.com/rauchg/gdp-ts](https://github.com/rauchg/gdp-ts)
[Your browser does not support the video tag.](https://video.twimg.com/amplify_video/2107106516126044160/vid/avc1/1200x630/wIADZR1_fLQBV4TQ.mp4?tag=29)
[🔗 View on Twitter](https://x.com/rauchg/status/2107119811444748555/video/1)