Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Open Privacy Protocol

OPP for Python

PyPI License: Apache-2.0 Python 3.10+ Typed

openprivacyprotocol.com  |  Spec  ·  Engine  ·  Model  ·  Python  ·  JavaScript


The Python SDK for the Open Privacy Protocol (OPP), the open standard for describing what is private and confidential in any data. Use it to validate privacy models, decide what an agent may share with each destination (PII redaction, pseudonymization, blocking), and call an OPP Engine query server.

pip install open-privacy-protocol

Quick start

import opp

model = opp.Model("acme.opp.yaml")                  # validates against the bundled schemas and catalog
model.action("personal.email", "external_ai")      # 'pseudonymize'
model.action("special.health", "external_ai")      # 'block'
opp.strictest_action(["allow", "redact", "review"]) # 'review'
opp.preset_for_naics("622110")["id"]               # 'healthcare'
opp.validate("acme.opp.yaml")                      # [] when the document conforms
opp validate acme.opp.yaml       # validate any OPP document
opp classes --group special      # browse the baseline catalog

Ask OPP Engine before an agent shares

from opp.client import EngineClient

engine = EngineClient("http://127.0.0.1:8765", token="change-me")
result = engine.check("Email jane.doe@example.com about CE-204817", destination="external_ai")

if result["verdict"] in ("block", "review"):
    raise PermissionError(result["summary"])
send_to_llm(result["safe_content"] or original)   # pseudonymized when needed

Run the engine next to your agent with opp-engine serve acme.opp.yaml --http 127.0.0.1:8765.

What is included

opp.Model, opp.Catalog Load a privacy model or catalog, validate it, resolve every class and concept
Model.action(class, destination) The action for content of a class going to internal, partner, external_ai or public
opp.validate, opp.schema_errors Conformance checks, with every problem listed
opp.baseline(), opp.presets(), opp.preset_for_naics() The baseline catalog (33 classes) and 15 industry presets, bundled
opp.client.EngineClient check, explain, classes, model, health against OPP Engine, no extra dependencies
opp CLI opp validate, opp classes

The bundled schemas, catalog and presets come from the specification repository; opp.SPEC_VERSION names the version.

The Open Privacy Protocol project

Part Repository What it is
OPP Spec open-privacy-protocol Specification, JSON Schemas, baseline catalog, industry presets
OPP Engine open-privacy-protocol-engine Generates privacy models from your sources and serves them over MCP and HTTP
OPP Model open-privacy-protocol-model Open-weight detector for private values and confidential topics
OPP for Python opp-python (this repository) pip install open-privacy-protocol
OPP for JavaScript opp-js npm install open-privacy-protocol

Website and documentation: openprivacyprotocol.com

Development

pip install -e ".[test]" && pytest
python scripts/sync_spec.py ../open-privacy-protocol   # refresh the bundled spec files

Releases are published to PyPI from a v* tag by .github/workflows/release.yml.

License

Licensed under the Apache License, Version 2.0.

Metadata

Release files for open-privacy-protocol 0.1.0a1

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

Source distribution (sdist)

Source distribution for open-privacy-protocol 0.1.0a1
File Size Uploaded Provenance Actions
open_privacy_protocol-0.1.0a1.tar.gz 24.7 kB With provenance Details for open_privacy_protocol-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for open-privacy-protocol 0.1.0a1
File Interpreter ABI Platform Actions
open_privacy_protocol-0.1.0a1-py3-none-any.whl Python 3 none any Details for open_privacy_protocol-0.1.0a1-py3-none-any.whl

Total release size: 50.9 kB

Release files / open_privacy_protocol-0.1.0a1.tar.gz

Download URL open_privacy_protocol-0.1.0a1.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b6c4cb4d51d4b9b67c92a50d410422cd1ad96f23885397df6a868fff09d4a43a
BLAKE2b-256 checksum
How to use checksums
aa67d1987ac9f45d2bcb26481759003ae5a22d9409d6ac4d584f83b3d731d371
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 30, 2026.

Transparency log

Release files / open_privacy_protocol-0.1.0a1-py3-none-any.whl

Download URL open_privacy_protocol-0.1.0a1-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4179bdcb9a8a8cc598447613e79fd4050709c30f5df54acb1ccb8b9866554d6d
BLAKE2b-256 checksum
How to use checksums
f483cdedf7192f572d8d2a754c75b18a6b74a02a40a40e18a087fed0688b2800
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 30, 2026.

Transparency log

Security for open-privacy-protocol 0.1.0a1

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 open_privacy_protocol-0.1.0a1.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 30, 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.

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