Merge pull request #14703 from rragundez/code-interpreter-blacklist
feat: Blacklist modules from arbitrary code execution in code interpreter
This commit is contained in:
@@ -1857,6 +1857,16 @@ CODE_INTERPRETER_JUPYTER_TIMEOUT = PersistentConfig(
|
||||
),
|
||||
)
|
||||
|
||||
CODE_INTERPRETER_BLACKLISTED_MODULES = PersistentConfig(
|
||||
"CODE_INTERPRETER_BLACKLISTED_MODULES",
|
||||
"code_interpreter.blacklisted_modules",
|
||||
[
|
||||
library.strip()
|
||||
for library in os.environ.get("CODE_INTERPRETER_BLACKLISTED_MODULES", "").split(",")
|
||||
if library.strip()
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
DEFAULT_CODE_INTERPRETER_PROMPT = """
|
||||
#### Tools Available
|
||||
|
||||
Reference in New Issue
Block a user