(input: Partial<SandboxInput>)
| 128 | } |
| 129 | |
| 130 | export function shouldUseSandbox(input: Partial<SandboxInput>): boolean { |
| 131 | if (!SandboxManager.isSandboxingEnabled()) { |
| 132 | return false |
| 133 | } |
| 134 | |
| 135 | // Don't sandbox if explicitly overridden AND unsandboxed commands are allowed by policy |
| 136 | if ( |
| 137 | input.dangerouslyDisableSandbox && |
| 138 | SandboxManager.areUnsandboxedCommandsAllowed() |
| 139 | ) { |
| 140 | return false |
| 141 | } |
| 142 | |
| 143 | if (!input.command) { |
| 144 | return false |
| 145 | } |
| 146 | |
| 147 | // Don't sandbox if the command contains user-configured excluded commands |
| 148 | if (containsExcludedCommand(input.command)) { |
| 149 | return false |
| 150 | } |
| 151 | |
| 152 | return true |
| 153 | } |
| 154 |
no test coverage detected