Skip to content

LLM Privacy Gateway

Parrier can run its full agent loop against a cloud model without sending target data to the model provider. The gateway is a per-run, in-memory, reversible tokenizer wired into the two boundaries the context crosses.

Terminal window
export PARRIER_PRIVACY=mask

Default is off. The setting accepts the standard off-words (off, 0, false, no, none, disabled).

operator ── real data ──▶ [ vault: tokenizes ] ── placeholders ──▶ LLM provider
│
▼ (rehydrate at dispatch, locally)
tools act on real data
│
▼ (re-mask output)
placeholders re-enter context
  1. Model in — every message content is masked before the request leaves the process: system prompt (including the target line), user instructions, conversation history, tool results. The provider only ever sees placeholders like DOMAIN_101, IP_101, EMAIL_101.
  2. Tool dispatch — when the model issues a tool call, its arguments are rehydrated locally just before execution, so tools act on real values. This also keeps reports real: record_finding receives rehydrated arguments, so the client-facing report contains actual hostnames and evidence.
  3. Tool out — results are re-masked before re-entering model context, so a value that escaped detection on the way out cannot survive the way back.
  • Deterministic: the same real value maps to the same placeholder for the whole run — multi-turn reasoning about one host stays coherent.
  • Reversible only in-process: the mapping lives in memory, per run. There is deliberately no tool that resolves a placeholder for the model.
  • Credentials are register-only: secrets are never regex-detected from free text (a reformatted secret is the one leak an output pass cannot catch). Nothing registers them automatically today; the recommended operator flow is to keep secrets in the workspace secrets inventory, which the gateway never needs to see.
  • Invented tokens pass through: if the model writes a token the vault never issued, it is executed verbatim (usually a harmless error) rather than resolved — restoration never guesses.
  • Shape-aware: version numbers (17.10.1) are not IPs; ANSI color codes are stripped before detection.
Token Detects Notes
EMAIL_nnn RFC-style emails
IP_nnn IPv4 literals version-number fragments excluded
DOMAIN_nnn common-TLD hostnames paths and ports stay visible
CRED_nnn nothing (register-only) explicit registration
USER_nnn nothing (register-only) explicit registration

The boundary is deliberately narrow: high-value, low-ambiguity categories. Tokenizing URLs or paths wholesale would blind the model to routes — exactly the reasoning a web assessment needs. Widen the boundary only with a measured quality regression.

  • Detection is regex-based. Encoded values (base64 bodies, double-URL-encoded fragments) are not caught on first sight; the re-mask on the way back keeps them from accumulating in context.
  • Placeholders preserve structure: the provider can see that a domain exists, request sizes, and timing. The gateway hides values, not traffic shape.
  • The vault is the run’s most sensitive artifact while it lives: it maps every placeholder to every real host, email, and registered secret the run touched. It is never written to disk and dies with the process.