mastra-ai/mastra · error
allowSystemBinaries: false is not supported by seatbelt (mac
Error message
allowSystemBinaries: false is not supported by seatbelt (macOS). Use bubblewrap on Linux or remove this restriction.
What it means
generateSeatbeltProfile is fail-closed: macOS seatbelt (SBPL) cannot restrict process-exec enough to exclude system binaries, so a NativeSandboxConfig with allowSystemBinaries: false is rejected rather than generating a profile that silently allows more than requested.
Source
Thrown at packages/core/src/workspace/sandbox/native-sandbox/seatbelt.ts:88
}
}
/**
* Generate a seatbelt profile for the given configuration.
*
* The profile:
* - Allows all file reads (can't restrict with subpath on macOS)
* - Restricts file writes to temp directories, configured writable paths, and the workspace unless read-only
* - Blocks network unless explicitly allowed
*
* @param workspacePath - The workspace directory to sandbox
* @param config - Additional sandbox configuration
* @returns The generated SBPL profile content
*/
export function generateSeatbeltProfile(workspacePath: string, config: NativeSandboxConfig): string {
// Fail-closed: seatbelt cannot restrict process-exec, so reject unsupported config
if (config.allowSystemBinaries === false) {
throw new Error(
'allowSystemBinaries: false is not supported by seatbelt (macOS). ' +
'Use bubblewrap on Linux or remove this restriction.',
);
}
const lines: string[] = [];
// Version and default deny
lines.push('(version 1)');
// Marker comment, so a profile Mastra wrote is still known as ours on a later run.
lines.push(GENERATED_PROFILE_MARKER);
lines.push('(deny default (with message "mastra-sandbox"))');
lines.push('');
// Process permissions
lines.push('; Process permissions');
lines.push('(allow process-exec)');
lines.push('(allow process-fork)');View on GitHub (pinned to 75dd419e61)
Solutions
- Remove `allowSystemBinaries: false` from the config on macOS.
- Set allowSystemBinaries: true (or omit it) when the seatbelt backend is used.
- Condition the config on process.platform so Linux keeps bubblewrap's strict setting.
- If you need that restriction on macOS, use a different isolation mechanism (e.g. a container/VM).
Example fix
// before
const config = { allowSystemBinaries: false };
// after
const config = process.platform === 'darwin'
? {} // seatbelt cannot support this restriction
: { allowSystemBinaries: false }; Defensive patterns
Strategy: validation
Validate before calling
if (process.platform === 'darwin' && config.allowSystemBinaries === false) {
throw new Error('allowSystemBinaries:false unsupported on macOS seatbelt; adjust config');
} Type guard
function isSeatbeltCompatible(config: { allowSystemBinaries?: boolean }): boolean {
return process.platform !== 'darwin' || config.allowSystemBinaries !== false;
} Try / catch
try {
const sb = createNativeSandbox(config);
} catch (e) {
if (e instanceof Error && /seatbelt \(macOS\)/.test(e.message)) {
// fall back to a seatbelt-safe config
const { allowSystemBinaries, ...rest } = config;
return createNativeSandbox(rest);
}
throw e;
} Prevention
- Branch sandbox config on process.platform (seatbelt vs bubblewrap).
- Keep platform-specific restrictions in separate config profiles.
- Test sandbox startup on both Linux and macOS CI runners.
When it happens
Trigger: Creating a native sandbox with `allowSystemBinaries: false` on macOS (seatbelt backend), e.g. passing { allowSystemBinaries: false } in workspace/native sandbox config while running on darwin.
Common situations: Sharing one sandbox config between Linux (bubblewrap) and macOS (seatbelt) machines/CI; tightening security settings after reading Linux-focused docs; a hardened default inherited from a Linux-oriented template.
Related errors
- execa is not available in Cloudflare Workers
- Sandbox provider "${sandbox.provider}" does not support netw
- Sandbox provider "${sandbox.provider}" did not expose a publ
- Woke sandbox but the Mastra server did not become healthy at
- createSandboxProxy requires an Edge Config connection string
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/4d3d216dd5110032.
Report an issue: GitHub.