Skip to main content

Keeping Agent Writes Under Control: Tiered Permissions, Approval, and Full-Chain Audit

· 5 min read
Jack Ning
Maintainer of Bytedesk

"Why did the 500-yuan compensation the AI filed for me go to someone else's account?" Reviewing this complaint, the support team found the agent had indeed "followed the rules": the user verbally said they wanted compensation, the model judged the amount within the payout standard, and it autonomously submitted the claim—with the payout account taken from an old card number in a historical ticket. No malice, no hacker—what was missing was one hard constraint: before any write operation, who authorized it, who approves it, and who answers for it afterward. Writing "do not exceed authority" a hundred times in the prompt is far less reliable than permission tiers plus an approval flow—the security boundary must live in the system, not in the model's conscience.

This post is part of the "AI Customer Service Product and Engineering Practices" experience-sharing series, drawn from a practice review of an AI customer service product at a leading logistics company. In this post I want to share how to design tiered permissions, risk validation, human approval, and operation audit mechanisms that keep execution under control when an AI Agent can autonomously modify orders, adjust delivery plans, and handle compensation claims. This is the risk-control gate before an agent earns its "write permissions".

Classify the operation → Check rules and access → Confirm or approve → Audit and contain

Five Key Design Points in Permissions and Approval​

  • Permission design: operation tiering, least privilege, and quota control must form a system.
  • Risk validation: how a rule engine and model confidence work together to flag high-risk operations.
  • Approval flow design: tiered approval, evidence preparation, timeout escalation.
  • Audit and compliance: full-chain records, replayability, privacy protection.
  • Containment capability: circuit breaking, automatic degradation, rollback plans.

The Overall Design​

In this effort, I would not start from "how to stop the model" but from "who authorizes this operation and who is accountable"—once the authorization chain is straight, the control points surface naturally. The overall approach in one sentence: operations in four tiers, permissions tightened by role and quota, risk checks deciding upgrades, approvals with evidence packs, auditable and replayable records, and circuit breaking to stop the bleeding.

Step 1: Four operation tiers, graded by actual impact​

  • L0 queries: tracking, policy lookups—pass through directly, but even read-only queries must verify identity and visibility scope.
  • L1 low-risk writes: such as expediting delivery—execute automatically.
  • L2 medium-risk operations: such as address or delivery-time changes—execute only after user confirmation.
  • L3 high-risk operations: such as above-authority claims and liability disputes—require human approval.

Tiering is not a one-time labeling exercise—it should be configured by actual impact: changing an address before dispatch and changing it mid-transit carry completely different risks.

Step 2: Tighten the permission model by role plus quota​

The agent gets only the minimum permissions needed for the current task; roles (user / agent / support / supervisor) plus scenario jointly determine which business objects it can touch; quotas are doubly controlled by amount and frequency, preventing one misoperation from causing a large loss. Tool services read identity from trusted context and never accept the model declaring itself an "administrator" to widen data scope.

Step 3: Risk checks with a rule engine plus model confidence​

The rule engine examines amount, order status, identity, timeliness, frequency, and anomaly features—hitting a high-risk feature triggers an immediate tier upgrade; low model confidence also auto-upgrades one tier for human confirmation. Be clear-eyed: the model's self-reported confidence is not a calibrated risk probability—it can only trigger escalation, never serve as grounds for relaxing rules.

Step 4: Approval must be efficient, timeouts escalate automatically​

Route approval by quota through tiered flows, attaching an evidence pack: order facts, tracking trail, policy basis, user request, and the AI's recommendation—so an approver can decide within three minutes. On approval expiry, parameter changes, or business state changes, re-validate; timeouts escalate automatically to a senior queue—never silently approved, never left hanging forever.

Step 5: Full-chain records, circuit breaking and containment​

Record every operation: who initiated it, when, under which rule version, which interfaces were called, what the result was, whether the user confirmed—replayable and traceable, which is the compliance baseline. Finally, circuit breaking: when error or complaint rates exceed thresholds, degrade automatically, suspend high-risk operations, switch to read-only or human service with alerts, and roll back when necessary. Better to do less than to do wrong.

Practice in Bytedesk​

In the open-source Bytedesk customer service system (GitHub, website https://www.weiyuai.cn ), tool management can limit the invocation scope when configuring external capabilities for robots and agents, and invocation logs and approval logs provide entry points for auditing tool execution; the ticket module's owners, escalation, and state transitions carry tasks requiring human handling, and transfers to humans carry full conversation context. Operation tiering, quota ceilings, confirmation records bound to parameter versions, approval evidence packs, and circuit-breaker conditions must be configured and enforced in business services per this post—the existence of approval logs does not mean every logistics risk rule has been implemented automatically.

Key Takeaways​

  • Four operation tiers: L0 queries pass, L1 auto-executes, L2 requires user confirmation, L3 requires human approval; tiers follow actual impact—an address change before dispatch and mid-transit are not the same tier.
  • Permissions tighten by role plus scenario; the agent gets minimum privileges; quotas are doubly controlled by amount and frequency.
  • Risk checks combine a rule engine with model confidence—low confidence auto-upgrades the tier; it can only tighten, never relax rules.
  • Approvals come with evidence packs (order facts, tracking, policy basis, request, recommendation); timeouts escalate automatically, never silently approved.
  • Full-chain records are replayable; error or complaint rates beyond thresholds trigger circuit breaking and degradation, suspending high-risk operations—better to do less than to do wrong.