Fortress Shield: deep PII/secret guard for documents and URLs (paid)
pii_guard_documentsWHAT: Runs the Fairquery Apify Actor llm-data-guard-pii-secrets: everything pii_scan_text does PLUS person-name/location NER, street addresses, public document URLs (txt/md/json/csv/HTML/PDF text layer, <= 10 MB) and restore mode (put originals back into LLM output using a placeholder map). WHEN: Only when you need NER names/addresses, files at URLs/PDFs, or the hosted pipeline. WHEN NOT: Plain text scans (pii_scan_text / pii_redact_text, free), restoring placeholders in an LLM answer (pii_restore_text, free, same result as restore mode), images (no OCR), email deliverability. COST: Paid, billed to YOUR Apify account via your APIFY_TOKEN: $1.50 per 1,000 documents + $0.20 per 1,000 findings. Example: 10 docs with 20 findings ~ $0.02. RETURNS: Paged "document" rows (findings masked; output_text in redact/restore modes; with returnPlaceholderMap the map comes back as an encrypted sealed_map string when this deployment has a seal key) or "error" rows. Tool errors: APIFY_TOKEN_MISSING, APIFY_TOKEN_INVALID, APIFY_PAYMENT_REQUIRED, APIFY_ACTOR_RUN_FAILED, APIFY_TIMEOUT, INPUT_EMPTY. BEHAVIOR: Called from this Fairquery-hosted Worker, which forwards your input and Apify token to Apify and waits 20 s (APIFY_TIMEOUT if the run has not finished). This Worker's code is designed not to store them. The Actor runs in your Apify account and may fetch documentUrls. Up to 1000 texts / 100 URLs (10 MB each). PARAMETERS: texts and/or documentUrls: at least one non-empty (the schema marks both optional; neither -> INPUT_EMPTY, not billed); both may be combined and each text or URL becomes one billed document row. mode="restore" ignores all detector flags; with sealedMap it follows the same restore key rule as pii_restore_text (refusal -> RESTORE_KEY_REQUIRED, nothing billed); a clear-text placeholderMap alone is refused on deployments with a seal key (SEALED_MAP_REQUIRED, nothing billed); a placeholder missing from placeholderMap stays as is. Cost scales with documents and findings, so narrow entityTypes to cut finding charges. limit/offset only page the returned rows: every call processes and bills the whole input again (also when only offset changes), so pick a limit (max 1000) that covers all rows instead of paging. EXAMPLE: {"documentUrls":["https://example.com/report.pdf"],"mode":"redact","detectNames":true}
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pii_guard_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Optional, one of "detect" | "redact" | "restore", default "redact". "detect" = findings only; "redact" = findings + output_text; "restore" = replace placeholders in texts with originals from placeholderMap. Example: "detect" | redact |
| limit | No | Optional page size: items to return, integer 1-1000 (default 100). Example: 50 | |
| texts | No | Optional if documentUrls is given (at least one of the two is required). 0-1000 documents as plain strings, each <= 1,000,000 chars; one billed document row each. Example: ["Mail jane@acme.com, key AKIAIOSFODNN7EXAMPLE"] | |
| offset | No | Optional zero-based number of items to skip, integer 0-1000000 (default 0); pass nextOffset from the previous response, e.g. 100 | |
| allowList | No | Optional, default []. 0-1000 exact values never flagged (whole value, case-insensitive). Example: ["support@yourco.com"] | |
| sealedMap | No | Optional; used only with mode="restore". A sealed_map from this Worker (pii_redact_text or this tool); it is opened here and sent to the Actor as placeholderMap. Example: "fqs1.…" | |
| detectNames | No | Optional boolean, default false. true enables English person-name NER (type PERSON; lower precision, slower) | |
| entityTypes | No | Optional, default omitted = all enabled detectors. 0-40 type names from pii_list_detectors (case-insensitive), e.g. ["EMAIL","PERSON"]; PERSON/LOCATION/STREET_ADDRESS also need detectNames/detectAddresses | |
| entropyScan | No | Optional boolean, default false. true also flags unlabeled random-looking tokens (20+ chars) as HIGH_ENTROPY_STRING | |
| documentUrls | No | Optional if texts is given. 0-100 public http(s) URLs (<= 2000 chars) of txt/md/json/csv/HTML/PDF files (<= 10 MB each, PDF text layer only), fetched by the Actor in Apify cloud. Example: ["https://example.com/a.pdf"] | |
| surrogateSeed | No | Optional, 1-200 chars. WARNING: visible to the model. Prefer the X-FQ-PII-Surrogate-Seed header, which wins and is not echoed. Omit both for a per-call seed. There is no per-tenant isolation. | |
| placeholderMap | No | Optional; used only with mode="restore". Object mapping placeholder -> original value, as returned by an earlier redact call. Example: {"[EMAIL_1]":"jane@acme.com"} | |
| redactionStyle | No | Optional, one of "placeholder" | "mask" | "hash" | "label" | "surrogate", default "placeholder"; used in mode="redact" only. Same five styles as pii_redact_text (t2048u #20). placeholder = [EMAIL_1] (reversible), mask = j***@a***.com, hash = [EMAIL:3f2a9c0d1b7e] | placeholder |
| detectAddresses | No | Optional boolean, default false. true enables street-address patterns (STREET_ADDRESS) and place-name NER (LOCATION) | |
| returnPlaceholderMap | No | Optional boolean, default false. true adds the placeholder map to each row, as an encrypted sealed_map string when this deployment has a seal key (clear-text placeholder_map otherwise); only with mode="redact" and redactionStyle="placeholder" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | No | Tool-specific context (summary counts, cost notes, ...) | |
| count | Yes | Number of items in this page | |
| items | Yes | Result rows for this page | |
| total | Yes | Total items before paging | |
| offset | Yes | Offset of the first item in this page | |
| hasMore | Yes | True if more items exist after this page | |
| nextOffset | Yes | Offset to pass for the next page, or null |