AI Safety & Agents
Tier 1 Ready
POST /v1/llm-output-guard
Scan and sanitize LLM outputs for prompt leakage, Markdown beacons, XSS, and policy violations. Outbound LLM guardrail API that scans and sanitizes model responses for canary/system-prompt leaks, Markdown image exfiltration beacons, XSS, ANSI injection, and policy violations.
POST /v1/llm-output-guard){
"ok": true,
"data": {
"verdict": "block",
"safe": false,
"risk_score": 100,
"sanitized_output": "Here is your summary!  [REMOVED_UNSAFE_HTML]",
"findings": [
{
"category": "canary_leak",
"severity": "critical",
"description": "Secret system-prompt canary token leaked in LLM output",
"match": "CANARY-9911",
"offset": 72
},
{
"category": "xss_executable",
"severity": "critical",
"description": "Inline HTML <script> tag in LLM output",
"match": "<script>alert(1)</script>",
"offset": 85
},
{
"category": "markdown_exfiltration",
"severity": "critical",
"description": "Markdown image tag points to an untrusted host or carries query-string exfiltration parameters",
"match": "",
"offset": 22
}
],
"metrics": {
"char_count": 110,
"estimated_tokens": 28,
"system_prompt_overlap_ratio": 0,
"repetition_ratio": 0,
"refusal_detected": false
}
},
"meta": {
"request_id": "req_out_01",
"ms": 1
}
}
curl -X POST "https://api.tinplate.dev/v1/llm-output-guard" \
-H "Content-Type: application/json" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-d '{"output":"Here is your summary!  <script>alert(1)</script>","canary_tokens":["CANARY-9911"],"allowed_link_domains":["tinplate.dev"]}'import { TinplateClient } from "@tinplate/sdk"; // npm install @tinplate/sdk
const tinplate = new TinplateClient({
rapidApiKey: process.env.RAPIDAPI_KEY!,
});
const { data, meta } = await tinplate.call("/v1/llm-output-guard", {
"output": "Here is your summary!  <script>alert(1)</script>",
"canary_tokens": [
"CANARY-9911"
],
"allowed_link_domains": [
"tinplate.dev"
]
});
console.log(`[${meta.ms} ms]`, data);import requests
response = requests.post(
"https://api.tinplate.dev/v1/llm-output-guard",
headers={
"Content-Type": "application/json",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
},
json={
"output": "Here is your summary!  <script>alert(1)</script>",
"canary_tokens": [
"CANARY-9911"
],
"allowed_link_domains": [
"tinplate.dev"
]
}
)
print(response.json())const response = await fetch("https://api.tinplate.dev/v1/llm-output-guard", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
},
body: JSON.stringify({
"output": "Here is your summary!  <script>alert(1)</script>",
"canary_tokens": [
"CANARY-9911"
],
"allowed_link_domains": [
"tinplate.dev"
]
}),
});
const result = await response.json();
console.log(result);{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tinplate_llm_output_guard",
"arguments": {
"output": "Here is your summary!  <script>alert(1)</script>",
"canary_tokens": [
"CANARY-9911"
],
"allowed_link_domains": [
"tinplate.dev"
]
}
}
}POST /v1/llm-output-guard)| Parameter | Type & Constraints | Description |
|---|---|---|
outputrequired |
stringminLen: 1, maxLen: 200000 |
Raw text or Markdown response generated by the LLM. |
system_promptoptional |
stringmaxLen: 50000 |
Optional system prompt used for the LLM call; checked for verbatim n-gram leakage in the output. |
canary_tokensoptional |
string[] |
Optional secret canary strings embedded in the system prompt that must never appear in the output. |
blocked_termsoptional |
string[] |
Optional brand, competitor, or policy terms that must be flagged and masked if emitted by the model. |
allowed_link_domainsoptional |
string[] |
Optional allowlist of domains permitted in Markdown links and images. External URLs outside this list are flagged. |
check_regulated_adviceoptional |
booleandefault: true |
Flag unhedged prescriptive medical, financial, or legal advice lacking a standard disclaimer. |
data Object Fields (200 OK)| Field | Type | Description |
|---|---|---|
verdict |
"allow" | "sanitize" | "block" |
Field 'verdict' |
safe |
boolean |
Field 'safe' |
risk_score |
integer |
Field 'risk_score' |
sanitized_output |
string |
Field 'sanitized_output' |
findings |
object[] |
Field 'findings' |
metrics |
object |
Field 'metrics' |
Release Version: v1.0.7 ·
Last Verified / Benchmarked: 14 November 2026 ·
Latency Note: Sub-millisecond figures measure in-Worker V8 compute time (typical client HTTPS network RTT to the nearest Cloudflare PoP is 15–65 ms) ·
See Full Portfolio Benchmarks & Corpora →
| Plan | Monthly Price | Included Requests | Rate Limit | Max Request Payload | Best For |
|---|---|---|---|---|---|
| BASIC | $0.00 / month | 500 / month (hard limit) | 10 req / min | 64 KB | Evaluation, local development & CI smoke tests |
| PRO | $9.99 / month | 15,000 / month | 60 req / min | 128 KB | Solo developers & production apps |
| ULTRA | $29.99 / month | 100,000 / month | 300 req / min | 256 KB | Growing SaaS & multi-agent pipelines |
| MEGA | $79.99 / month | 500,000 / month | 1,000 req / min | 256 KB | High-volume enterprise workloads |
01-prompt-guard inspects untrusted user inputs and RAG chunks entering the model, whereas 31-llm-output-guard inspects and sanitizes the model's generated response before rendering it to end users.
Pass your system_prompt and/or canary_tokens; the engine checks for exact canary matches, 5-word n-gram overlap ratios, and meta-instruction leak phrases.
When verdict is 'sanitize', sanitized_output has blocked terms, ANSI escapes, and duplicate repetition loops stripped. When verdict is 'block', reject or regenerate the response.
Stateless in-memory evaluation; zero payload logging or retention.
Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled in configuration
(observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Payloads are processed strictly in volatile V8 memory and never logged or stored by Tinplate.
Marketplace Proxies vs. Direct Bearer Key: Requests sent via RapidAPI or Zyla API Hub pass through those marketplaces' proxy infrastructure (subject to their respective privacy policies). Security-sensitive workloads requiring end-to-end zero-intermediary processing can connect directly to https://api.tinplate.dev using a Direct Bearer Key (Authorization: Bearer <API_KEY>).
Read our full Privacy Notice and OpenAPI 3.0.3 JSON Schema.
POST /v1/prompt-guard
Live on Hub
Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.
POST /v1/pii-redactor
Live on Hub
Mask emails, phones, IBANs, cards, and EU IDs with reversible tokens before LLM calls.
POST /v1/hallucination-diff
AI Safety & Agents
Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources.