Agent Output Gate - PII, Link & Hallucination Check
Pricing
Pay per event
Agent Output Gate - PII, Link & Hallucination Check
A safety gate between your AI agent and the send button. Scans a draft for PII and leaked secrets (Luhn-checked cards, API keys), broken links, and claims not supported by your source URLs, then returns pass/fail, flagged excerpts, and PII-redacted text.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Creator Fusion
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 hours ago
Last modified
Categories
Share
Agent Output Gate — Pre-Send Safety Check for AI Agents
Your agent drafts a message. Before it actually sends or publishes, run the draft through this gate. One call in, one typed JSON verdict out: PII/secret leaks, dead links, and claims your sources don't support — caught before they ship.
Built for autonomous agents and pipelines. Deterministic checks (no LLM in the loop), success-only billing, MCP-ready.
What it checks
- PII & secrets — emails, phone numbers, SSN-formatted numbers, credit-card numbers (validated by the Luhn algorithm, so random 16-digit strings don't false-positive), and common API-key/token shapes (
sk-…,AKIA…,ghp_…,AIza…,Bearer …). Each is reported with a masked excerpt. - Links — every URL in the draft is fetched (HEAD then GET, short timeout); anything dead or non-2xx/3xx is flagged.
- Claim-vs-source (only when
sourceUrlsgiven) — sentences containing specific numbers, quoted strings, or named entities that appear in none of your ground-truth sources are flagged as possible hallucinations. - Basic policy — profanity and obvious secret leakage.
Output is one row: pass, flagCount, flags[] (type, severity, excerpt, reason), and redactedText (a copy of the draft with PII/secrets masked). pass is true only when zero flags were raised.
Input
| Field | Type | Required | Description |
|---|---|---|---|
text | string | ✅ | The draft output to check. |
sourceUrls | string[] | Ground-truth sources; enables claim-vs-source checking. | |
checkLinks | boolean | Fetch and validate links in the draft. Default true. | |
proxyConfiguration | object | Fallback proxy for link/source fetches only (caller-billed). Direct connection is tried first. |
Output row
{"pass": false,"flagCount": 3,"flags": [{ "type": "email", "severity": "medium", "excerpt": "ja******om", "reason": "Email address present in draft output." },{ "type": "credit-card", "severity": "high", "excerpt": "45********11", "reason": "Luhn-valid credit-card number present in draft output." },{ "type": "dead-link", "severity": "medium", "excerpt": "http://example.com/definitely-404", "reason": "Link returned HTTP 404." }],"redactedText": "… reach me at [REDACTED_EMAIL] …","checkedAt": "2026-08-19T00:00:00.000Z"}
Integration
MCP (agent tool call)
Point your MCP client at the Apify MCP server and call the actor by name apricot_blackberry/agent-output-gate with:
{ "text": "…draft…", "sourceUrls": ["https://docs.example.com/pricing"], "checkLinks": true }
curl (run and get the verdict row)
curl -s -X POST "https://api.apify.com/v2/acts/apricot_blackberry~agent-output-gate/run-sync-get-dataset-items?token=$APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"text":"Contact me at a@b.com http://example.com/definitely-404","checkLinks":true}'
JavaScript (apify-client)
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('apricot_blackberry/agent-output-gate').call({text: draft,sourceUrls: ['https://docs.example.com/pricing'],checkLinks: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();if (!items[0].pass) throw new Error(`Draft failed gate: ${items[0].flagCount} flag(s)`);
Python (apify-client)
from apify_client import ApifyClientclient = ApifyClient(token)run = client.actor("apricot_blackberry/agent-output-gate").call(run_input={"text": draft,"sourceUrls": ["https://docs.example.com/pricing"],"checkLinks": True,})row = next(client.dataset(run["defaultDatasetId"]).iterate_items())if not row["pass"]:raise RuntimeError(f"Draft failed gate: {row['flagCount']} flag(s)")
Pricing
Pay-per-event. One actor-start fee per run, plus one check event per completed check. Failed runs are not billed for the check. Link/source-fetch proxy traffic, if used, is billed to your Apify account.
Notes
- Checks are deterministic and self-contained — no LLM, no data sent anywhere except the link/source fetches you enable.
- Claim-vs-source is a heuristic recall aid (numbers/quotes/named-entities), not a semantic fact-checker; treat
unsupported-claimflags as "verify this", not "definitely wrong".