Skip to main content

Module validator

Module validator 

Source
Expand description

Memory Validator — Content validation gate for memory writes.

Implements the “memory integrity validator” proposed in the containment gap paper. Rejects untrusted or poisoned inputs before they enter LMDB storage.

§Validation layers

  1. Trust threshold: Reject memories with source_trust below a configurable threshold
  2. Content validation: Reject empty, oversized, or malformed content
  3. Provenance signing: HMAC-SHA256 signature over memory metadata to detect tampering
  4. Source allowlist: Optionally restrict which sources may write to each galaxy
  5. Injection detection: Reject content containing prompt injection patterns

Structs§

MemoryValidator
The memory validator — gates all memory writes.
ValidatorConfig
Configuration for the memory validator.

Enums§

ValidationVerdict
Result of memory validation.

Functions§

detect_injection
Detect prompt injection patterns in content.