返回首页

对比阅读

对比阅读:Before Agents Connect to Tools, Control Permissions—or the Model Gets a Master Key 与 Agent 接入工具前必须先管权限,否则模型就拿到万能钥匙

AEN
AgentHITLleast privilege·

Before Agents Connect to Tools, Control Permissions—or the Model Gets a Master Key

As Agents move from merely “answering questions” to “modifying data, sending emails, and spending money,” what enterprises often lack is not a more capable model, but a gate that limits what the Agent can do. This article presents an executable approach: before a tool is connected, define least-privilege permissions, require human confirmation for sensitive actions, and preserve audit trails. The accompanying demo passes seven unit tests, but its execution layer currently uses log placeholders and has not yet been connected to real tools.

What this is

This is an engineering practice article aimed at productionizing AI applications. Once an Agent—an AI system that can independently plan tasks and invoke tools—connects to a knowledge base, database, or email system, permission risks rise sharply. Writing “Do not exceed your permissions” in the prompt is not a reliable constraint because a model’s tool selection is inherently probabilistic.

The approach embeds permissions in tool definitions: ordinary users may invoke read-only queries, writes require a higher role, and deletions require an administrator. Writes, deletions, outbound messages, and payments are flagged as sensitive operations. HITL—human in the loop, where sensitive actions proceed only after human confirmation—operates through a pending-confirmation queue, with every approval, rejection, and timeout recorded. The permission framework determines whether a tool “can be called,” while the sandbox—isolating the tool’s execution environment and restricting its resources and network access—determines “where it runs.” The two cannot replace each other.

Industry view

This approach is worth attention because it reframes Agent governance as a system-design problem rather than a model-capability problem. Enterprise risks usually originate in unclear permission boundaries, poorly handled exception flows, and inadequate operational records—not in a model failing to say one fewer word. A unified entry point can also prevent some tools from bypassing checks, deny unknown tools by default, and provide a foundation for future alerts and accountability.

The article’s level of completion, however, warrants caution. The accompanying project does not request real credentials, and the execution layer remains a log placeholder. Human confirmation can also become a mechanical click. If roles are too broadly defined, approvers lack the information needed to make a judgment, or requests remain pending indefinitely, least privilege and human-in-the-loop governance will still fail. More importantly, permission checks can restrict declared operations but cannot determine whether the data returned by a tool itself is trustworthy. The article therefore demonstrates that the governance framework is feasible; it does not show that Agents can already safely take over enterprise systems.

Impact on regular people

For enterprise IT: Permissions, approvals, and auditing should be completed before the first real tool is connected, rather than added after an incident occurs. For organizations with a limited tool inventory, this is also a more practical investment than expanding model capabilities.

For individual professionals: As AI assistants handle documents, spreadsheets, and email, the key change will be “who approves its actions,” not whether it answers as fluently as a human.

For the consumer market: Services that automatically book tickets, place orders, or modify accounts will increasingly depend on tiered permissions and confirmation mechanisms. Consumers should also pay attention to authorization scopes, revocation options, and activity logs.

来源: juejin.cn
BZH
AgentHITL最小权限·

Agent 接入工具前必须先管权限,否则模型就拿到万能钥匙

如果 Agent 从“会回答”走向“会改数据、发邮件、花钱”,企业真正缺少的往往不是更强的模型,而是限制它能做什么的闸门。文章给出了一套可运行方案:工具接入口径前,先定义最小权限、敏感操作人工确认与审计留痕;其配套演示通过 7 项单元测试,但执行端目前仍以日志占位,尚未接入真实工具。

这是什么

这是一篇面向 AI 应用生产化的工程实践文章。Agent(能自主规划并调用工具执行任务的 AI 系统)接入知识库、数据库或邮件系统后,权限风险会明显上升:提示词里写“请不要越权”无法构成可靠约束,因为模型选择工具具有概率性。

方案把权限写进工具定义:只读查询允许普通用户调用,写入要求更高角色,删除则要求管理员;写入、删除、对外发送和付费被标记为敏感操作。HITL(人在环,敏感动作由人确认后才执行)通过待确认队列处理,每次批准、拒绝和超时都保留记录。权限框架决定“能不能调用”,沙箱(隔离工具运行环境并限制资源和网络)决定“在哪里运行”,两者不能互相替代。

行业怎么看

这套思路值得关注,因为它把 Agent 治理从模型能力问题转成系统设计问题。企业的风险通常来自权限边界、异常流程和操作记录不清,而不是模型少说一句话。统一入口还能避免某些工具绕过检查,未知工具默认拒绝,也为后续告警和追责留下基础。

但需要克制看待文章的完成度:配套项目没有申请真实密钥,执行环节还是日志占位。人工确认也可能变成机械点击;若角色划分过粗、确认人没有判断信息、请求长期挂起,最小权限与人在环仍会失效。更关键的是,权限检查只能限制已声明的操作,无法判断工具本身返回的数据是否可信。因此,文章证明的是治理框架可行,而不是 Agent 已经可以安全接管企业系统。

对普通人的影响

对企业 IT:权限、审批和审计应在接入第一个真实工具前完成,而不是等事故出现再补。对工具数量有限的企业,这也是比扩大模型能力更实际的一笔投入。

对个人职场:未来 AI 助手处理文档、表格和邮件时,关键变化会是“谁批准它动手”,而不是它是否像人一样回答得流畅。

对消费市场:能自动订票、下单或修改账户的服务会更依赖分级权限与确认机制,消费者也应留意授权范围、撤销入口和操作记录。

来源: juejin.cn