> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Safety

> Refuse pages that try to instruct your AI model, hide personal data in the text you get back or answer only from pages Stophy already stored.

Use these fields before you pass scraped text to a model. `checkPromptInjection` and `redactPII` need an API key. This request scans a page for instructions aimed at a model and hides names, emails and phone numbers:

```bash theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.w3.org/People/Berners-Lee/",
    "checkPromptInjection": true,
    "redactPII": { "entities": ["PERSON", "EMAIL", "PHONE"], "replaceStyle": "tag" },
    "maxChars": 900
  }'
```

Names in `data.markdown` come back as tags such as `<PERSON>`. Check `data.warning` for a cut or incomplete scan.

| Field | Default | Effect |
| - | - | - |
| `checkPromptInjection` | `false` | Scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them returns `403 promptInjectionDetected`, quotes the text as evidence, returns nothing and costs nothing. Send `false` to read that page anyway. |
| `redactPII` | `false` | Hide personal data in the Markdown and in `summary`, `question`, `highlights` and `json`. Links, `html` and `rawHtml` are not changed. `true` uses the defaults below. |
| `redactPII.mode` | `accurate` | `accurate` finds names and places with a model and the rest by pattern. `aggressive` adds guesses that catch more and may hide a little too much. `fast` uses patterns only, so it finds no ordinary names or places. |
| `redactPII.entities` | all six | `PERSON`, `EMAIL`, `PHONE`, `LOCATION`, `FINANCIAL`, `SECRET`. |
| `redactPII.replaceStyle` | `tag` | `tag` writes `<EMAIL>`, `mask` writes `*` for each character, `remove` deletes the text. |
| `lockdown` | `false` | Answer only from a stored copy of any age and never reach the site. A page with no stored copy returns `404 notFound`. See [Freshness and caching](https://docs.stophy.dev/scrape/freshness-and-caching.md). |

## Limits and errors

* The scan reads the first 150,000 characters. A longer page, or one the scan cannot finish, comes back with a `warning` that it was not fully checked.
* A page the model cannot redact is refused, not returned unredacted. That happens for `PERSON` and `LOCATION` on a page longer than 300,000 characters. The call returns `400 invalidRequest` and costs nothing. Use `mode: "fast"`, or leave those two out of `entities`.
* `checkPromptInjection`, `redactPII` and `onlyCleanContent` without an API key return `401 apiKeyRequired`.
* `checkPromptInjection` adds a fee when the scan runs. `redactPII` and `lockdown` add none. See [Pricing](https://docs.stophy.dev/account/pricing.md).

To remove banners and prompts, see [Content filtering](https://docs.stophy.dev/scrape/content-filtering.md). To keep nothing from a call, see [Zero data retention](https://docs.stophy.dev/production/zero-data-retention.md). For what Stophy reads, see [Responsible use](https://docs.stophy.dev/production/responsible-use.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.