Agent Output Gate - PII, Link & Hallucination Check avatar

Agent Output Gate - PII, Link & Hallucination Check

Pricing

Pay per event

Go to Apify Store
Agent Output Gate - PII, Link & Hallucination Check

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

Creator Fusion

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 hours ago

Last modified

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

  1. 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.
  2. Links — every URL in the draft is fetched (HEAD then GET, short timeout); anything dead or non-2xx/3xx is flagged.
  3. Claim-vs-source (only when sourceUrls given) — sentences containing specific numbers, quoted strings, or named entities that appear in none of your ground-truth sources are flagged as possible hallucinations.
  4. 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

FieldTypeRequiredDescription
textstringThe draft output to check.
sourceUrlsstring[]Ground-truth sources; enables claim-vs-source checking.
checkLinksbooleanFetch and validate links in the draft. Default true.
proxyConfigurationobjectFallback 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 ApifyClient
client = 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-claim flags as "verify this", not "definitely wrong".