(
annotations: ToolAnnotations | undefined,
policy: EffectivePolicy,
)
| 5649 | // Read before pre-approval arg validation so the extra validation pass |
| 5650 | // only runs for calls that would otherwise burn a user approval. |
| 5651 | const approvalRequired = ( |
| 5652 | annotations: ToolAnnotations | undefined, |
| 5653 | policy: EffectivePolicy, |
| 5654 | ): boolean => { |
| 5655 | if (policy.action === "approve") return false; |
| 5656 | return policy.action === "require_approval" || annotations?.requiresApproval === true; |
| 5657 | }; |
| 5658 | |
| 5659 | const enforceApproval = ( |
| 5660 | annotations: ToolAnnotations | undefined, |
no outgoing calls
no test coverage detected