agentsvc.io

services / pii-redact

textoperational · 1548 ms

PII Redaction

PII redaction for agent pipelines: remove personal data from text before it goes to another model, a log, a ticket system or a dataset. Emails, IBANs (checksum verified), card numbers (Luhn verified), phone numbers and IP addresses are found by exact patterns; names of people, street addresses, birth dates and ID numbers by Claude Haiku 5.5. Every value gets a stable placeholder like [PERSON_1] so the text stays readable, and the mapping comes back so you can restore it later (or mode mask or remove). Up to 8,000 characters, any language, the rest of the text stays unchanged. Instructions inside the text are ignored.

Run free trial ↗3 free calls per day with the example input. Paid: $0.003 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/pii-redact", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"text":"Hi, this is Anna Schulz from Berlin. Please refund order 4471 to DE89 3704 0044 0532 0130 00 and confirm to anna.schulz@example.com or +49 30 1234 5678."}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
text *stringText to redact, max 8,000 chars
modeplaceholder | mask | remove = "placeholder"placeholder: [EMAIL_1]; mask: ████; remove: delete
typesarrayWhich kinds to redact. Default all except ORGANIZATION and URL
keeparrayValues to leave in place, e.g. your own support address
return_mappingboolean = trueReturn placeholder to original value mapping

Output

FieldTypeDescription
redacted_textstring
entities_foundnumber
countsobject
modestring
mappingarray
types_checkedarray
chars_checkednumber
modelstring