{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/secureai-one/json-schema/secureai-one-redaction-schema.json",
  "title": "Redaction",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/secureai-one-openapi.json#/components/schemas/Redaction",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "redaction"
    },
    "text": {
      "type": "string",
      "description": "The text with stand-ins in place. Send this to your model."
    },
    "map": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Stand-in to real value. Returned here and stored nowhere — keep it for the life of the conversation or that answer cannot be restored."
    },
    "redacted": {
      "type": "integer",
      "description": "How many values were replaced."
    },
    "names_decided": {
      "type": "boolean",
      "description": "Whether the name check reached a decision. False means it could not run, not that no names were found."
    },
    "spans": {
      "type": "array",
      "description": "Present when `spans` was true.",
      "items": {
        "type": "object",
        "properties": {
          "start": {
            "type": "integer",
            "description": "Code-point offset in the text sent."
          },
          "end": {
            "type": "integer",
            "description": "Exclusive code-point offset."
          },
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "How often a value of this kind was really private on the public test sets. Null where not measured."
          }
        }
      }
    },
    "risk": {
      "type": "object",
      "description": "Present when `risk` was true. A rule-based score, not a measured probability.",
      "properties": {
        "score": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "level": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "birth_date",
                  "date",
                  "age",
                  "place",
                  "care_facility",
                  "sex",
                  "occupation"
                ]
              },
              "weight": {
                "type": "number"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
  }
}