Quick Start
1
Default β fencing is automatic
Enable a webhook or hook as usual. Payload fencing needs no configuration β every interpolated payload value is wrapped before the agent runs.
2
See what the agent receives
Operator text stays outside the fence; the payload value lands inside
<external_request_payload> tags, preceded once by an inline notice.How It Works
Each payload value is fenced at ingress, then an inline notice is prepended once so the untrusted-data semantics travel with the message.What the Agent Sees
An attacker cannot break out of the fence β a smuggled closer inside a payload field is delimiter-escaped, so only the fenceβs own closer survives. Template:</external_request_payload> is escaped to </external_request_payload>, so the real closer is still the fenceβs own single tag.
Configuration Options
This is a labelling defence β the only knob isdeliver_only.
The exact markers, notice, and escaping:
Best Practices
Keep operator text outside the placeholders
Keep operator text outside the placeholders
Static template text sits outside
{{ ... }} β it is trusted and stays outside the fence. Only interpolated payload fields are the untrusted part that gets wrapped.Do not strip the fence markers
Do not strip the fence markers
Removing
<external_request_payload> tags from an agentβs input reopens the injection channel. Leave them in place.Use deliver_only for pure notification forwarding
Use deliver_only for pure notification forwarding
deliver_only: true sends the rendered message straight to a channel with no agent turn β recipients of a chat message never want to see literal fence tags, so no fence is added.use_system_prompt=False stays safe
use_system_prompt=False stays safe
The inline notice travels with each fenced message, so the untrusted-data semantics survive even when the system-prompt trust clause is absent.
Related
Prompt Injection Protection
The outbound counterpart β tool results wrapped in
<external_tool_result>Webhook Channel
Route any HTTP webhook to an agent through YAML config
Gateway Hooks
Trigger agents from external services via authenticated POST
Gateway Inbound Hooks
Trigger agent runs from external HTTP events

