ai-sdk-harness-approval
The settings of an approval policy, what it makes of a tool call, and the helpers of the components, generated from the source.
defineApprovalPolicy(settings)
Returns an ApprovalPolicy: evaluate(), agentSettings(), warnings(), answer() and approver().
Prop
Type
ApprovalRuleSet
The rules of commands, or of edits: the most restrictive matching rule wins.
Prop
Type
ApprovalEvaluation
What evaluate() makes of a tool call.
Prop
Type
PolicyAgentSettings
What agentSettings(harness) gives, to spread into the settings of a HarnessAgent.
Prop
Type
Prop
Type
ApprovalVerdict
What approver() answers, the approve option of createSessionManager(); undefined leaves the approval to a person.
Prop
Type
Always allow
suggestGrant(request)
Prop
Type
An ApprovalGrant is { kind: 'command', prefix }, { kind: 'edit', path? } or { kind: 'tool', toolName }.
Components
describeToolCall(request)
Prop
Type
answersOf(questions, selection)
AgentQuestions and AgentAnswers are the input and the output of askUserQuestions, as @ai-sdk/harness defines them (HarnessV1QuestionsToolInput, HarnessV1QuestionsToolOutput).