Skip to main content
Agent

Permissions

Approve or deny agent tool use with human-in-the-loop or auto-approve patterns.

  • Human-in-the-loop approval for agent tool use (file writes, command execution, etc.)
  • Auto-approve patterns for trusted workloads
  • Server-side hooks for programmatic permission decisions
  • Client-side subscriptions for building approval UIs

Permission request flow

When an agent wants to use a tool (e.g. write a file, run a command), it emits a permissionRequest event. Your code responds with respondPermission to approve or deny.

Permission reply options

ReplyBehavior
"once"Approve this single request
"always"Approve this and all future requests of the same type
"reject"Deny the request

Server-side auto-approve

Use the onPermissionRequest hook in the actor config to approve permissions server-side without client involvement. This is useful for fully automated pipelines.

Selective approval

Inspect the permission request to make approval decisions based on the tool or path.

Recommendations

  • Use "always" sparingly. It approves all future requests of that type for the session lifetime.
  • For automated CI/CD pipelines, use the server-side onPermissionRequest hook to auto-approve without client round-trips.
  • For interactive applications, subscribe to permissionRequest on the client and build an approval UI.
  • If neither the server hook nor the client responds, the agent blocks until a response is given or the action times out.