diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index 17ce529b6..8e8d75dd8 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -102,7 +102,10 @@ func NewExecToolWithConfig(workingDir string, restrict bool, config *config.Conf denyPatterns = append(denyPatterns, defaultDenyPatterns...) } - var allowPatterns []string = config.Agents.Defaults.AllowPatterns + var allowPatterns []string + if config != nil { + allowPatterns = config.Agents.Defaults.AllowPatterns + } var allowRegex []*regexp.Regexp if len(allowPatterns) > 0 { allowRegex = make([]*regexp.Regexp, 0, len(allowPatterns))