Approval gates let an agent prepare work, pause before finalizing it, and continue only after a reviewer approves, rejects, or comments. The main approval surface isDocumentation Index
Fetch the complete documentation index at: https://docs.agentuse.io/llms.txt
Use this file to discover all available pages before exploring further.
agentuse serve at /approvals. Slack is optional: it can notify reviewers and link them into the approval page, but Slack is not where approval state lives.
How It Works
- Add
approval: trueto the agent frontmatter. - Run
agentuse serve. - The agent works normally until it reaches the approval point.
- AgentUse creates a pending approval request.
- Reviewers open
/approvalsor a tokenized approval link. - A reviewer approves, rejects, or comments.
- AgentUse resumes the suspended session with the reviewer result.
- After the session finishes, reviewers can send follow-up instructions from the same approval page to continue the session with its existing context.
Create an Agent with Approval
Use the smallest possible config:Define the Approval Boundary
Approval gates are agent-driven: the agent calls the internalawait_human tool when it reaches the point where review is needed. AgentUse injects the approval mechanism, but your agent instructions can still define the policy boundary for your workflow.
Write the boundary in business terms. Describe what the agent may prepare without approval, and what it must not finalize until approval is granted.
For a social publishing agent:
- Usually safe before approval: local temp files, drafts, previews, dry runs, summaries, draft PRs
- Usually approval-required: publishing, sending email, scheduling posts, deploying, merging, deleting, charging, or changing production/external state
- If unsure, ask for approval before the action
Start the Server
Start the AgentUse daemon:serve with a reachable public URL:
--public-url when reviewers need a URL other than the local server address.
Optional Slack Channel
Slack can alert reviewers when an approval is waiting. Approval state still lives in the AgentUse approval page. The Slack channel message stays concise, and supporting approval details are posted in the message thread when the agent provides them. Those thread details can include summary, draft, artifact, context, and risk.Reviewer Flow
The approval page shows the best available review details from the agent:prompt: the reviewer-facing decision promptsummary: what changed and what is being approveddraft: inline draft contentdraft_url: URL to a draft artifactartifact_url: URL to the primary review artifact, such as a PR, preview, document, or generated artifactcontext: relevant background, constraints, or work completed so farrisk: known risks, unresolved questions, or reviewer attention areas- Session logs before and after the decision
Approve: resumes the agent withstatus: "approve"Reject: resumes the agent withstatus: "reject"Comment: resumes the agent withstatus: "comment"and the reviewer comment
Review approval button to decide in /approvals.
When the agent receives a comment, it decides whether to revise, ask for approval again, or stop with a clear explanation.
After the run completes, the same approval page becomes a lightweight continuation surface. Add a follow-up instruction in the Continue session box to resume the completed or errored session with its existing context. This matches Slack thread replies, but keeps the web approval page as the source of truth for details and logs.
Configuration Fields
Approval config is intentionally small:approval:trueor an object to enable the approval gateapproval.timeout: optional suspension timeout, such as30m,24h, or7d
channels: optional external collaboration channels, such aschannels: [slack]channels.slack.events: events for Slack. Approval gates useapproval; terminal run events are documented in Channels.channels.slack.channel_id: Slack channel id. If omitted, AgentUse usesSLACK_APPROVAL_CHANNEL.channels.slack.enabled: optional switch for temporarily disabling Slack
Experimental Approval API
The Approval API is experimental and mirrors the web approval page contract. Use it to build custom approval UIs or integrations. List approvals as JSON:Accept: application/json.
Check one approval:
/approvals follows the agentuse serve auth setting. Tokenized approval detail, status, decision, and continuation URLs validate the approval token so reviewers can open Slack links without a separate API-key login.
Local Testing
For development or manual testing, you can resume a suspended session from the CLI:/approvals UI for normal review, Slack for reviewer alerts, the Approval API for custom review surfaces, and agentuse sessions resume for local testing.