-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Standalone Approval API for Plugins (api.approval.request()) #97043
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
Add a standalone api.approval.request() method to the Plugin SDK that allows plugins to request user approval at any point in agent
execution, not just before tool calls.
Problem to solve
Currently, OpenClaw’s approval infrastructure (plugin.approval.* flow) is only accessible through the before_tool_call hook’s requireApproval result. This means:
Real-World Use Cases Blocked
Proposed solution
Add a new API method to OpenClawPluginApi:
interface ApprovalRequestOptions {
title: string;
description: string;
severity?: "info" | "warning" | "critical";
timeoutMs?: number; // default: 30000 (30 seconds)
timeoutBehavior?: "allow" | "deny"; // default: "deny"
allowedDecisions?: Array<"allow-once" | "allow-always" | "deny">;
}
interface ApprovalResult {
decision: "allow-once" | "allow-always" | "deny" | "timeout" | "cancelled";
}
// New API method
api.approval.request(options: ApprovalRequestOptions): Promise;
Alternatives considered
Impact
Affected users: Plugin authors who need to implement workflow checkpoints or human-in-the-loop decisions
Severity: Medium — blocks common agent patterns (plan review, multi-step workflows)
Frequency: Always — anyone building non-trivial plugins would benefit
Consequence: - Workarounds exist but are clunky (synthetic tools, complex hooks) - No way to enforce the “pre-action protocol” pattern cleanly -
Plugin approval infrastructure exists but is underutilized
Evidence/examples
Current approval flow: Gateway’s plugin.approval.* flow
Hook-based approval: before_tool_call.requireApproval in plugin hooks
Use case: Pre-Action Protocol — enforcing Ground Truth hierarchy with approval-based waits
Additional information
Migration path: This is additive — doesn’t break existing functionality
Dependencies: Reuses existing approval infrastructure (Gateway plugin.approval.* flow)
Implementation scope: