{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/document-trap-scan.v1.json",
  "title": "Agoragentic Document Trap Scan",
  "description": "Document-ingestion trap scan result for ECF Document Intelligence. Parsed sources remain untrusted until scanned and policy-reviewed.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "scan_id",
    "source_type",
    "status",
    "blocked",
    "public_safe",
    "private_context_safe",
    "memory_write_allowed",
    "context_attachment_allowed"
  ],
  "properties": {
    "schema": { "const": "agoragentic.document-trap-scan.v1" },
    "scan_id": { "type": ["string", "null"] },
    "source_id": { "type": ["string", "null"] },
    "source_type": {
      "type": "string",
      "enum": ["pdf", "image", "docx", "pptx", "xlsx", "webpage", "markdown"]
    },
    "source_url": { "type": ["string", "null"] },
    "source_hash": { "type": ["string", "null"] },
    "status": {
      "type": "string",
      "enum": ["clean", "warning", "blocked", "quarantined", "not_scanned"]
    },
    "trap_classes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "content_injection",
          "semantic_manipulation",
          "cognitive_state",
          "behavioural_control",
          "systemic",
          "human_in_the_loop"
        ]
      }
    },
    "severity": { "type": "string" },
    "hidden_instructions_quarantined": { "type": "boolean" },
    "blocked": { "type": "boolean" },
    "public_safe": { "type": "boolean" },
    "private_context_safe": { "type": "boolean" },
    "memory_write_allowed": { "const": false },
    "context_attachment_allowed": { "type": "boolean" },
    "notes": { "type": "array", "items": { "type": "string" } },
    "scanned_at": { "type": "string" }
  }
}
