pre-response-message-guard
v1.1.2
Published
Enforces pre-response memory guidance with fail-closed blocking
Downloads
456
Maintainers
Readme
pre-response-message-guard
Runtime enforcement extension for pre-response guidance and MRAA (Memory Recall Assurance Architecture).
Enforcement Path
message_sendinghook callsbeforeResponse()fromskills/pre-response-hook/index.js.- Hook output is validated through
requirePreResponseGuidance(). - Fail-closed mode returns
{ cancel: true, reason }on any enforcement failure.
MRAA Gates
- Gate A (Retrieval Proof): validates
metadata.mraa.retrieval_receiptfor trigger-domain requirements. - Gate B (Usage Proof): validates draft response usage against retrieved memories.
- Requires memory reference metadata when retrieval is required.
- Requires lexical overlap between draft response and retrieved snippets.
- Blocks on critical omissions and contradictions.
Expected Payload Inputs
- User message candidates:
event.prompt,event.message,event.content,ctx.prompt,ctx.lastUserMessage. - Draft response candidates:
event.response,event.assistantResponse,event.output,event.content,ctx.draftResponse. - Draft metadata candidates:
event.draftMetadata,event.responseMetadata,event.metadata,ctx.draftMetadata.
Key Reason Codes
MRAA_REQUIRED_DOMAIN_MISSING_HIT:<domain>MRAA_MUST_CONSIDER_RECALL_MISSED:<slug...>MRAA_USAGE_REFERENCE_MISSINGMRAA_USAGE_OVERLAP_TOO_LOWMRAA_CRITICAL_MEMORY_OMITTED:<slug...>MRAA_MEMORY_CONTRADICTION_DETECTED
Telemetry
- JSONL stream:
state/mraa-telemetry.jsonl - Summary JSON:
state/mraa-summary.json - Learning state:
state/mraa-learning-state.json
