Summary
Document and, if needed, lightly extend the trusted policy/plugin approval surfaces so an installed plugin can act as an external policy decision provider before tools execute.
Problem to solve
OpenClaw already has useful local primitives for tool policy, sandboxing, exec approvals, plugin approvals, and trusted pre-tool policies. Those cover many cases well.
Some users and organizations also need a stateful or externally managed authorization provider before tools execute. Common examples include:
- budget and loop controls across a run
- data-flow and PII egress rules
- idempotency checks for side effects
- policy decisions managed outside the agent workspace
- audit receipts that correlate proposed, approved, executed, and denied actions
- provider- or gateway-side authorization contracts
Today this appears possible through api.registerTrustedToolPolicy(...) and plugin approvals, but the external-provider pattern is not yet a first-class documented path. That makes it harder to build portable integrations without reverse-engineering the intended event shape, approval behavior, and audit boundaries.
Proposed solution
Document and, if needed, lightly extend the trusted policy/plugin approval surface so a plugin can safely act as an external tool authorization provider.
A useful first pass could include:
- A docs page or example plugin for an external tool authorization provider.
- A recommended event-to-policy payload shape.
- Clarification on same-chat plugin approval routing.
- Guidance for mapping provider decisions into existing OpenClaw outcomes:
- allow: return undefined/no-op
- deny: return
{ block: true, blockReason }
- challenge: return
{ requireApproval: ... }
- Additional context fields if they are missing from trusted policy events:
- source channel
- account id
- peer/conversation id
- thread id
- authenticated sender/user id when available
- An audit/export hook or recommended after-tool-call pattern for execution receipts.
- A pre-model context contribution hook, if needed, for heartbeat/context budget enforcement before recurring context is added to the model prompt.
The goal is not to add a specific vendor or product to OpenClaw. The goal is to make this generic pattern clearer:
tool call proposed
-> trusted policy provider evaluates action/context
-> allow / deny / require approval
-> approval uses OpenClaw's existing approval routes
-> tool executes only after the decision
Alternatives considered
- Rely only on local allow/deny policy. This is good for static policy, but weaker for stateful budgets, idempotency, cross-run risk, and externally managed policy.
- Send users to an external approval dashboard. This adds friction and duplicates OpenClaw's existing channel/approval experience.
- Add a vendor-specific integration. A generic trusted-policy provider pattern keeps OpenClaw extensible without coupling core behavior to one authorization system.
- Fork or distribute a modified OpenClaw. That is heavier than documenting and hardening the existing plugin/policy surfaces.
Impact
Affected: users running OpenClaw with high-risk tools, external systems, browser actions, message sends, code execution, or MCP/provider tools.
Severity: Medium to high for teams that need policy enforcement before side effects, not just after-the-fact audit.
Frequency: Frequent in agent workflows that read sensitive context, send messages, edit files, execute commands, publish PR reviews, or call changing MCP/provider tools.
Consequence: Without a clear external authorization provider path, integrations either duplicate OpenClaw approval UX, implement brittle plugin-specific mappings, or avoid OpenClaw for regulated/high-risk tool execution.
Evidence/examples
I have been prototyping this pattern externally against OpenClaw-style trusted policy events. The useful test cases so far are:
- secrets exfiltration: allow local analysis, block secret movement into browser forms
- outbound message guard: map message-style tools to a send action and block customer data to external channels
- MCP drift: detect new or changed MCP tools before exposing the tool surface
- loop/context budget: challenge repeated tool calls and deny oversized heartbeat-like payloads at hard token caps
Reference implementation and runnable examples are here:
The most useful upstream gaps to validate are context-field completeness, audit/export guidance, and whether heartbeat/context-budget enforcement needs a pre-model context contribution hook.
Additional information
This is not intended as a security vulnerability report and is not asking OpenClaw to adopt AgentPass specifically. I am looking for maintainer feedback on the generic extension/documentation shape first.
If this direction fits the project, I can try a small docs/example PR showing a trusted policy plugin that calls an HTTP/local policy provider and maps allow/deny/approval-required decisions into existing OpenClaw behavior.
Summary
Document and, if needed, lightly extend the trusted policy/plugin approval surfaces so an installed plugin can act as an external policy decision provider before tools execute.
Problem to solve
OpenClaw already has useful local primitives for tool policy, sandboxing, exec approvals, plugin approvals, and trusted pre-tool policies. Those cover many cases well.
Some users and organizations also need a stateful or externally managed authorization provider before tools execute. Common examples include:
Today this appears possible through
api.registerTrustedToolPolicy(...)and plugin approvals, but the external-provider pattern is not yet a first-class documented path. That makes it harder to build portable integrations without reverse-engineering the intended event shape, approval behavior, and audit boundaries.Proposed solution
Document and, if needed, lightly extend the trusted policy/plugin approval surface so a plugin can safely act as an external tool authorization provider.
A useful first pass could include:
{ block: true, blockReason }{ requireApproval: ... }The goal is not to add a specific vendor or product to OpenClaw. The goal is to make this generic pattern clearer:
Alternatives considered
Impact
Affected: users running OpenClaw with high-risk tools, external systems, browser actions, message sends, code execution, or MCP/provider tools.
Severity: Medium to high for teams that need policy enforcement before side effects, not just after-the-fact audit.
Frequency: Frequent in agent workflows that read sensitive context, send messages, edit files, execute commands, publish PR reviews, or call changing MCP/provider tools.
Consequence: Without a clear external authorization provider path, integrations either duplicate OpenClaw approval UX, implement brittle plugin-specific mappings, or avoid OpenClaw for regulated/high-risk tool execution.
Evidence/examples
I have been prototyping this pattern externally against OpenClaw-style trusted policy events. The useful test cases so far are:
Reference implementation and runnable examples are here:
The most useful upstream gaps to validate are context-field completeness, audit/export guidance, and whether heartbeat/context-budget enforcement needs a pre-model context contribution hook.
Additional information
This is not intended as a security vulnerability report and is not asking OpenClaw to adopt AgentPass specifically. I am looking for maintainer feedback on the generic extension/documentation shape first.
If this direction fits the project, I can try a small docs/example PR showing a trusted policy plugin that calls an HTTP/local policy provider and maps allow/deny/approval-required decisions into existing OpenClaw behavior.