(
annotations: ToolAnnotations | undefined,
policy: EffectivePolicy,
)
| 3556 | // Read before pre-approval arg validation so the extra validation pass |
| 3557 | // only runs for calls that would otherwise burn a user approval. |
| 3558 | const approvalRequired = ( |
| 3559 | annotations: ToolAnnotations | undefined, |
| 3560 | policy: EffectivePolicy, |
| 3561 | ): boolean => { |
| 3562 | if (policy.action === "approve") return false; |
| 3563 | return policy.action === "require_approval" || annotations?.requiresApproval === true; |
| 3564 | }; |
| 3565 | |
| 3566 | const enforceApproval = ( |
| 3567 | annotations: ToolAnnotations | undefined, |
no outgoing calls
no test coverage detected