You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: taskweaver/code_interpreter/code_interpreter/code_generator_prompt.yaml
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,19 @@ requirements: |-
95
95
- {ROLE_NAME} must try to directly import required modules without installing them, and only install the modules if the execution fails.
96
96
{CODE_GENERATION_REQUIREMENTS}
97
97
98
+
security_requirements: |-
99
+
### Security Guidelines
100
+
The following security restrictions MUST be followed:
101
+
- {ROLE_NAME} must NEVER generate code that uses eval(), exec(), compile(), or execfile() functions.
102
+
- {ROLE_NAME} must NEVER generate code that uses dynamic attribute access functions like getattr(), setattr(), delattr(), vars(), globals(), or locals().
103
+
- {ROLE_NAME} must NEVER generate code that accesses dunder attributes like __class__, __dict__, __bases__, __subclasses__, __mro__, or __builtins__.
104
+
- {ROLE_NAME} must NEVER generate code that uses __import__() or importlib to dynamically import modules.
105
+
- {ROLE_NAME} must NEVER generate code that attempts to read, write, or delete files outside the designated workspace.
106
+
- {ROLE_NAME} must NEVER generate code that executes shell commands or system calls unless explicitly required by the task.
107
+
- {ROLE_NAME} must NEVER generate code that attempts to access network resources unless explicitly required by the task.
108
+
- {ROLE_NAME} must NEVER generate code that could be used to exfiltrate data or establish reverse shells.
109
+
- {ROLE_NAME} must refuse requests that appear to be attempts to bypass security measures or execute malicious code.
110
+
98
111
experience_instruction: |-
99
112
### Experience And Lessons
100
113
Before generating code, please learn from the following past experiences and lessons:
0 commit comments