Skip to main content

Privyx logo

Privyx

Keep secrets and personal data out of LLM prompts.

PyPI Python versions CI Docker pulls License

Documentation · Quickstart · Tutorials · Integrations

Privyx is a proxy between your tools and an AI provider. It replaces the API keys, passwords, email addresses, and other sensitive values it detects in a request with placeholders, and puts the originals back into the reply. The only thing that changes in your client is its base URL.

A terminal: privyx mask replaces a secret key and an email address in a prompt with tokens, and privyx unmask puts the email address back into the model's reply.

Quick start

Privyx needs Python 3.12 or newer.

pip install privyx

With a coding agent. privyx run starts a proxy, launches the tool through it, and stops the proxy when the tool exits:

privyx run claude        # Claude Code; also: codex, aider, pi

With an application or any other client. Start the proxy, then change the client's base URL. The client keeps its own API key, which Privyx relays:

privyx proxy --upstream https://api.openai.com
export OPENAI_BASE_URL=http://localhost:8000/v1

For Anthropic: --upstream https://api.anthropic.com and ANTHROPIC_BASE_URL=http://localhost:8000.

Without installing. See what would be masked in a text. Nothing is sent anywhere:

$ uvx privyx detect --transform "DB_PASSWORD=hunter2 deploy to 10.0.4.17, cc dana@acme.example"
    12:19    SECRET            'hunter2'
    30:39    IP_ADDRESS        '10.0.4.17'
    44:61    EMAIL             'dana@acme.example'

DB_PASSWORD=<PRIVYX_SECRET_1> deploy to <PRIVYX_IP_ADDRESS_2>, cc <PRIVYX_EMAIL_3>

The Quickstart walks through each of these, and there is a Docker image: ohp1x/privyx.

How it works

Your tool sends a request holding an email address and a password. Privyx forwards it with a placeholder in place of each and keeps the mapping in its session vault. The provider answers using the placeholder, and your tool gets the reply with the address back in it.

The model works with <PRIVYX_EMAIL_1>: it can reason about it, repeat it, and hand it to a tool. The mapping back to the real value stays with Privyx. More in How it works.

Who it is for

  • You use a coding agent. Claude Code, Codex, or aider reads your .env, your logs, and your git history, and sends them to a provider. Coding agents
  • You build an application. Your prompts carry your users' data. Keep it out of them with the OpenAI or Anthropic SDK, LangChain, LlamaIndex, LiteLLM, or the Vercel AI SDK. An app on the OpenAI or Anthropic SDK
  • You run a gateway for a team. One proxy for everyone, with a shared vault, TLS, and an audit trail. A shared gateway for a team
  • You want to mask files. Logs, JSON, and datasets, in a script or in CI, without a proxy. Files and logs in a pipeline

What it does

  • Masks secrets and personal data. Built-in patterns cover email addresses, phone numbers, card numbers, IP addresses, API keys, tokens, private keys, and passwords. Add your own word lists and patterns, or a detector that understands names: Presidio or an LLM.
  • Restores the reply. In batch and streaming responses, in reasoning text, and in tool-call arguments, so your tools receive real values.
  • Drops in. It speaks OpenAI Chat Completions and Responses and Anthropic Messages, so SDKs, frameworks, and coding tools only need a base URL.
  • Keeps sessions your way. One mapping per request, per client, or per conversation, in memory, SQLite, or Redis.
  • Shows what it did. A PII-safe audit trail and Prometheus metrics count what was masked, without recording any of it.
  • Fails closed. A request it cannot mask is not forwarded.
  • Extends. Plugins add detectors, operators, policies, vaults, and providers.

What it does not do

Privyx reduces what a provider sees. It does not make a prompt safe by itself:

  • Names, organizations, and project terms are only masked once you configure a word list or a detector for them.
  • Only chat requests are masked. Other API paths, such as embeddings, are forwarded as the client sent them, unless you tell Privyx to refuse them.
  • Images, audio, and other binary content are not inspected.
  • The proxy has no authentication of its own. Keep it on 127.0.0.1, or put something in front of it that authenticates callers.

Limitations has the full list, and the threat model says what Privyx protects against.

Documentation

The documentation is at ohp1x.github.io/privyx:

Its source is in docs/.

Project

Privyx is in its 0.1.x series; the changelog lists what each release changed.

License

MIT

Metadata

Release files for privyx 0.1.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for privyx 0.1.27
File Size Uploaded Provenance Actions
privyx-0.1.27.tar.gz 1.5 MB With provenance Details for privyx-0.1.27.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for privyx 0.1.27
File Interpreter ABI Platform Actions
privyx-0.1.27-py3-none-any.whl Python 3 none any Details for privyx-0.1.27-py3-none-any.whl

Total release size: 1.7 MB

Release files / privyx-0.1.27.tar.gz

Download URL privyx-0.1.27.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f141e6582084eaae146f6b9f3aebd69c4792043357cd43ff6ed84a4b74352d02
BLAKE2b-256 checksum
How to use checksums
c5d65921f36d481b55660ef6cb8b1196ebd44eb50787edfece777ad06cbd2a1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / privyx-0.1.27-py3-none-any.whl

Download URL privyx-0.1.27-py3-none-any.whl
Size 228.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36b67c3f98d974f9a3647aeb29b016c6771f987403f340903e71f3462b3c836a
BLAKE2b-256 checksum
How to use checksums
bcc94483b40082c6c36ef0ecdf49fd1c5a5854ee6e38bce32d04faee64c3a6d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for privyx 0.1.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for privyx-0.1.27.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.27 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page