pg_agent_gate:在 PostgreSQL 内部为 AI Agent 的 SQL 操作加装提案与校验闸门
Manuelreyesbravo/pg_agent_gate · Agents propose, PostgreSQL decides: a native gate between AI agents and the database
pg_agent_gate 是一个 PostgreSQL 扩展,让数据库能区分 AI Agent 会话与普通应用会话。在 Agent 会话中 SQL 不会直接执行,Agent 只能通过七个动词(discover、propose、dry_run、commit、propose_and_commit、acts、whoami)提案一条语句,由 PostgreSQL 自身基于解析、单语句、类型许可、禁止写 CTE、上下文保持、禁止放大与不透明函数等检查逐项验证,并展示精确影响后再决定是否保留,从而防止模型幻觉产生无 WHERE 的 DELETE、DROP TABLE 或越权读取。
评论 · 分享第一个看法