prism-corpus
PRISM (Procedural Research Inventory for Synthetic Messaging) is an offline-first Python library and CLI for generating reproducible, defanged synthetic messaging corpora and matched benign twins across SMS, email, and social direct messages.
Status: Early development (v0.1.0a1 skeleton).
Architecture
PRISM separates message structure, procedural slot synthesis, and optional surface paraphrasing into three layers:
- Layer 1 — Structural Blueprints (
prism_corpus.schemas, prism_corpus.blueprints): Typed YAML/JSON schemas defining message slots, multi-turn conversation state machines, and ground-truth manipulation indicator labels.
- Layer 2 — Procedural Slot & Metadata Synthesiser (
prism_corpus.synth, prism_corpus.locales, prism_corpus.mutators): Seeded, 100% deterministic offline synthesis of locale-aware metadata, email authentication headers (SPF/DKIM/DMARC), controlled perturbation mutators, and 1:1 matched benign twins (pair_id).
- Layer 3 — Optional BYOM Surface Realiser (
prism_corpus.realiser): Optional OpenAI-compatible / local LLM paraphrasing constrained by Pydantic validation, artefact preservation, and corpus diversity checks.
Research Safety & Defanging Policy
PRISM is strictly designed for defensive machine-learning evaluation and human-factors security research:
- All generated URLs and email domains are restricted to IANA-reserved non-routable namespaces under RFC 2606 (
.test, .example, .invalid, example.com, example.org, example.net).
- PRISM includes no network delivery, message transport, or live-site cloning functionality.
Development Setup
pip install -e ".[dev]"
pytest
prism --help
Licence
Released under the MIT License.