{
  "openapi": "3.0.1",
  "info": {
    "title": "LLM Data Guard: PII & Secret Redactor",
    "description": "Detect and redact PII (emails, phones, SSNs, Luhn-checked cards, IBANs, IPs, optional names/addresses) and secrets (API keys, tokens, private keys, high-entropy strings) in text, HTML or PDF before it reaches an LLM. Placeholder, mask or hash redaction with reversible map. No data retention.",
    "version": "0.1",
    "x-build-id": "m6WgQ5rWwfmnJOpyh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fairquery~llm-data-guard-pii-secrets/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fairquery-llm-data-guard-pii-secrets",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/fairquery~llm-data-guard-pii-secrets/runs": {
      "post": {
        "operationId": "runs-sync-fairquery-llm-data-guard-pii-secrets",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/fairquery~llm-data-guard-pii-secrets/run-sync": {
      "post": {
        "operationId": "run-sync-fairquery-llm-data-guard-pii-secrets",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "Each entry is one document (prompt, chat message, ticket, log line, file content).",
            "items": {
              "type": "string"
            }
          },
          "documents": {
            "title": "Documents with IDs",
            "type": "array",
            "description": "Optional: [{\"id\": \"ticket-42\", \"text\": \"...\"}]. The id is echoed in the output row.",
            "default": []
          },
          "documentUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Optional: public URLs of text, Markdown, JSON, CSV, HTML or PDF files (max 10 MB each).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "detect",
              "redact",
              "restore"
            ],
            "type": "string",
            "description": "detect = report findings only; redact = also return redacted text; restore = put original values back into LLM output using a placeholder map.",
            "default": "redact"
          },
          "redactionStyle": {
            "title": "Redaction style",
            "enum": [
              "placeholder",
              "mask",
              "hash"
            ],
            "type": "string",
            "description": "placeholder = [EMAIL_1] (reversible with the map); mask = j***@a***.com / **** 1111; hash = [EMAIL:sha256 prefix] (stable for the same salt).",
            "default": "placeholder"
          },
          "returnPlaceholderMap": {
            "title": "Return placeholder map",
            "type": "boolean",
            "description": "Include {\"[EMAIL_1]\": \"jane@acme.com\"} in each row so you can restore values after the LLM answers. The map contains the original sensitive values: only enable it if you will delete the dataset after use.",
            "default": false
          },
          "consistentPlaceholders": {
            "title": "Consistent placeholders across documents",
            "type": "boolean",
            "description": "Same value gets the same placeholder in every document of the run.",
            "default": true
          },
          "placeholderMap": {
            "title": "Placeholder map (restore mode)",
            "type": "object",
            "description": "Map returned by a previous redact run; used only in restore mode.",
            "default": {}
          },
          "hashSalt": {
            "title": "Hash salt",
            "type": "string",
            "description": "Optional salt for hash style. Leave empty for a random per-run salt (hashes then cannot be linked across runs)."
          },
          "detectPii": {
            "title": "Detect PII",
            "type": "boolean",
            "description": "Emails, phones, US SSNs, credit cards (Luhn), IBANs (mod-97), UK NI numbers, IPv4/IPv6.",
            "default": true
          },
          "detectSecrets": {
            "title": "Detect secrets",
            "type": "boolean",
            "description": "Gitleaks-style rules: AWS, GitHub, GitLab, Slack, Stripe, Google, OpenAI, Anthropic, Hugging Face, npm, SendGrid, Twilio, Azure keys, JWTs, private keys, URL credentials, key=value assignments with an entropy check.",
            "default": true
          },
          "detectNames": {
            "title": "Detect person names (NER)",
            "type": "boolean",
            "description": "Open-source NER (compromise, English). Lower precision; adds a little CPU time.",
            "default": false
          },
          "detectAddresses": {
            "title": "Detect street addresses & places",
            "type": "boolean",
            "description": "Street-address pattern (English formats) plus NER place names.",
            "default": false
          },
          "entropyScan": {
            "title": "Flag any high-entropy string",
            "type": "boolean",
            "description": "Also flag unlabeled random-looking tokens (20+ chars). Catches unknown key formats; may flag hashes and IDs.",
            "default": false
          },
          "minEntropy": {
            "title": "Minimum entropy (bits/char)",
            "minimum": 2,
            "maximum": 6,
            "type": "number",
            "description": "Threshold for generic key=value secrets and the entropy scan.",
            "default": 3.5
          },
          "defaultPhoneRegion": {
            "title": "Default phone region",
            "type": "string",
            "description": "ISO country code used for phone numbers written without +country prefix.",
            "default": "US"
          },
          "entityTypes": {
            "title": "Only these types",
            "type": "array",
            "description": "Optional filter, e.g. EMAIL, PHONE, CREDIT_CARD, AWS_ACCESS_KEY. Empty = all enabled detectors.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "allowList": {
            "title": "Allow list",
            "type": "array",
            "description": "Exact values never flagged (e.g. your public support@ address).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeFindingValues": {
            "title": "Include raw values in findings",
            "type": "boolean",
            "description": "Off by default: findings carry only a masked preview and offsets, so the dataset holds no raw sensitive values.",
            "default": false
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap per run.",
            "default": 1000
          },
          "maxCharsPerDocument": {
            "title": "Max characters per document",
            "minimum": 1000,
            "maximum": 20000000,
            "type": "integer",
            "description": "Longer documents are truncated (row gets truncated=true).",
            "default": 1000000
          },
          "purgeInputAfterRun": {
            "title": "Purge input after run",
            "type": "boolean",
            "description": "Delete the INPUT record from the run's key-value store when the run ends, so only the results dataset remains.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}