-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Add optional capability descriptors to tool definitions #48510
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.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.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.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.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Problem
Plugins that need to make policy decisions about tool calls currently rely on tool name matching. This is brittle: tool names change, custom tools have unpredictable names, and the same policy logic ("block tools that send data externally") has to maintain a hardcoded list of tool names.
Proposal
Add an optional capabilities field to tool definitions that lets each tool self-declare what it does:
Built-in tools self-declare. Plugin-registered tools can optionally declare. Undeclared capabilities default to undefined (unknown), not false (safe).
Use cases
What exists today
Tools have name, description, and parameters. There is no structured metadata about what a tool does beyond its description string. before_tool_call hooks receive toolName and params but no capability metadata. A policy plugin that wants to block "tools that send data externally" has to maintain a hardcoded list of tool names. Every new tool or plugin breaks that list.
Trust model and undeclared capabilities
Three categories of tools exist in OpenClaw:
Connection to before_tool_call (#48503)
Capability descriptors become actionable when surfaced through the enriched before_tool_call event proposed in #48503. A policy plugin receives the tool call with both the declared capabilities and the input provenance, enabling rules like: "if capabilities.sendsExternally and provenance is inter_session, then block or request approval." Without capability descriptors, the same policy requires brittle tool name matching. Without the enriched hook, the descriptors have no enforcement surface.
Backward compatibility
All fields optional. Zero behavior change for existing tools. Plugin-registered tools that do not declare capabilities continue to work exactly as they do today. Policies that check capabilities on undeclared tools see undefined and can apply their own default (block, allow, or prompt).
Context: See Building a CaMeL Prototype for OpenClaw for full motivation and architectural analysis.