vercel/ai · error · HarnessBridgeCapabilityUnsupportedError

Permission mode ${JSON.stringify(permissionMode)} is not sup

Error message

Permission mode ${JSON.stringify(permissionMode)} is not supported by this ACP harness. Use permissionMode: 'allow-all'.

What it means

The ACP harness maps each HarnessV1PermissionMode (e.g. 'default', 'allow-all') to an ACP-specific target via a per-harness `permissionModeMapping`. If the requested mode has no entry in that mapping, the harness refuses to configure permissions and throws an unsupported error, suggesting 'allow-all' when that mode is available. This is a configuration guard, not a runtime failure.

Source

Thrown at packages/harness-acp/src/v1/bridge/permission-mode.ts:37

export async function configureACPPermissionMode({
  agent,
  sessionId,
  sessionConfiguration,
  permissionModeMapping,
  permissionMode,
  harnessId,
}: {
  agent: acp.ClientContext;
  sessionId: string;
  sessionConfiguration: ACPSessionConfiguration;
  permissionModeMapping: ACPPermissionModeMapping;
  permissionMode: HarnessV1PermissionMode;
  harnessId: string;
}): Promise<void> {
  const target = permissionModeMapping[permissionMode];
  if (target == null) {
    throw unsupported({
      harnessId,
      message:
        `Permission mode ${JSON.stringify(permissionMode)} is not supported by this ACP harness.` +
        (permissionModeMapping['allow-all'] == null
          ? ''
          : ` Use permissionMode: 'allow-all'.`),
    });
  }

  for (const mappedPermissionMode of PERMISSION_MODES) {
    const mappedTarget = permissionModeMapping[mappedPermissionMode];
    if (mappedTarget != null) {
      validateTarget({
        target: mappedTarget,
        permissionMode: mappedPermissionMode,
        sessionConfiguration,
        harnessId,
      });

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Switch to permissionMode: 'allow-all', which the mapping supports when the suggestion is shown.
  2. Check the harness's ACPPermissionModeMapping to see which permission modes are actually mapped.
  3. Add a mapping entry for the desired mode to your harness configuration if the agent can support it.

Example fix

// before
const session = await agent.ensureSession({ permissionMode: 'ask-user' });
// after
const session = await agent.ensureSession({ permissionMode: 'allow-all' });
Defensive patterns

Strategy: validation

Validate before calling

const supported = (mapping, mode) => mapping[mode] != null;
if (!supported(permissionModeMapping, permissionMode)) {
  permissionMode = 'allow-all';
}

Type guard

function isSupportedMode(
  m: HarnessV1PermissionMode,
  mapping: ACPPermissionModeMapping,
): m is keyof ACPPermissionModeMapping {
  return mapping[m] != null;
}

Prevention

When it happens

Trigger: Calling ensureSession / configureACPPermissionMode with a permissionMode (e.g. 'default' or a mode string) for which the specific ACP harness's ACPPermissionModeMapping has no entry (mapping[permissionMode] === null/undefined).

Common situations: Passing a Harness-level permission mode that the chosen ACP agent does not support (e.g. an agent with no approval concept); copy-pasting a mode value from a different harness; typos in the mode string.

Related errors


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