Skip to content

Compare

Portkey PII redaction vs Maskflare: gateway features or privacy layer?

Maskflare EngineeringPublished 6 min read

Short answer

Portkey is a full LLM gateway, now owned by Palo Alto Networks, with routing, fallbacks, caching, observability and guardrails. Its PII guardrail replaces values with placeholders and is irreversible by design. Maskflare is a privacy layer that masks values reversibly and restores them in answers. You can run Maskflare alone or behind Portkey.

Most teams that look at Portkey want a gateway first: one API across providers, retries and fallbacks when OpenAI has a bad hour, caching, cost tracking and logs. PII redaction is one guardrail among many. Most teams that look at Maskflare start from the other end: they need personal data and secrets kept away from the provider, and the gateway is how that's enforced. Maskflare wrote this page.

What is Portkey?

Portkey is an AI gateway. Its configs cover caching, retries, fallbacks, timeouts and load balancing across providers, with logs that show requests and guardrail verdicts. Palo Alto Networks announced it would acquire Portkey on 30 April 2026 and completed the deal on 29 May 2026; Portkey is becoming the AI gateway inside Palo Alto's Prisma AIRS platform, and the companies say existing customers will keep being supported.

Portkey's guardrails include 20+ deterministic checks (regex, JSON schema, contains-code), LLM-based checks such as gibberish and prompt-injection detection, and partner guardrails you enable with your own API keys. A check can run before the request or on the output, log only (status 246) or deny (status 446), and trigger a fallback to another model.

How does Portkey's PII redaction work?

Per Portkey's PII redaction docs, you create a PII guardrail and turn on Redact PII. The built-in detector covers phone numbers, email addresses, location information, IP addresses, Social Security numbers, names and credit card details; regex rules handle anything else, such as employee IDs. Detected values are replaced with numbered placeholders, so a second email becomes {{EMAIL_ADDRESS_2}}, and the redacted request goes to the model. Partner providers listed for PII include Patronus AI, Pangea, AWS Bedrock Guardrails and Promptfoo.

The key line in the docs: redaction is irreversible by design and the transformation is one-way. The original values are not put back into the response.

When is Portkey the better choice?

  • You need a full LLM gateway. Routing, fallbacks, load balancing, caching, budgets and observability are Portkey's core. Maskflare doesn't do semantic caching or model fallbacks.
  • One-way redaction is what you want. For analytics, classification or evaluation prompts where the model never needs the real value, irreversible placeholders are simpler and arguably safer.
  • You want many guardrails in one place. Injection checks, schema validation and partner guardrails all run in the same pipeline.
  • You're buying into Prisma AIRS. If Palo Alto Networks is your security platform, Portkey now fits inside it.

When is Maskflare the better choice?

  • The answer has to contain the real data. A support reply to Ada Lovelace, a filled-in form, a summary that names the account holder. Maskflare restores values where the answer repeats them, including mid-stream, so users never see placeholders.
  • Detection beyond US basics. 574 detectors in 53 packs: 47 country packs with checksum validation, 232 credential formats, 21 healthcare detectors, and Exact Data Match against your own customer records.
  • RAG and embeddings. Deterministic tokens keep search and joins working on masked data.
  • People and agents, not just apps. Desktop agent, browser protection, MCP tool-call masking and coding-agent hooks share the same policy as the gateway.
  • Compliance evidence. One-click profiles (HIPAA Safe Harbor, GDPR, UK GDPR, PCI DSS v4.0, US PII) and an exportable coverage report.
  • EU hosting. EU-hosted by default; on-premises for enterprise. Prompts and responses are never logged or stored.

Portkey vs Maskflare, feature by feature

Portkey details from portkey.ai/docs as of October 2026.
PortkeyMaskflare
What it isFull LLM gateway with guardrailsPrivacy layer: gateway, SDKs, endpoint agents, MCP
Routing, fallbacks, load balancing, cachingYesNo
PII actionOne-way placeholders like {{EMAIL_ADDRESS_2}}Reversible tokens, or redact, partial, hash, FPE, alert, block
Restore values in the answerNo (irreversible by design)Yes, including while streaming
Built-in PII coveragePhone, email, location, IP, SSN, names, credit cards; regex47 country packs, 232 credential formats, PHI, EDM
Other guardrails (injection, schema)YesNo injection detection
Employees and coding agentsNoYes
OwnerPalo Alto Networks (since May 2026)Independent

How do you run Maskflare behind Portkey?

Keep Portkey for routing and observability, and make Maskflare the upstream it calls. Portkey supports a custom host per target; set it to your Maskflare gateway route and use your Maskflare key as the provider key:

Portkey config (sketch)
{
  "strategy": { "mode": "fallback" },
  "targets": [
    { "provider": "openai", "custom_host": "https://<your-gateway>/v1/openai", "api_key": "mf_live_..." },
    { "provider": "anthropic", "custom_host": "https://<your-gateway>/v1/anthropic", "api_key": "mf_live_..." }
  ]
}

Two things to check. Turn off Portkey's PII redaction on these routes, or the values will be gone before Maskflare can tokenize and restore them. And Portkey's logs will show what Maskflare returned to it, which means restored values; if your logging policy forbids that, mask in your app with the SDK before Portkey and unmask after. On Portkey SaaS, custom hosts must be publicly reachable.

The honest objections

“We'd rather have one gateway.” Reasonable. If you mainly need routing and one-way redaction, Portkey alone is fine. If you mainly need masking and restore, Maskflare's gateway alone covers nine providers without Portkey.

“Portkey's regex guardrail covers our custom IDs.” It can match them. Maskflare adds dictionaries, allowlists and Exact Data Match: you upload keyed hashes of your own customer records (up to 10 datasets, clear values never leave your environment), and any exact occurrence is caught even when it doesn't follow a pattern. Rule changes can require a second approver, which is often what auditors ask about first.

“Irreversible is safer.” For the provider, both are equally blind: it sees placeholders or tokens either way. The difference is on your side, where Maskflare keeps originals encrypted for 30 days so the answer can be restored.

“What does the acquisition change?” For Portkey users, a roadmap now set inside Palo Alto Networks. For this comparison, nothing yet. Check Portkey's current docs before deciding.

Placeholders vs reversible tokens, side by side

A CRM assistant gets: “Email Ada Lovelace at ada@example.com and Charles Babbage at charles@example.com to confirm Tuesday's meeting.”

StepPortkey PII redactionMaskflare
Sent to the model“Email {{NAME_1}} at {{EMAIL_ADDRESS_1}} and {{NAME_2}} at {{EMAIL_ADDRESS_2}}…”“Email mf_mask_… at mf_mask_… and mf_mask_… at mf_mask_…”
Model's draft“Hi {{NAME_1}}, …”“Hi mf_mask_…, …”
What your app receivesThe draft with placeholdersThe draft with Ada's and Charles's real names
Can you send the email?Only after your code maps placeholders back, which it can't, because the mapping isn't returnedYes

Placeholder names in the table follow the numbered pattern in Portkey's docs; exact labels depend on the detector. The point stands either way: one-way redaction is the right tool when the model never needs to address a real person, and the wrong one when it does.

Streaming adds a wrinkle. A token can arrive split across two server-sent events, half in one chunk and half in the next. Maskflare's gateway restores values while the stream is still flowing, so your UI renders real names as they arrive. If you build restore logic yourself around a one-way gateway, this is the case to test first, along with tool-call arguments, which carry personal data more often than people expect.

What Maskflare doesn't do

  • No routing, fallbacks, load balancing, caching or budget controls.
  • No schema or gibberish checks.
  • Names are found by word lists, context and a local named-entity layer.
  • SOC 2 Type II and ISO 27001 audits are in progress.

Frequently asked questions

Can Portkey restore redacted PII in the response?

No. Portkey's docs describe its PII redaction as irreversible by design. Values are replaced with numbered placeholders and not put back.

Did Palo Alto Networks buy Portkey?

Yes. It announced the acquisition on 30 April 2026 and completed it on 29 May 2026. Portkey is being integrated into Prisma AIRS.

Can Maskflare replace Portkey entirely?

Only if you don't need routing, fallbacks, caching or broad observability. Maskflare's gateway covers nine providers with masking and restore, but it isn't a general-purpose LLM gateway.

Will Portkey's logs contain the real values if I put Maskflare behind it?

If restore is on, Portkey receives restored answers, so yes. If your logging policy forbids that, mask in your app with the Maskflare SDK before calling Portkey and unmask after the reply.

Does Maskflare work with LiteLLM too?

Yes. The maskflare[litellm] extra ships a guardrail class for the LiteLLM proxy, so you can keep LiteLLM as your gateway.

About the author

Maskflare Engineering

Guides from the engineers who build Maskflare's gateway, detection engine, desktop agent and SDKs. Every code sample is run against the product before it's published, and every limit we mention is one we hit ourselves.

Keep reading

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.