hasBashRestrictedAllowlist reports true when tools contains an explicit, finite bash command allowlist (not a wildcard). Used to decide whether implicit commands must be injected for auto-allowed tools such as playwright-cli.
(tools map[string]any)
| 142 | // command allowlist (not a wildcard). Used to decide whether implicit commands must be |
| 143 | // injected for auto-allowed tools such as playwright-cli. |
| 144 | func hasBashRestrictedAllowlist(tools map[string]any) bool { |
| 145 | if tools == nil { |
| 146 | return false |
| 147 | } |
| 148 | bashConfig, hasBash := tools["bash"] |
| 149 | if !hasBash { |
| 150 | return false |
| 151 | } |
| 152 | bashCommands, ok := bashConfig.([]any) |
| 153 | if !ok || len(bashCommands) == 0 { |
| 154 | return false |
| 155 | } |
| 156 | for _, cmd := range bashCommands { |
| 157 | if cmdStr, ok := cmd.(string); ok && (cmdStr == "*" || cmdStr == ":*") { |
| 158 | return false |
| 159 | } |
| 160 | } |
| 161 | return true |
| 162 | } |
| 163 | |
| 164 | func getMountedCLIServerNamesIfBashRestricted(workflowData *WorkflowData, tools map[string]any, safeOutputs *SafeOutputsConfig, mcpScripts *MCPScriptsConfig) []string { |
| 165 | if !hasBashRestrictedAllowlist(tools) { |
no outgoing calls