[eric] agents: hidden harness messages self-identify, so a misfired nudge can never become 'the user told me to stop' (field report)

This commit is contained in:
ciregenz
2026-08-16 18:49:50 -07:00
parent 2d0fc643f1
commit f92b920e4e
3 changed files with 68 additions and 0 deletions
+6
View File
@@ -114,6 +114,12 @@ class Messaging(AgentManagerProtocol):
"session": session.model_dump(mode="json"),
})
# Hidden messages are harness plumbing (nudges, lost-step retries, auth heals) but ride the
# USER role, so agents stopped mid-task by a misfired nudge truthfully reported "the user
# told me to stop", and others read them as prompt injection (field reports, 2026-08-16).
# One attribution prefix at the one send chokepoint keeps every explanation honest.
if hidden and prompt and not prompt.startswith("[Automated"):
prompt = "[Automated message from OpenSwarm itself, not written by your user] " + prompt
skill_meta = [{"id": s["id"], "name": s["name"]} for s in (attached_skills or [])] or None
image_meta = [{"data": img["data"], "media_type": img.get("media_type", "image/png")} for img in (images or [])] or None
user_msg = Message(