diff --git a/nanobot/agent/tools/shell.py b/nanobot/agent/tools/shell.py index 26fb9fa9..37d16e1b 100644 --- a/nanobot/agent/tools/shell.py +++ b/nanobot/agent/tools/shell.py @@ -759,7 +759,7 @@ class ExecTool(Tool): # only explicitly allowed when every top-level shell segment matches. segments = self._split_shell_segments(lower) explicitly_allowed = bool(self.allow_patterns) and bool(segments) and all( - any(re.search(pattern, segment) for pattern in self.allow_patterns) + any(re.fullmatch(pattern, segment) for pattern in self.allow_patterns) for segment in segments ) if not explicitly_allowed: