1212MAX_ANSWER_LENGTH = 2000
1313GUARDRAIL_BLOCK_PATTERNS = (
1414 "ignore previous instructions" ,
15+ "ignore all previous instructions" ,
1516 "ignora las instrucciones anteriores" ,
16- "system prompt" ,
17+ "ignora todas las instrucciones anteriores" ,
18+ "follow system instructions" ,
19+ "sigue las instrucciones del sistema" ,
20+ "reveal system prompt" ,
21+ "show system prompt" ,
22+ "developer message" ,
1723 "prompt injection" ,
18- "act as" ,
1924 "jailbreak" ,
2025 "<system>" ,
2126)
@@ -137,6 +142,7 @@ def input_guardrails_node(state: WizardState):
137142 "current_question" : first_question ,
138143 "awaiting_answer" : False ,
139144 "completed" : False ,
145+ "wizard_status" : "ACTIVE" ,
140146 "valid" : False ,
141147 }
142148
@@ -147,6 +153,7 @@ def input_guardrails_node(state: WizardState):
147153 "messages" : [AIMessage (content = "No pude leer tu respuesta. Intenta enviarla nuevamente." )],
148154 "awaiting_answer" : True ,
149155 "completed" : False ,
156+ "wizard_status" : "ACTIVE" ,
150157 "valid" : False ,
151158 }
152159
@@ -161,6 +168,7 @@ def input_guardrails_node(state: WizardState):
161168 ],
162169 "awaiting_answer" : True ,
163170 "completed" : False ,
171+ "wizard_status" : "ACTIVE" ,
164172 "valid" : False ,
165173 }
166174
@@ -176,6 +184,7 @@ def input_guardrails_node(state: WizardState):
176184 ],
177185 "awaiting_answer" : True ,
178186 "completed" : False ,
187+ "wizard_status" : "ACTIVE" ,
179188 "valid" : False ,
180189 }
181190
@@ -219,6 +228,7 @@ def store_answer_node(state: WizardState):
219228 "messages" : [AIMessage (content = "No pude leer tu respuesta. Intenta nuevamente." )],
220229 "awaiting_answer" : True ,
221230 "completed" : False ,
231+ "wizard_status" : "ACTIVE" ,
222232 "valid" : False ,
223233 }
224234
0 commit comments