Secure a customer support AI

Customer support tickets are dense with PII — emails, phone numbers, order references, sometimes payment data. Privian masks all of it before the LLM sees the ticket.

Pattern

  1. Your support app composes a prompt that includes the ticket body.
  2. The prompt is sent to the Privian gateway.
  3. Privian masks customer name, email, phone, and any payment data, then forwards to your chosen provider.
  4. The provider returns a draft reply with placeholders.
  5. Privian rehydrates the placeholders before returning the reply to your agents.

Example

ts
const prompt = `A customer wrote:
"Hi, I'm Jane Doe, my email is jane.doe@example.com and my order is #12345.
My card ending 4242 was charged twice."

Write a polite reply offering a refund.`;

const res = await fetch("https://api.privian.io/v1/gateway", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PRIVIAN_API_KEY!}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ prompt, model: "openai/gpt-5.5" }),
});

const { response, meta } = await res.json();
// meta.entitiesDetected reflects how many spans were masked.

What gets masked

  • The customer name (PERSON_1).
  • The email (EMAIL_1).
  • If a full PAN appears it is masked as CREDIT_CARD_1 (Luhn-validated). A bare last-4 like 4242 is not treated as a card number.

Operational notes

  • Do not include free-form medical or legal data — those domains are out of scope for the current beta.
  • Privian's meta block is safe to log on your side; the raw prompt should still be stored only where your own privacy posture allows.

Related