跳到正文
DEV Community· AXEC·· 25 分鐘前AI 評分55

AI 智能體的權限應隨任務結束而失效

An AI Agent’s Permission Should Die With Its Task

AI 導讀

文章主張,AI 智能體的授權應限定於特定任務,並在任務結束時撤銷,避免臨時決定變成持續有效的權限。授權應按任務狀態而非只按固定時限到期,取消、拒絕批准、工作階段終止或政策變更時亦應提早撤銷,系統並須在每次執行動作時核查權限。平台團隊可測試任務完成後的工具呼叫,以及延遲佇列訊息、重試和轉交另一智能體等情況,確認舊授權遭拒並留下原因紀錄。

正文

The most dangerous permission an AI agent has may be the one nobody remembers to revoke.

Consider a hypothetical invoice-processing agent. It receives a task, gets permission to read invoices and update a finance system, then completes the work successfully.

If that permission remains valid after completion, the system has created a standing capability from a temporary decision.

That changes the risk. A later prompt, queued retry, compromised context, or mistaken workflow can reuse the same authority for an action the original user never approved.

The failure isn’t necessarily a bad policy. The policy may have been correct when the task started.

The problem is that the permission outlives the reason it was granted.

The control: task-scoped authority

An agent should receive authority with a clear scope and lifetime:

  • Which task is this for?
  • Which tools and records can it access?
  • Which actions are allowed?
  • When does the permission expire?
  • What event revokes it early?

The expiry should be tied to the task state, not only to a fixed time window.

When the task reaches a terminal state, its delegated authority should be revoked. A cancellation, approval rejection, session termination, or policy change should revoke it sooner.

This also means the runtime must check authority at action time. Checking permissions only when the agent starts is insufficient. The agent may be allowed to read an invoice at 10:02, but not to submit a payment at 10:17 after the task has been cancelled.

A buyer test for agent security

Ask your platform team to demonstrate three things:

  1. An agent completes a task.
  2. The same agent attempts a tool call afterward.
  3. The system denies the call and records why.

Then repeat the test with a delayed queue message, a retry, and a handoff to another agent.

If any of those paths can use the original permission without a fresh authorization decision, the control is weaker than it appears.

The audit record should show more than “access granted.” It should connect the action to the task, the authority issued, the policy decision, and the reason access ended.

That is the difference between monitoring activity and proving accountability.

Agent permissions should be temporary by design. A task ending is a security event, not just a workflow update.

Learn more about AXEC and schedule a meeting

來源:DEV Community · dev.to