Background
The current plugin API only provides tool.execute.after. This allows post-execution detection but not pre-execution blocking. As demonstrated by AgentSpec (ICSE 2026), AWS Strands, and CommBank Policy Engine, true guardrails require intervention before tool execution.
Request
Add plugin hook tool.execute.before:
- Signature:
(input: ToolInput) => Promise<{ cancel?: string } | void>
- When
cancel string is returned, abort tool execution and relay the message to the agent
Use Cases
- Repeated failure prevention: block 4th execution after 3 failures of the same command pattern
- Safety policies: block file operations outside allowed directories
- Self-improvement: pre-emptively block commands known to fail based on learned patterns
Background
The current plugin API only provides
tool.execute.after. This allows post-execution detection but not pre-execution blocking. As demonstrated by AgentSpec (ICSE 2026), AWS Strands, and CommBank Policy Engine, true guardrails require intervention before tool execution.Request
Add plugin hook
tool.execute.before:(input: ToolInput) => Promise<{ cancel?: string } | void>cancelstring is returned, abort tool execution and relay the message to the agentUse Cases