Skip to main content Switch to mobile version Pre-release This release is a pre-release and may not be stable for production use.
OPP Engine, the reference engine of the privacy context layer for AI: generate Open Privacy Protocol privacy models from any data source and answer agents' checks with decisions over HTTP and MCP
pip install open-privacy-protocol-engine==0.2.0a4 Copy PIP instructions
The privacy context layer for AI
Documentation · Quick start · Connect agents · Detectors · Specification
openprivacyprotocol.com · Step-by-step guide | OPP Spec · OPP Engine · OPP Model · OPP for Python · OPP for JavaScript
OPP Engine is the reference toolkit of the Open Privacy Protocol, the privacy context layer for AI. It connects to an organization's databases, files, documents and web pages, writes a draft privacy model describing what in them is private or confidential, and serves that model to agents so they can check content before they share it. Since OPP 0.2 a check also knows how the destination will process the content (an ordinary API, a confidential enclave, encrypted inference, a local model), and answers with a decision that names the obligations the sender must fulfil.
databases, files, opp-engine scan acme.opp.yaml opp-engine serve agents documents, web pages ───────────────────────► (review, certify) ──────────────────────► (MCP / HTTP) Everything runs on your own infrastructure. No data value is ever written into the model, the review report or the logs.
OPP Engine is the tool you run in every step below. Follow the step-by-step guide; each step ends with a check that it worked.
New to the ideas? Read Core concepts. Want a five-minute try on example data first? See Get started.
opp-engine scan postgres://reader@db.internal/crm # asks for the password, hidden; it is not stored opp-engine scan env:CRM_URL # or take the whole URL from an environment variable Use a read-only database account. Connection strings are never written into the model; only the host and database name are kept. scan reads with the rule detectors and OPP Model, which is downloaded from Hugging Face once, verified, and then used from the local cache (opp-engine model info shows where). The model records which detectors read it under provenance.notes.
To work with a Hub, enroll the machine once with the link the Hub shows, then sync whenever the model is ready:
opp-engine enroll https://hub.example/connect/hub_model_... # once; the link works one time opp-engine scan postgres://reader@db.internal/crm # no --org needed: the Hub says whose model it is opp-engine sync # sends the model as the Hub's draft enroll trades the link for this machine's own credential, kept in ~/.config/opp-engine/hub.json (readable by you only). It can send privacy model drafts and nothing else, and an admin can remove the machine on the Hub. sync does not overwrite a draft someone edited on the Hub since your last sync unless you add --force. opp-engine enroll without a link shows the enrollment and opp-engine unenroll ends it. For CI, opp-engine send LINK and scan SOURCE --hub LINK still send with a one-day link and keep nothing on the machine.
opp-engine generate SOURCE... --name N --org O -o FILE still writes a whole model from the sources named in one go, for scripts that rebuild it from scratch.
Connect an agent over MCP
{ "mcpServers": { "opp": { "command": "opp-engine", "args": ["serve", "/path/to/acme.opp.yaml", "--mcp"] } } } Then tell the agent: "Before sending data outside the system it came from, call check. Send safe_content instead of the original. If the verdict is block or review, do not send." See docs/agents.md for the REST API and tool reference.
docker build -t opp-engine . docker run --rm -p 8765:8765 -v "$PWD/acme.opp.yaml:/model.opp.yaml" -e OPP_TOKEN=change-me opp-engine Protection-aware checks (OPP 0.2)
Give the engine a destination registry and it resolves the service and its mode itself. A caller names a registry id and a mode; it cannot describe a mode or grant itself a purpose.
opp-engine serve acme.opp.yaml --http 127.0.0.1:8765 \ --destinations acme.destinations.yaml --allow-purpose medical_analysis --decision-log decisions.jsonl curl -s localhost:8765/v1/check -H "Authorization: Bearer $OPP_TOKEN" -H "Content-Type: application/json" -d '{ "content": "Summarise the oncology file.", "destination": "hosted-llm", "mode": "confidential", "purpose": "medical_analysis", "obligations_supported": true}' The answer keeps verdict, findings and safe_content, and adds decision: an id and expiry, the destination, mode, mechanism and assurance that were used, whether the purpose was authorised, digests of the privacy model, the registry and the checked content, the rules that applied, the obligations, and the detectors that looked at the content.
Obligations are part of the answer. allow with enforce_mode means "only through this mode". A caller that does not send obligations_supported: true gets review instead of a conditional allow.
Check the output too. An answer that came back over an encrypted route is plaintext again. Check it against where it goes next ("stage": "output", or "tool_call" for an agent's next call).
Evidence expires. A mode whose approval or attestation has expired no longer satisfies a rule.
The decision log holds no content. One JSON line per decision with counts per class, no values and no offsets.
The engine decides. Something else has to enforce: a gateway, a proxy or the application that sends the content. A check that an agent may skip is advice.
serve --http refuses a non-loopback address without a bearer token (OPP_TOKEN) unless --insecure.
serve --mcp streamable-http|sse has no caller authentication; it needs --insecure and belongs behind an authenticating proxy. --mcp (stdio) is unaffected.
The HTTP access log is off, and POST /v1/explain keeps the value you ask about out of the URL.
A purpose is authorised per engine instance (--allow-purpose). Per-caller identities are not implemented yet; run one instance per trust domain.
Connecting data sources: SQL and NoSQL databases, files, folders and web pages, with install and URL examples
Connecting agents: MCP tools, REST endpoints, system-prompt guidance
Detectors and OPP Model: built-in rules, custom detectors, the open-weight model
OPP specification: the document kinds this engine reads and writes
0.1.0.dev0, tracking OPP 0.1.0.dev0. Interfaces may change before 0.1.0.
One project, five repositories
Open Privacy Protocol is developed as a set of repositories that version together. This repository implements the standard: it reads and writes the documents defined in the spec, and uses the model as an optional detector.
your sources ──► OPP Engine ──► acme.opp.yaml ──► OPP Engine ──► any agent generate (OPP Spec) serve MCP / HTTP ▲ ▲ └────────── OPP Model ──────────┘ Website and documentation: openprivacyprotocol.com
Contributions are welcome: connectors, detectors, tests and documentation. Read CONTRIBUTING.md, report security problems as described in SECURITY.md, and follow the Code of Conduct.
Licensed under the Apache License, Version 2.0. Part of the Open Privacy Protocol project.
Released: Dec 5, 2026
Author: The Open Privacy Protocol Authors
Both files in this release have provenance metadata.
View provenance details
Apache-2.0 View SPDX License List
all documents mcp model mongodb mysql parquet postgres server test
ai-agents ai-privacy confidential-ai data-classification gdpr llm mcp open-privacy-protocol pii pii-redaction privacy privacy-context
Development Status 3 - Alpha
Intended Audience Developers
Programming Language Python :: 3
Release files for open-privacy-protocol-engine 0.2.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 1.1 MB
Release files / open_privacy_protocol_engine-0.2.0a4.tar.gz
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 Dec 5, 2026.
Security for open-privacy-protocol-engine 0.2.0a4
Both files in this release have been uploaded with provenance metadata.
With provenance open_privacy_protocol_engine-0.2.0a4.tar.gz Dec 5, 2026
Attestation for open_privacy_protocol_engine-0.2.0a4.tar.gz
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
Dec 5, 2026 2 release files Full provenance
0.2.0a4 This release
Dec 4, 2026 2 release files Full provenance
Nov 30, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 4d99e05











