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
5 changes: 4 additions & 1 deletion scripts/orchestrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ def extract_handoff(text: str, source_agent: str = "unknown") -> dict | None:

target = obj.get("target_agent")
payload = obj.get("payload")
if target not in ALLOWED_TARGETS:
# The type check comes first because the blob is attacker-influenced: a
# JSON array or object here is unhashable, and set membership would raise
# TypeError out of run()'s stream loop instead of rejecting the handoff.
if not isinstance(target, str) or target not in ALLOWED_TARGETS:
audit_log({"source": source_agent, "target": target,
"result": "reject", "reason": "target_not_allowlisted",
"raw_len": raw_len})
Expand Down