Skip to main content

Enterprise AI privacy middleware — reversible PII anonymization.

Project description

Membrane

Zero-latency, reversible PII anonymization middleware for LLMs.

CI Status PyPI Version Downloads License: MIT


[!IMPORTANT] Membrane Enterprise
The open-source SDK is built for developers and rapid prototyping. For production deployments in highly-regulated environments requiring SOC2 compliance, AWS KMS / HashiCorp Vault integrations, centralized RBAC, and immutable Audit Logging, explore our Enterprise tier.
Request Enterprise Demo

Installation

pip install membrane-ai

Quick Start

Membrane intercepts your prompt, deterministically masks the PII locally, and seamlessly restores it from the LLM's response. It is specifically built to handle LLM paraphrasing.

from membrane import TrustLayer

layer = TrustLayer(provider="openai", api_key="sk-...")

# Membrane strips the PII, queries the LLM, and rehydrates the result automatically.
response = layer.call("My SSN is 123-45-6789. Send the report to john@example.com.")

print(response["final_response"]) 

Features Breakdown

Capability Open Source (Free) Enterprise
Core Anonymization Regex & Presidio NLP Advanced Custom NER Models
Provider Support OpenAI, Anthropic, Gemini, Ollama Bring-Your-Own-Model (VPC)
Key Management Environment Variables AWS KMS, Azure KeyVault, HashiCorp Vault
Audit Logging Local File-based Datadog, Splunk, Immutable S3 Export
Access Control N/A Granular RBAC, SSO/SAML
Scaling & State In-Memory (Single Node) Distributed Redis Architecture

Why Membrane?

  • Zero Trust Security: Sensitive data never leaves your infrastructure. Masking happens entirely locally before the outbound network request to external APIs (OpenAI/Anthropic) is even constructed.
  • Near-Zero Latency: Built for high-throughput streaming environments and rigorous production traffic without adding computational overhead.
  • Deterministic Context Preservation: We don't just crudely mask data; we maintain contextual entity trackers. Even when an LLM radically paraphrases a response, we still resolve the identity deterministically and mathematically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

membrane_ai-3.1.9.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

membrane_ai-3.1.9-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file membrane_ai-3.1.9.tar.gz.

File metadata

  • Download URL: membrane_ai-3.1.9.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for membrane_ai-3.1.9.tar.gz
Algorithm Hash digest
SHA256 d9a88ef1942b93e603e1e8004f9b35ce3d93a771fcee5235d8979044c67d4747
MD5 17d505d8a752584daff56b3d031df97a
BLAKE2b-256 b367e5ed18283efd828886e24a6cc4aa678b9cb355493096b067c8b3cb5d671b

See more details on using hashes here.

File details

Details for the file membrane_ai-3.1.9-py3-none-any.whl.

File metadata

  • Download URL: membrane_ai-3.1.9-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for membrane_ai-3.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 987791cfa2205940103a4ca71c696c13ac2bebbd8a0be3e8fe69727a3293215f
MD5 e870903ce67fcfcc0bdbcddeebd6c7dd
BLAKE2b-256 d069d6646ad0ca97abd772e6e8f56d5fddef7b061b0770d1de073c82a2ac43b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page