Skip to main content

piighost

English | Français

CI codecov PyPI version Python versions License: MIT Security: bandit Discord

piighost replaces personal data with placeholders before the LLM sees it, then restores the real values in the reply and in tool calls. This Python library de-identifies confidential data, meaning personal data (PII) and secrets, through a reversible pseudonymization often called anonymization. LangChain, Pydantic AI, LlamaIndex and Claude Code integrations are provided, together with an OpenAI and Anthropic API connector.

This de-identification spots confidential data with pluggable detectors (regex, NER, LLM) and replaces each value with a placeholder, the token that takes its place. For example:

  • John Doe becomes <<PERSON:1>>
  • john.doe@example.com becomes <<EMAIL:1>>

This placeholder stays the same from one message to the next with the conversational pipeline, which keeps the mapping between a value and its placeholder across the whole conversation. If john.doe@example.com reappears three messages later, the placeholder is still <<EMAIL:1>>, which lets the LLM follow the thread.

The LLM therefore only receives de-identified text. When it returns placeholders, for example by answering Hello <<PERSON:1>>, piighost replaces them with the real values. The user sees John Doe and never sees the de-identification.

The same mechanism protects agents that call tools. With the LangChain middleware, a tool that needs the real email address receives it in clear, while the LLM that supplies it only writes <<EMAIL:1>>.

A user chats with an agent, confidential values are replaced by placeholders before reaching the LLM and restored afterwards for the user and for tool calls.

The LLM only sees placeholders. The tool receives the real address, the user gets a clear-text reply, and your agent code stays the same.

Quickstart

pip install piighost   # or: uv add piighost

ExactMatchDetector de-identifies a dictionary of known values, with no model to download.

import asyncio

from piighost.components.detector import ExactMatchDetector
from piighost.pipeline import AnonymizationPipeline

detector = ExactMatchDetector({"John Doe": "PERSON", "john.doe@example.com": "EMAIL"})
pipeline = AnonymizationPipeline(detector)

result = asyncio.run(pipeline.anonymize("Write to John Doe at john.doe@example.com."))
print(result.text)  # Write to <<PERSON:1>> at <<EMAIL:1>>.

The Quickstart goes on with a real detector and a conversation.

Go further

Ecosystem

  • piighost.dev: the project website, with the ecosystem and its philosophy
  • piighost catalog: reviewed regex groups and ready-made pipeline configurations, pulled by reference
  • piighost-api: a server hosting one pipeline behind HTTP, with OpenAI- and Anthropic-compatible proxies
  • piighost-chat: an example chat interface with human-in-the-loop
  • caviardage: a browser app that redacts a Word deed, with piighost running in Pyodide. Nothing of the document leaves the tab

Project

If piighost is useful to you, a star on GitHub helps other developers find it.

Metadata

Release files for piighost 2.2.0

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

Source distribution (sdist)

Source distribution for piighost 2.2.0
File Size Uploaded Provenance Actions
piighost-2.2.0.tar.gz 138.1 kB Without provenance Details for piighost-2.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 324.6 kB

Release files / piighost-2.2.0.tar.gz

Download URL piighost-2.2.0.tar.gz
Size 138.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4d59e023803a82b950a55e0610eddab98d6cab6e3b5e5e8269563db3e171401c
BLAKE2b-256 checksum
How to use checksums
c15c863ea5721dcd49a7801852e028e2fccc0b5a975ca0e05272f5bf996fe433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / piighost-2.2.0-py3-none-any.whl

Download URL piighost-2.2.0-py3-none-any.whl
Size 186.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11566bb3caeba08477667694162a672462883c0e4604e243b61f6d28c1d12149
BLAKE2b-256 checksum
How to use checksums
db49f256e579448f67b24f7f710ab9c32ea38e0dc4018639b411103e04709ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for piighost 2.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

2.2.0 This release

2 release files No 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