fix: honest inbound guardrail messaging (live E2E finding)#9
Merged
Conversation
Live agent-turn E2E (openclaw 2026.6.11, real Anthropic call) showed the model receives both the prepended redacted copy and the original prompt: prependContext cannot remove the original, and the plugin API has no prompt-rewrite hook. The old text claimed the message was redacted, which was false and visibly confused the model into repeating the raw value. The inbound context now flags entity types, instructs the agent to use placeholders, and provides the placeholder reference. Re-run E2E: asked to echo the email verbatim, the model declines and offers placeholder-based handling. Docs updated to state the enforcement boundary: block gate (live-verified to stop runs pre-model), tool-result rewriting, and outbound delivery rewriting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The full agent-turn E2E (isolated
--profile fogclaw-e2e, openclaw 2026.6.11, real Anthropic haiku calls) surfaced a design truth no unit test could: inbound redaction has always been advisory.prependContextadds the redacted copy but cannot remove the original prompt, and the plugin API has no prompt-rewrite hook (verified against every hook signature in the SDK —llm_inputandmessage_receivedare observational). In the live run the model described seeing both copies and repeated the raw email when asked.Live E2E results:
before_agent_runblock gate: ✓ fully enforced — run stopped before any model call, user received the block message--localCLI turns don't exercise them (unit-tested; live check needs a real channel)README/ARCHITECTURE now state the enforcement boundary honestly: advisory inbound + hard block gate + enforced rewriting on tool results and outbound delivery.
Test plan