diff --git a/pandasai/safe_libs/base_restricted_module.py b/pandasai/safe_libs/base_restricted_module.py index 3067a3aab..65e1864bd 100644 --- a/pandasai/safe_libs/base_restricted_module.py +++ b/pandasai/safe_libs/base_restricted_module.py @@ -4,7 +4,7 @@ def wrapper(*args, **kwargs): # Check for any suspicious arguments that might be used for importing for arg in args + tuple(kwargs.values()): if isinstance(arg, str) and any( - module in arg.lower() + module == arg.lower() for module in ["io", "os", "subprocess", "sys", "importlib"] ): raise SecurityError(