Skip to content

Commit 925158a

Browse files
committed
fix v1
1 parent f41f801 commit 925158a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

app/agents/wizard_workflow/nodes.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
MAX_ANSWER_LENGTH = 2000
1313
GUARDRAIL_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

app/agents/wizard_workflow/wizard_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def should_ask_or_store(state: WizardState) -> str:
5757

5858

5959
def should_store_after_guardrails(state: WizardState) -> str:
60-
is_valid = bool(state.get("valid", False))
60+
is_valid = state.get("valid") is True
6161
decision = "store_answer" if is_valid else "finish"
6262
logger.debug(f"[WIZARD_GRAPH] should_store_after_guardrails: valid={is_valid} -> {decision}")
6363
return decision

0 commit comments

Comments
 (0)