Skip to main content

Enterprise AI privacy middleware — reversible PII anonymization.

Project description

Membrane

Zero-latency, reversible PII anonymization middleware for LLMs.

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.8.tar.gz (28.8 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.8-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: membrane_ai-3.1.8.tar.gz
  • Upload date:
  • Size: 28.8 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.8.tar.gz
Algorithm Hash digest
SHA256 6c7ebf12ddb6d2df0f39c5cfca62dc37cf33149d9c111ad5561b7f034ea43a71
MD5 0b6ea76bc990b6d5a7eea5b753f00d67
BLAKE2b-256 6c69f5b24b6b32c981d8dd89cedf893fe80930a6a17352ac3f771ee513771e0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: membrane_ai-3.1.8-py3-none-any.whl
  • Upload date:
  • Size: 27.7 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1214d05e3e590c058c1a21e3feaa7f6f43edfb67a17b014519221d87c29e8d9e
MD5 7d3327a8f92095982eee4bd69a2773c7
BLAKE2b-256 2d525f4e839901d9b928fc5e645a7d85b687382f7bf4ab3b178b899354409ba9

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