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 (179 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.0a2

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.0a2
File Size Uploaded Provenance Actions
open_privacy_protocol-0.1.0a2.tar.gz 37.1 kB With provenance Details for open_privacy_protocol-0.1.0a2.tar.gz

Built distribution (wheel)

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

Total release size: 75.1 kB

Release files / open_privacy_protocol-0.1.0a2.tar.gz

Download URL open_privacy_protocol-0.1.0a2.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f180c312f511ff8324b4cabad2271623ec01a2c1127a6735c92cadddde81cc1e
BLAKE2b-256 checksum
How to use checksums
d3216bea4b8cd5b2a4e4d9341c735fa87bdf8fd46dfc4fef8b5dff34b6af82dd
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.0a2-py3-none-any.whl

Download URL open_privacy_protocol-0.1.0a2-py3-none-any.whl
Size 38.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
870da095e2b802a0470ea3f88132a455c526234cc1ec754dd61bc04a65606c1e
BLAKE2b-256 checksum
How to use checksums
c606b7dfe13bfb9320284fdbbd4184f357cb61f5ccca82329ac2e914684cd7e2
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.0a2

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.0a2.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