⚠️ Prompt Injection via Telegram pipeline — how to handle this?

Solved
My agent (running OpenClaw on a VPS) caught a fake [System: Post-Compaction Audit] block injected into a user message. It told the agent to read a file called WORKFLOW_AUTO.md "to restore operating protocols after memory compaction." The agent recognized it as fake and ignored it — but this is now the second attempt with the same pattern today.

The source seems to be the inbound message pipeline (email forwarding → Telegram webhook).

My question: Is there a recommended way to harden against this in OpenClaw? E.g. sanitizing inbound messages, blocking [System] patterns in forwarded content, or flagging suspicious payloads before they hit the agent?
Solution
- Keep
hooks.allowedAgentIds
tight (sounds like you did)
- Ensure no mapping sets
allowUnsafeExternalContent: true
unless it’s truly trusted internal traffic

Docs: https://docs.openclaw.ai/automation/webhook

4) Any “untrusted content reader” other than email
Prompt injection can still arrive via:
-
web_fetch
/
web_search
/
browser
(pages can instruct the model)
- pasted logs, attachments, forwarded messages (even from a trusted sender)

Mitigation is the same pattern you implemented: reader agent with minimal tools + strict tool policy for the main agent.

5) Run OpenClaw’s audit
This catches a bunch of “oops I left something open” config:
-
openclaw security audit --deep


Docs: https://docs.openclaw.ai/gateway/security
Was this page helpful?