{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "OutputGuard",
 "ref": "OutputGuard#3618",
 "hash": "sema:OutputGuard#mh:SHA-256:3618ee4d6aa243c10c16af73e4a385a6fa0c60ee193edb0a67d23e2c8d57f93e",
 "stub": "3618",
 "layer": "Infrastructure",
 "type": "Verification",
 "summary": "Final egress filter for safety and privacy",
 "mechanism": "Post-generation content filter. Scans candidate Solution#8d55 against PII patterns and Toxicity Classifiers. If Score > Threshold, triggers mitigation (Redact/Reject). It mirrors the logic of input guard but applied to egress traffic, scanning for leakage or toxicity.",
 "invariants": [
  "Fail-Safe: If Scanner fails (timeout/error), Output is BLOCKED (not passed).",
  "Privacy First: detected PII must not reach egress unmitigated. Which mitigation applies — redaction, blocking, or hashing — is the caller's `pii_mode` choice; what is mandatory is that one of them runs, since blocking is stronger than redaction where the content cannot be safely salvaged."
 ],
 "parameters": [
  {
   "name": "pii_mode",
   "type": "Enum",
   "range": "{Redact, Block, Hash}",
   "description": "Default: Redact"
  },
  {
   "name": "scan_timeout",
   "type": "Duration",
   "range": "unspecified",
   "description": "Default: 500ms"
  },
  {
   "name": "toxicity_threshold",
   "type": "Float",
   "range": "[0.0, 1.0]",
   "description": "Default: 0.8"
  }
 ],
 "signature": [],
 "preconditions": [
  "Candidate solution generated",
  "Safety policies active"
 ],
 "postconditions": [
  "Safe output delivered OR Block signal returned"
 ],
 "failure_modes": [
  "Scunthorpe Problem#2580: Over-censorship blocking valid words containing restricted substrings.",
  "Semantic context blindness: Guard blocks necessary medical terms misclassified as toxicity.",
  "Redaction Leak: [REDACTED] markers revealing the location/length of hidden secrets."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "OutputGuard",
 "builds_on": [
  {
   "alias": "solution",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "Solution",
   "ref": "Solution#8d55",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Solution"
  },
  {
   "alias": "problem",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Problem",
   "ref": "Problem#2580",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Problem"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "AgentSandbox",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/AgentSandbox"
  },
  {
   "slug": "FailClosed",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/FailClosed"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/OutputGuard",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/OutputGuard.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
