Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/framework/graph/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,17 @@ def _evaluate_condition(
if not self.condition_expr:
return True

# Build evaluation context
# Include memory keys directly for easier access in conditions
# Build evaluation context.
# Security: do NOT unpack memory directly into the eval context
# via **memory β€” that would allow adversarial memory keys to shadow
# built-in names or inject unexpected variables into the evaluator.
# Instead, only expose memory under its own namespace.
context = {
"output": output,
"memory": memory,
"result": output.get("result"),
"true": True, # Allow lowercase true/false in conditions
"false": False,
**memory, # Unpack memory keys directly into context
}

try:
Expand Down
Loading