PageSourceSearch

https://www.puppyone.ai/_next/static/chunks/2941.6c39c77e00be7aaf.js

js puppyone.ai collected 2026-10-05 12:32:18 UTC 7,437 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2941],{10798:function(n,e,s){s.d(e,{a:function(){return r}});function r(n){return n}},13345:function(n,e,s){s.d(e,{Z:function(){return l},o:function(){return i}});var r=s(57437);s(2265);var c=s(59714),t=s.n(c);function i(n){let{children:e}=n;return(0,r.jsx)("div",{className:t().docCards,children:e})}function l(n){let{title:e,href:s,children:c}=n;return(0,r.jsxs)("a",{className:t().docCard,href:s,children:[(0,r.jsx)("span",{className:t().docCardTitle,children:e}),c&&(0,r.jsx)("span",{className:t().docCardBody,children:c})]})}},52941:function(n,e,s){s.r(e),s.d(e,{default:function(){return l}});var r=s(57437),c=s(10798),t=s(13345);function i(n){let e={code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.a)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.h1,{children:"Auth for Agents"}),"\n",(0,r.jsx)(e.p,{children:"控制谁能访问你的 Context File System,以及能做什么。"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.h2,{children:"两种身份验证模型"}),"\n",(0,r.jsxs)(e.p,{children:["puppyone 区分",(0,r.jsx)(e.strong,{children:"人类用户"}),"和",(0,r.jsx)(e.strong,{children:"机器/Agent"})," 的身份验证方式:"]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{children:"┌────────────────────────────────────────────────────┐\n│              人类用户 (JWT)                          │\n│                                                     │\n│  邮箱密码 / OAuth 登录 → Supabase Auth → JWT Token  │\n│  适用于:Dashboard、CLI 交互操作                     │\n└────────────────────────────────────────────────────┘\n\n┌────────────────────────────────────────────────────┐\n│              机器 / Agent (Access Key)               │\n│                                                     │\n│  每个 Connection 分配独立的 Access Key               │\n│  适用于:MCP 端点、Sandbox、文件系统同步、Agent      │\n└────────────────────────────────────────────────────┘\n"})}),"\n",(0,r.jsx)(e.h3,{children:"JWT(人类用户)"}),"\n",(0,r.jsx)(e.p,{children:"你通过邮箱密码或第三方 OAuth(Google、GitHub 等)登录 puppyone 后,系统签发一个 JWT Token。这个 Token 代表你本人的身份,拥有你作为项目成员的全部权限。"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-bash",children:"# CLI 登录\npuppyone auth login\n\n# 验证当前身份\npuppyone auth whoami\n"})}),"\n",(0,r.jsx)(e.h3,{children:"Access Key(机器 / Agent)"}),"\n",(0,r.jsx)(e.p,{children:"Agent 不会像人类一样登录。每个 Connection(Agent、MCP 端点、Sandbox、文件系统同步)å
1œ¨åˆ›å»ºæ—¶è‡ªåŠ¨èŽ·å¾—ä¸€ä¸ª Access Key。Agent 通过这个 Key 访问 API,系统根据 Key 关联的权限规则决定它能做什么。"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-bash",children:"# 查看某个 Connection 的 Access Key\npuppyone access key <connection-id>\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.h2,{children:"为什么 Agent 认证不同于人类"}),"\n",(0,r.jsx)(e.p,{children:"人类用户是项目成员,通常需要广泛的访问权限来管理项目。但 Agent 不同:"}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.strong,{children:"Agent 只需要完成特定任务"}),"——客服 Agent 不需要看到研发文档"]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.strong,{children:"Agent 是自动化运行的"}),"——没有人在旁边判断它是否越界"]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.strong,{children:"Agent 可能有多个"}),"——每个 Agent 的职责和权限应该隔离"]}),"\n"]}),"\n",(0,r.jsxs)(e.p,{children:["因此,puppyone 为每个 Agent 单独分配凭证,并通过 ",(0,r.jsx)(e.strong,{children:"File Level Security (FLS)"})," 精确控制它的能力边界。"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.h2,{children:"两层权限模型"}),"\n",(0,r.jsx)(e.p,{children:"每个 Access Key 关联一组权限规则,分为两层:"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{children:"请求进入\n   │\n   ▼\n┌──────────────────────────────────┐\n│  第一层:Tool 权限                │\n│  这个 Agent 能调用哪些操作?      │\n│                                   │\n│  query_data ✅  create ✅         │\n│  update ✅      delete ❌         │\n└──────────────┬───────────────────┘\n               │ 通过\n               ▼\n┌──────────────────────────────────┐\n│  第二层:路径权限                 │\n│  这个操作能访问哪些 Content Node?│\n│                                   │\n│  /products ✅  /faq ✅            │\n│  /internal ❌                     │\n└──────────────┬───────────────────┘\n               │ 通过\n               ▼\n            执行操作\n"})}),"\n",(0,r.jsxs)(e.ol,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.strong,{children:"Tool 权限"}),":决定 Agent 能执行哪些操作(读取、创建、修改、删除)"]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.strong,{children:"路径权限"}),":决定每个操作能访问哪些 Content Node 路径"]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:"两层都通过,请求才会被执行。"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.h2,{children:'"不存在"原则'}),"\n",(0,r.jsxs)(e.p,{children:["FLS 不只是拒绝访问——Agent 没有权限的路径,",(0,r.jsx)(e.strong,{children:"在它的视野中物理上不存在"}),"。"]}),"\n",(0,r.jsxs)(e.p,{children:["如果一个 Agent 只被授权访问 ",(0,r.jsx)(e.code,{children:"/products"})," 和 ",(0,r.jsx)(e.code,{children:"/faq"}),",那么当它列出文件系统时,看到的就只有这两个路径。",(0,r.jsx)(e.code,{children:"/internal"}),"、",(0,r.jsx)(e.code,{children:"/users"})," 等其他内容完全不可见,Agent 甚至不知道它们的存在。"]}),"\n",(0,r.jsx)(e.p,{children:'这和传统的"403 Forbidden"不同——Agent 不会看到一个它无法访问的路径然后被拒绝,而是从一开始就只看到它被允许看到的世界。'}),"\n",(0,r.jsx)(e.hr,{}),"\n","\n",(0,r.jsxs)(t.o,{children:[(0,r.jsx)(t.Z,{title:"FLS 权限控制",href:"/zh/docs/auth-for-agents/permissions"}),(0,r.jsx)(t.Z,{title:"凭证管理",href:"/zh/docs/auth-for-agents/api-keys"})]})]})}function l(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}={...(0,c.a)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(i,{...n})}):i(n)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.