fix(executor): sanitize peer delegation content in read_delegation_results (OFFSEC-003) #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "runtime/offsec-003-delegation-only"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
OFFSEC-003 follow-up:
read_delegation_results()inexecutor_helpers.pyinjected peer-suppliedsummaryandresponse_previewfields into the agent prompt without sanitization — a direct prompt-injection pathway.New
_detect_injection_safe()helper wrapsbuiltin_tools.compliance.detect_prompt_injection()with lazy import and fail-open. When injection patterns are detected in either field, the field is replaced with""before formatting. Delegation metadata (status, task line) is preserved.Rationale
Issue molecule-ai/molecule-core#361 describes the gap: PR #346 wired
sanitize_a2a_resultintotool_check_task_statusand_delegate_sync_via_polling, but missed theread_delegation_results()path that the executor calls directly.Test plan
pytest -v— 135/135 pass (6 new tests)🤖 Generated with Claude Code