一键导入
event-provenance-hardening
Enforce strict source-boundary labeling in simulations that mix canon/source-grounded content with generated behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforce strict source-boundary labeling in simulations that mix canon/source-grounded content with generated behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | event-provenance-hardening |
| description | Enforce strict source-boundary labeling in simulations that mix canon/source-grounded content with generated behavior |
| source | auto-skill |
| extracted_at | 2026-05-30T05:08:24.432Z |
| updated_at | 2026-05-30T05:33:00.000Z |
When building simulations that reference sacred texts, historical sources, or any canonical material alongside AI-generated behavior, enforce a strict labeling system to prevent generated content from being mistaken for source truth.
CANON_ANCHOR is only allowed when source_anchor is non-null. All other events default to SIMULATION_EVENT.
Every event must include:
{
"label": "CANON_ANCHOR | INTERPRETIVE_BRIDGE | SIMULATION_EVENT",
"source_anchor": "string or null",
"canon_claim": "string or null",
"simulation_note": "string or null"
}
| Label | When to use | Required fields |
|---|---|---|
CANON_ANCHOR | Event directly corresponds to a documented source passage | source_anchor (non-null), canon_claim |
INTERPRETIVE_BRIDGE | Relates to canon themes but infers beyond explicit text | source_anchor (optional), simulation_note |
SIMULATION_EVENT | Default — all generated tick behavior, thoughts, minor actions | simulation_note |
Provenance is enforced at two points:
Before provider output enters the simulation, validate it:
class ProviderOutputValidator:
def validate_and_parse(self, raw_output, provider_name, agent_name, tick):
# 1. Parse JSON — quarantine if invalid
parsed = try_parse_json(raw_output)
if parsed is None:
quarantine(provider_name, agent_name, tick, raw_output, "Invalid JSON")
return {"valid": False}
# 2. Check required fields — quarantine if missing
if not parsed.get("thought") or not parsed.get("action"):
quarantine(provider_name, agent_name, tick, raw_output, "Missing fields")
return {"valid": False}
# 3. Block CANON_ANCHOR without source_anchor
if parsed.get("label") == "CANON_ANCHOR" and not parsed.get("source_anchor"):
quarantine(provider_name, agent_name, tick, raw_output, "Boundary violation")
parsed["label"] = "SIMULATION_EVENT" # Override
return {"valid": True, **parsed}
When events are appended to the log:
def _validate(self, event: dict) -> bool:
if event.get("label") == "CANON_ANCHOR" and not event.get("source_anchor"):
event["quarantine_reason"] = "CANON_ANCHOR without source_anchor"
return False
return True
| File | Contents |
|---|---|
data/quarantine_events.jsonl | Events with invalid provenance |
data/quarantine_provider_outputs.jsonl | Invalid provider responses (bad JSON, missing fields, boundary violations) |
Both files should exist (even if empty) so tests can check known paths. During normal mock operation, both should stay empty.
def _classify_event(self, action_text: str) -> tuple[str, str | None, str | None, str | None]:
"""Return (label, source_anchor, canon_claim, simulation_note)."""
canon_ref = self.scripture.get_canon_reference(action_text)
if canon_ref and keyword_matches(action_text, canon_ref, threshold=3):
return CANON_ANCHOR, canon_ref["reference"], canon_ref["summary"], None
elif canon_ref:
return INTERPRETIVE_BRIDGE, canon_ref["reference"], canon_ref["summary"], "Relates to canon but not direct match."
return SIMULATION_EVENT, None, None, "Generated tick behavior — not grounded in source text."
scripture_source.py holds canon references, consequence_engine.py classifies, event_log.py validates, providers/validation.py sanitizes provider outputProvide an accessible, form-based local key setup flow that writes to .env without command-line editing, with safety locks and zero secret leakage
Add Bible story chapters with canon anchors and a sanitizer layer that cleans raw backend output for non-technical viewers
Build a mobile-first, accessibility-optimized viewer page for non-technical audiences to watch agent-based simulations without seeing admin details, secrets, or technical controls
Safe staged rollout pattern for Bible-inspired agent simulations: MVP → provenance → provider routing → failure hardening → dry-run → single live call → chapter framework → family viewer → story polish → visual story viewer
Implement real LLM provider request-building with dry-run mode that validates payloads, prompts, and secrets without making network calls
Test multiple NIM models against live API keys to determine which models are available, their latency, and token usage