Skip to content

The agent engineering platform.

experimental[patch]: block a few more things from PALValidator (#24379)

Eugene Yurtsev6182a402f17c
diff --git a/libs/experimental/langchain_experimental/pal_chain/base.py b/libs/experimental/langchain_experimental/pal_chain/base.py
index 266020d993..fe47c1263b 100644
--- a/libs/experimental/langchain_experimental/pal_chain/base.py
+++ b/libs/experimental/langchain_experimental/pal_chain/base.py
@@ -20,13 +20,21 @@ from langchain_experimental.pal_chain.math_prompt import MATH_PROMPT
from langchain_experimental.pydantic_v1 import Extra, Field, root_validator
from langchain_experimental.utilities import PythonREPL
-COMMAND_EXECUTION_FUNCTIONS = ["system", "exec", "execfile", "eval", "__import__"]
+COMMAND_EXECUTION_FUNCTIONS = [
+ "system",
+ "exec",
+ "execfile",
+ "eval",
+ "__import__",
+ "compile",
+]
COMMAND_EXECUTION_ATTRIBUTES = [
"__import__",
"__subclasses__",
"__builtins__",
"__globals__",
"__getattribute__",
+ "__code__",
"__bases__",
"__mro__",
"__base__",