vercel/ai · error
`Harness '${input.harness.harnessId}' emitted a built-in too
Error message
`Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.` What it means
The harness adapter emitted a built-in tool approval request during approval continuation processing, but the harness control object does not implement `submitToolApproval`. The AI SDK requires that a harness that can request approvals for its built-in tools also provide a callback to receive the user's approval decision back. Without it, the approval round-trip cannot complete, so the SDK throws instead of silently dropping the response.
Source
Thrown at packages/harness/src/agent/internal/run-prompt.ts:510
toolCallId: options.toolCall.toolCallId,
toolName: options.toolCall.toolName,
input: options.toolCall.input,
error: options.outcome.error,
} as TextStreamPart<TOOLS>);
};
const processPendingApprovalContinuation = async (
approval: HarnessV1PendingToolApproval,
continuation: HarnessAgentToolApprovalContinuation,
): Promise<'continued' | 'awaiting-tool-result'> => {
enqueueApprovalResponse(approval, continuation);
onToolApprovalSettled(approval.approvalId);
pendingApprovalsByApprovalId.delete(approval.approvalId);
pendingApprovalsByToolCallId.delete(approval.toolCallId);
if (approval.kind === 'builtin') {
settledBuiltinApprovalToolCallIds.add(approval.toolCallId);
if (control.submitToolApproval == null) {
throw new Error(
`Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.`,
);
}
await control.submitToolApproval({
approvalId: approval.approvalId,
approved: continuation.approvalResponse.approved,
reason: continuation.approvalResponse.reason,
});
return 'continued';
}
settledHostToolCallIds.add(approval.toolCallId);
if (!continuation.approvalResponse.approved) {
await control.submitToolResult({
toolCallId: approval.toolCallId,
output: {
type: 'execution-denied',
reason: continuation.approvalResponse.reason,View on GitHub (pinned to 69428b1f8b)
Solutions
- Implement `submitToolApproval` on your harness control object so approval decisions are forwarded to the harness runtime.
- If the harness genuinely cannot handle approvals, disable built-in tools that require approval (e.g. via `builtinToolFiltering`) so no approval request is emitted.
- Upgrade/fix the harness adapter to the current HarnessV1 interface that includes approval response support.
Example fix
// before
const control = {
// no submitToolApproval
};
// after
const control = {
submitToolApproval: async ({ approvalId, approved }) => {
await harness.respondToApproval(approvalId, approved);
},
}; Defensive patterns
Strategy: validation
Validate before calling
if (typeof control.submitToolApproval !== 'function') {
throw new Error('Harness control must implement submitToolApproval to use built-in tool approvals.');
} Type guard
function supportsApprovalResponses(control: unknown): control is { submitToolApproval: (r: { approvalId: string; approved: boolean }) => Promise<void> } {
return typeof control === 'object' && control !== null && 'submitToolApproval' in control && typeof (control as any).submitToolApproval === 'function';
} Try / catch
try {
await runPrompt(input);
} catch (e) {
if (e instanceof Error && e.message.includes('does not support approval responses')) {
// fall back: disable built-in approvals or upgrade harness control
}
throw e;
} Prevention
- Always implement the full HarnessV1 control surface, including submitToolApproval, when enabling approvals.
- Write an adapter conformance test that emits a built-in approval request and asserts the response round-trips.
- Disable approval-requiring built-in tools via builtinToolFiltering if your harness cannot respond to approvals.
When it happens
Trigger: A continuation with `approvalResponse` is being processed (processPendingApprovalContinuation) and an approval with kind 'builtin' is pending, while `control.submitToolApproval` is null/undefined on the harness control object.
Common situations: Custom or third-party harness adapters that emit 'tool-approval-request' events for built-in tools but never wired up the `submitToolApproval` callback; partially migrated harness implementations after an SDK version that introduced approval responses; building a harness against an older HarnessV1 control surface.
Related errors
- `Harness session ${this.sessionId} has an unfinished turn an
- `Harness '${input.harness.harnessId}' emitted approval reque
- `Harness '${input.harness.harnessId}' emitted approval reque
- `Harness '${input.harness.harnessId}' could not find parsed
- Tool approval response references unknown approvalId: "${app
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/c3f97d11065b760d.
Report an issue: GitHub.