Installation¶
Privyx is a Python package with a command-line program, privyx. It needs
Python 3.12 or newer. A Docker image is published for every release.
Install¶
pip install privyx
On an older Python, pip stops with No matching distribution found for
privyx. Check with python --version.
uv tool install privyx # the `privyx` command, in its own environment
Or add it to a project: uv add privyx.
uvx privyx --version
uvx downloads Privyx into a
cache and runs it. Every privyx ... command you type in this
documentation works as uvx privyx .... What another program starts,
such as the git hooks of privyx hook install
or an MCP server in a client's config, needs privyx on the PATH:
install it with uv tool install privyx for those.
docker run --rm ohp1x/privyx --version
The image holds every extra below. See Docker.
This installs the proxy, the privacy engine, and the CLI.
Extras¶
Extras switch on optional components. Nothing below is needed for the default setup.
| Extra | Installs | Needed for |
|---|---|---|
sqlite |
aiosqlite | vault.type: sqlite |
redis |
redis | vault.type: redis |
presidio |
Presidio, spaCy | the presidio detector |
providers |
OpenAI and Anthropic SDKs | the llm detector |
faker |
Faker | the faker operator |
crypto |
cryptography | the encrypt operator |
keychain |
keyring | keychain:// secrets |
otel |
OpenTelemetry SDK, OTLP exporter | tracing |
Combine them as needed:
pip install 'privyx[sqlite,faker]'
uv tool install 'privyx[sqlite,faker]'
uvx --from 'privyx[sqlite,faker]' privyx --version
A setting that needs a missing extra fails at startup, with the install command in the message:
$ privyx -c sqlite.yaml proxy
Error: aiosqlite is required. Install with `pip install privyx[sqlite]`.
Plugin packages¶
A plugin package has to
be installed in the environment Privyx runs in, then named under
plugins.modules. Installing it alone loads nothing.
pip install privyx privyx-acme
uv tool install privyx --with privyx-acme
Build an image on top of Privyx's. Its environment has no pip, so the package goes in with uv:
FROM ohp1x/privyx:X.Y.Z
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
USER root
RUN uv pip install --python /app/.venv/bin/python privyx-acme
USER privyx
ENV PRIVYX_PLUGIN_MODULES=privyx_acme
privyx-acme and privyx_acme stand for the package's name and the module
it installs.
Check the installation¶
$ privyx --version
privyx, version X.Y.Z
$ privyx doctor
Privyx Doctor
=============
✓ plugins: no plugin paths configured
✓ anchor key: /home/alice/.privyx/anchor.key is created on first use
✓ detector: regex: 1 span(s) ['EMAIL']
✓ permissions: sensitive files owner-only (0600)
✓ vault: memory: round-trip ok
✓ provider: generic → http://localhost:20128
✓ proxy: request transformed, 1 mapping(s) vaulted
✓ streaming: pseudonym restored across a split chunk
...
✓ configuration: valid: detector=regex policy=default operator=pseudonym vault=memory anchor=hmac
X.Y.Z is your installed version; the doctor output above is abbreviated.
privyx doctor builds every configured component and pushes a sample request
through it, without calling a provider. Run it with -c your.yaml after
changing a config file.
Upgrade¶
pip install --upgrade privyx
uv tool upgrade privyx
uvx privyx@latest --version
docker pull ohp1x/privyx
The changelog lists what each release changed. See Upgrading for the version and deprecation policies, planned 0.2 defaults, and how to retain previous behavior.
Next steps¶
- Quickstart: mask a first request.
- How it works: what happens to a request, and the terms used in these pages.