MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isPlatformInEnabledList

Function isPlatformInEnabledList

src/utils/sandbox/sandbox-adapter.ts:505–526  ·  view source on GitHub ↗

* Check if the current platform is in the enabledPlatforms list. * * This is an undocumented setting that allows restricting sandbox to specific platforms. * When enabledPlatforms is not set, all supported platforms are allowed. * * Added to unblock NVIDIA enterprise rollout: they want to enabl

()

Source from the content-addressed store, hash-verified

503 * setting enabledPlatforms: ["macos"] to disable sandbox (and auto-allow) on other platforms.
504 */
505function isPlatformInEnabledList(): boolean {
506 try {
507 const settings = getInitialSettings()
508 const enabledPlatforms = (
509 settings?.sandbox as { enabledPlatforms?: Platform[] } | undefined
510 )?.enabledPlatforms
511
512 if (enabledPlatforms === undefined) {
513 return true
514 }
515
516 if (enabledPlatforms.length === 0) {
517 return false
518 }
519
520 const currentPlatform = getPlatform()
521 return enabledPlatforms.includes(currentPlatform)
522 } catch (error) {
523 logForDebugging(`Failed to check enabledPlatforms: ${error}`)
524 return true // Default to enabled if we can't read settings
525 }
526}
527
528/**
529 * Check if sandboxing is enabled

Callers 2

isSandboxingEnabledFunction · 0.85

Calls 3

getInitialSettingsFunction · 0.85
getPlatformFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected