Prompt Injection Detection API
Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.
Mask emails, phones, IBANs, cards, and EU IDs with reversible tokens before LLM calls. Stateless PII redaction API that masks emails, phones, IBANs, SSNs, credit cards, and EU national IDs with reversible HMAC tokens before LLM calls.
Additional endpoints in this module: POST /v1/pii-redactor/restore
{
"ok": true,
"data": {
"redacted_text": "Customer [PII_EMAIL_1] (IBAN [PII_IBAN_1]) requested a refund.",
"findings": [
{
"type": "EMAIL",
"start": 9,
"end": 32,
"token": "[PII_EMAIL_1]",
"locale": "GLOBAL",
"validated": false
},
{
"type": "IBAN",
"start": 39,
"end": 67,
"token": "[PII_IBAN_1]",
"locale": "EU",
"validated": true
}
],
"counts": {
"EMAIL": 1,
"IBAN": 1
},
"total_redacted": 2,
"tokens": {
"[PII_EMAIL_1]": "janos.kovacs@example.hu",
"[PII_IBAN_1]": "HU42117730161111101800000000"
}
},
"meta": {
"request_id": "req_pii_01",
"ms": 1
}
}
curl -X POST "https://api.tinplate.dev/v1/pii-redactor" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TINPLATE_KEY" \
-d '{"text":"Customer janos.kovacs@example.hu (IBAN HU42117730161111101800000000) requested a refund.","mode":"token"}'import { TinplateClient } from "@tinplate/sdk";
const tinplate = new TinplateClient({
apiKey: process.env.TINPLATE_API_KEY!,
});
const { data, meta } = await tinplate.call("/v1/pii-redactor", {
"text": "Customer janos.kovacs@example.hu (IBAN HU42117730161111101800000000) requested a refund.",
"mode": "token"
});
console.log(`[${meta.ms} ms]`, data);import requests
response = requests.post(
"https://api.tinplate.dev/v1/pii-redactor",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TINPLATE_KEY",
},
json={
"text": "Customer janos.kovacs@example.hu (IBAN HU42117730161111101800000000) requested a refund.",
"mode": "token"
}
)
print(response.json())const response = await fetch("https://api.tinplate.dev/v1/pii-redactor", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TINPLATE_KEY",
},
body: JSON.stringify({
"text": "Customer janos.kovacs@example.hu (IBAN HU42117730161111101800000000) requested a refund.",
"mode": "token"
}),
});
const result = await response.json();
console.log(result);{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tinplate_pii_redactor",
"arguments": {
"text": "Customer janos.kovacs@example.hu (IBAN HU42117730161111101800000000) requested a refund.",
"mode": "token"
}
}
}POST /v1/pii-redactor)| Parameter | Type & Constraints | Description |
|---|---|---|
text required |
stringminLen: 1, maxLen: 262144 |
Input text to scan and redact (max 256 KB). |
locales optional |
string[] |
Locale packs to enable (defaults to ['GLOBAL', 'EU']). |
mode optional |
"token" | "mask" |
'token' returns reversible [PII_<TYPE>_N] tokens + caller-only tokens map; 'mask' returns [REDACTED:<TYPE>] with an empty tokens map. |
types optional |
string[] |
Optional whitelist of PII entity types to redact. |
data Object Fields (200 OK)| Field | Type | Description |
|---|---|---|
redacted_text |
string |
Field 'redacted_text' |
findings |
object[] |
Field 'findings' |
counts |
object |
Field 'counts' |
total_redacted |
integer |
Field 'total_redacted' |
tokens |
object |
Reversible token map returned only to the caller (never stored server-side). Empty in 'mask' mode. |
Release: v1.0.39 ·
Verified: 16 November 2026 ·
Portfolio Median: 0.318 ms in-Worker V8 compute (add 15–65 ms HTTPS RTT) ·
See Full Portfolio Benchmarks →
Direct Polar All-Access Keys unlock all 42 APIs (49 endpoints), /v1/pipeline, and /mcp on api.tinplate.dev:
Pro ($29/mo · 120 req/min · 100k/mo · 128 KB) or Team ($79/mo · 300 req/min · 500k/mo · 256 KB).
| Plan | Monthly Price | Included Requests | Rate Limit | Max Payload | Best For |
|---|---|---|---|---|---|
| BASIC | $0.00 / mo | 500 / month | 10 req / min | 64 KB | Evaluation & CI smoke tests |
| PRO | $9.99 / mo | 15,000 / month | 60 req / min | 128 KB | Solo devs & production apps |
| ULTRA | $29.99 / mo | 100,000 / month | 300 req / min | 256 KB | Growing SaaS & multi-agent pipelines |
| MEGA | $79.99 / mo | 500,000 / month | 1,000 req / min | 256 KB | High-volume enterprise workloads |
Keep the entities map returned by /v1/pii-redactor in your application memory and send the LLM output plus that map to POST /v1/pii-redactor/restore.
Yes. Credit cards require Luhn validation, IBANs require ISO 13616 MOD-97 verification, and national IDs validate check digits before masking.
Never. Workers Observability and invocation logs are disabled in wrangler.toml (observability.enabled = false).
100% stateless V8 isolate execution. Raw PII and redaction maps are never written to disk, KV, D1, or console logs.
Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Requests via RapidAPI or Zyla traverse marketplace proxies; use a Direct Bearer Key for zero-intermediary routing.
Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.
Detect and mask leaked API keys, JWTs, and private keys in logs, diffs, and prompts.
Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources.