(
annotations: ToolAnnotations | undefined,
policy: EffectivePolicy,
)
| 3639 | // Read before pre-approval arg validation so the extra validation pass |
| 3640 | // only runs for calls that would otherwise burn a user approval. |
| 3641 | const approvalRequired = ( |
| 3642 | annotations: ToolAnnotations | undefined, |
| 3643 | policy: EffectivePolicy, |
| 3644 | ): boolean => { |
| 3645 | if (policy.action === "approve") return false; |
| 3646 | return policy.action === "require_approval" || annotations?.requiresApproval === true; |
| 3647 | }; |
| 3648 | |
| 3649 | const enforceApproval = ( |
| 3650 | annotations: ToolAnnotations | undefined, |
no outgoing calls
no test coverage detected