vercel/ai · warning
The sandbox implementation does not support configuring requ
Error message
The sandbox implementation does not support configuring request transformations, so credential brokering does not work. Falling back to less secure credential forwarding.
What it means
This warning is emitted when credential brokering is requested in a sandboxed execution environment that cannot install request transformations (which are required to swap credential placeholders for real credentials at request time). The library falls back to forwarding real credentials directly to tools, which is functional but less secure. It is a console.warn, not a thrown exception.
Source
Thrown at packages/harness/src/utils/sandbox-credential-brokering.ts:15
import { randomBytes } from 'node:crypto';
import type { HarnessV1RequestTransformation } from '../v1';
const SANDBOX_CREDENTIAL_PLACEHOLDER_PREFIX = 'aisdkhc_';
export function generateSandboxCredentialPlaceholder(): string {
return `${SANDBOX_CREDENTIAL_PLACEHOLDER_PREFIX}${randomBytes(32).toString('base64url')}`;
}
export function isSandboxCredentialPlaceholder(value: string): boolean {
return /^aisdkhc_[A-Za-z0-9_-]{43}$/.test(value);
}
export function warnCredentialBrokeringUnavailable(): void {
console.warn(
'The sandbox implementation does not support configuring request transformations, so credential brokering does not work. Falling back to less secure credential forwarding.',
);
}
export function maskSandboxCredentials({
environment,
credentialEnvironmentVariables,
}: {
environment: Readonly<Record<string, string>>;
credentialEnvironmentVariables: ReadonlyArray<string>;
}): Record<string, string> {
const maskedEnvironment = { ...environment };
for (const name of credentialEnvironmentVariables) {
if (maskedEnvironment[name] != null) {
maskedEnvironment[name] = name;
}
}
return maskedEnvironment;View on GitHub (pinned to 69428b1f8b)
Solutions
- Use a sandbox implementation that supports request transformations so credential brokering works.
- Disable credential brokering explicitly if the insecure fallback is unacceptable, and pass credentials another way (e.g. per-tool auth configuration).
- Accept the fallback after reviewing that forwarding credentials directly to the sandbox is acceptable in your threat model.
- Suppress/handle the console.warn if the fallback is intentional in your environment.
Example fix
// before
const agent = createClaudeCode({ sandbox: { credentialBrokering: true } });
// after (sandbox lacks request-transform support)
const agent = createClaudeCode({ sandbox: { credentialBrokering: false } }); Defensive patterns
Strategy: validation
Validate before calling
// verify sandbox supports request transformations before enabling brokering
if (sandbox && !sandboxCapabilities.requestTransformations && credentialBrokering) {
// route credentials another way or disable brokering
} Prevention
- Check sandbox capability docs before enabling credential brokering
- Review security implications of credential forwarding fallback
- Capture console.warn in dev CI to surface silent security degradations
When it happens
Trigger: Creating a harness agent (createACPV1, createClaudeCode, createCodex, createDeepAgents, or createOpenCode) with sandbox execution and credential brokering enabled, when the sandbox implementation lacks support for configuring request transformations.
Common situations: Developers enabling sandboxed agent runs with brokered credentials for API keys (e.g. provider keys injected as aisdkhc_ placeholders); teams running on a sandbox runtime that predates request-transformation support.
Related errors
- Sandbox workspace mirror received an invalid relative path:
- 'HarnessAgent: `sandboxConfig.workDir` must stay inside the
- Invalid argument for parameter requests: request IDs must be
- Invalid argument for parameter batch: batch must be a suppor
- Tool approval signature verification failed for approval "${
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/88ae5b24c3c35829.
Report an issue: GitHub.