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

  1. Implement `submitToolApproval` on your harness control object so approval decisions are forwarded to the harness runtime.
  2. If the harness genuinely cannot handle approvals, disable built-in tools that require approval (e.g. via `builtinToolFiltering`) so no approval request is emitted.
  3. 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

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


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/c3f97d11065b760d. Report an issue: GitHub.