Skip to main content
Pre-release

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

Open Privacy Protocol

OPP Engine

The privacy context layer for AI

License: Apache-2.0 OPP 0.2.0.dev0 MCP server Python 3.10+ Docker

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 generate       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.

Start here

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.

Step
1 Install
2 Connect your data
3 Generate the privacy model
4 Review and customize
5 Test decisions
6 Serve to agents over MCP
7 Deploy as a service

New to the ideas? Read Core concepts. Want a five-minute try on example data first? See Get started.

Features

Connect anything Any SQLAlchemy database URL (PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake, BigQuery and more with their drivers); MongoDB and MongoDB Atlas (mongodb://, mongodb+srv://, with the [mongodb] extra), nested fields included; CSV, TSV, JSON, JSON Lines and Parquet files; text, Markdown, HTML, PDF and Word documents; folders and web pages
Generate Every column is classified against the OPP baseline catalog from its name and sampled values; text columns and documents get topic classes (health data, HR matters, internal financials); ID columns get their format (CE-[0-9]{6}). Each entry carries its evidence and starts proposed
Better with OPP Model With the open-weight OPP Model (--opp-model), names, addresses and confidential topics are found in free text and headerless columns, and the organization's own concepts match by meaning
Industry presets --industry 622110 (a NAICS code) or --industry healthcare lists the classes that industry usually holds and were not found
Hygiene Cues, terms and identifier patterns that would match ordinary text are removed and reported
Human review A Markdown report lists what to check; certified entries survive the next run (--merge)
Serve The query engine answers check (verdict, findings, safe content), explain and list_classes over MCP or a REST API

Quick start

pip install "open-privacy-protocol-engine[server,mcp,documents]"

python tests/sample_data.py demo            # a synthetic CRM database, exports and documents
opp-engine generate sqlite:///demo/crm.db demo/exports demo/docs \
    --name acme --org "Acme Coaching (fictional)" -o acme.opp.yaml --report review.md

opp-engine check acme.opp.yaml --dest external_ai "Email jane@example.com about CE-123456"
opp-engine serve acme.opp.yaml --mcp                     # for any MCP client
opp-engine serve acme.opp.yaml --http 127.0.0.1:8765      # REST API

Use a read-only database account. Connection strings are never written into the model; only the host and database name are kept.

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

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.

Security defaults

  • 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.

Documentation

Status

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.

Part Repository What it is Docs
OPP Spec open-privacy-protocol The standard: specification, JSON Schemas, baseline catalog, industry presets, reference validator Docs
OPP Engine open-privacy-protocol-engine (this repository) Generates a privacy model from your sources and serves it to agents over MCP and HTTP Docs
OPP Model open-privacy-protocol-model Open-weight model that finds private values and confidential topics in text, on CPU Docs
OPP for Python opp-python pip install open-privacy-protocol: validate models, resolve rules, call the engine Docs
OPP for JavaScript opp-js npm install open-privacy-protocol: the same API for Node.js, Bun and Deno Docs
  your sources ──► OPP Engine ──► acme.opp.yaml ──► OPP Engine ──► any agent
                   generate       (OPP Spec)        serve          MCP / HTTP
                       ▲                               ▲
                       └────────── OPP Model ──────────┘

Website and documentation: openprivacyprotocol.com

Contributing

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.

License

Licensed under the Apache License, Version 2.0. Part of the Open Privacy Protocol project.

Metadata

Release files for open-privacy-protocol-engine 0.2.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-engine 0.2.0a1
File Size Uploaded Provenance Actions
open_privacy_protocol_engine-0.2.0a1.tar.gz 1.0 MB With provenance Details for open_privacy_protocol_engine-0.2.0a1.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / open_privacy_protocol_engine-0.2.0a1.tar.gz

Download URL open_privacy_protocol_engine-0.2.0a1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
c290ef29c5fb0fa43813b226cdebe4059da4e377e3a273a48be0c263b2d146f5
BLAKE2b-256 checksum
How to use checksums
99c6e34463f6bedea3fc02e5133b483f856a198aac3dbfa58995279d728a778b
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 Dec 4, 2026.

Transparency log

Release files / open_privacy_protocol_engine-0.2.0a1-py3-none-any.whl

Download URL open_privacy_protocol_engine-0.2.0a1-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2d35b43b2504c4009fe9c6140565cb98378acfa1dfb06a42a8179b3aa6d518d
BLAKE2b-256 checksum
How to use checksums
8161cb7adf257fef9ea4b7e1ab91caeb45d21b1bba5b839a0bbd4938d58db9ea
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 Dec 4, 2026.

Transparency log

Security for open-privacy-protocol-engine 0.2.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_engine-0.2.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 Dec 4, 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