Skip to main content

AVA - AI Visibility Anonymizer Protocol

Reason this release was yanked:

cleanup

Project description

AVA Protocol ๐Ÿ›ก๏ธ

AI Visibility Anonymizer Protocol โ€” A protocol-first approach to privacy-preserving AI interactions.

Authors

Date

  • 3/13/2026

PyPI version Python 3.9+ License: MIT

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      AVA LAYER                          โ”‚
โ”‚         (AI Visibility Anonymizer Protocol)             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  INGEST โ†’ DETECT โ†’ CLASSIFY โ†’ TRANSFORM โ†’ AUDIT โ†’ AI   โ”‚
โ”‚    โ†‘                                              โ†“     โ”‚
โ”‚  Original Data                            Clean Responseโ”‚
โ”‚    โ†‘                                              โ†“     โ”‚
โ”‚  RESTORE โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ† โ†    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ What is AVA?

AVA is an open protocol and Python library for anonymizing sensitive data before sending it to AI/LLM services, with complete audit trails and reversible tokenization.

Core Principles

Principle Description
Visibility Complete audit trail of what was sanitized and why
Reversibility Secure token vault for restoring original data in responses
Interoperability Works with any AI provider (OpenAI, Anthropic, local models)
Configurability Policy-driven sensitivity levels per use case
Engine Agnostic Pluggable detection engines (Presidio, AWS Macie, etc.)

๐Ÿš€ Quick Start

Installation

# Core library only (gateway mode)
pip install ava-protocol

# With local detection engine (Presidio)
pip install ava-protocol[local]

# With all optional dependencies
pip install ava-protocol[all]

Basic Usage

import ava
import openai

# Initialize client (local Presidio engine)
client = ava.Client(
    engine="presidio",
    policy="healthcare_strict",
    retention=3600  # Token expiry in seconds
)

# Sanitize โ†’ AI โ†’ Restore
with client.session(reversibility=True) as session:
    # 1. Sanitize PII before sending to AI
    clean_prompt = session.sanitize(
        "Patient John Doe (john.doe@email.com) needs prescription refill"
    )
    # Result: "Patient AVA_PERS_7a3f9k2m (AVA_EMAI_x8n4p5qv) needs prescription refill"

    # 2. Send to AI (AI never sees original PII)
    response = openai.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": clean_prompt}]
    )
    ai_output = response.choices[0].message.content

    # 3. Restore original values in AI response
    original_response = session.restore(ai_output)
    # Result: "John Doe should contact john.doe@email.com..."

Gateway Mode (Enterprise)

import ava

# Connect to centralized AVA Gateway
client = ava.GatewayClient(
    url="https://ava.internal.company.com",
    api_key="your-api-key",
    policy="finance_strict"
)

with client.session() as session:
    clean = session.sanitize("Invoice to Acme Corp...")
    # ... AI call ...
    original = session.restore(ai_response)

๐Ÿ“‹ Supported Entity Types

Category Entities Example
Identity PERSON_NAME, USERNAME "John Doe" โ†’ AVA_PERS_7a3f9k2m
Contact EMAIL_ADDRESS, PHONE_NUMBER "john@email.com" โ†’ AVA_EMAI_x8n4p5qv
Financial CREDIT_CARD, BANK_ACCOUNT, SSN "123-45-6789" โ†’ AVA_SSN_3x8k9n4p
Location LOCATION, IP_ADDRESS "192.168.1.1" โ†’ AVA_IPAD_q2m7n5vx
Medical MEDICAL_LICENSE, DIAGNOSIS Condition-specific detection

๐Ÿ”ง Configuration

Environment Variables

export AVA_MODE=embedded              # or "gateway"
export AVA_ENGINE=presidio
export AVA_POLICY=healthcare_strict
export AVA_RETENTION=3600
export AVA_GATEWAY_URL=https://ava.internal.company.com
export AVA_API_KEY=your-api-key

YAML Config

# ava-config.yaml
mode: embedded
engine: presidio
policy: finance_strict
retention: 7200

# Or gateway mode:
mode: gateway
url: https://ava-gateway.company.com
api_key: ${AVA_API_KEY}
import ava

config = ava.Config.from_yaml("ava-config.yaml")
client = ava.create_client(config)

๐Ÿ—๏ธ Architecture

Protocol-First Design

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         AVA PROTOCOL SPEC          โ”‚  โ† The standard (IETF-bound)
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    AVA Python Library (this repo)   โ”‚  โ† Reference implementation
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚    โ”‚  Presidio | AWS Macie   โ”‚      โ”‚  โ† Pluggable engines
โ”‚    โ”‚  | Azure PII | Custom   โ”‚      โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Manifest Format

Every transformation produces an AVA Manifest โ€” a complete audit record:

{
  "ava_version": "1.0",
  "manifest_id": "ava-a1b2c3d4-001",
  "timestamp": "2025-03-13T15:05:59Z",
  "policy": {
    "domain": "healthcare",
    "strictness": "strict",
    "reversibility": true
  },
  "entities": [
    {
      "type": "PERSON_NAME",
      "value_hash": "sha256:7f83b...",
      "position": [8, 16],
      "confidence": 0.98,
      "action": "pseudonymize",
      "token": "AVA_PERS_7a3f9k2m"
    }
  ]
}

๐Ÿ”Œ Pluggable Engines

Swap detection engines without changing your code:

Engine Installation Best For
Presidio (default) pip install ava-protocol[local] Self-hosted, free, customizable
AWS Macie pip install ava-protocol[aws] Enterprise, cloud-native
Mock (built-in) No install Testing, CI/CD
Custom Extend DetectionEngine Domain-specific needs

๐Ÿ“ฆ Project Structure

ava-protocol/
โ”œโ”€โ”€ src/ava/
โ”‚   โ”œโ”€โ”€ __init__.py           # Main exports
โ”‚   โ”œโ”€โ”€ client.py             # Client & GatewayClient
โ”‚   โ”œโ”€โ”€ session.py            # Transaction context
โ”‚   โ”œโ”€โ”€ config.py             # Configuration management
โ”‚   โ”œโ”€โ”€ protocol/             # Core protocol types
โ”‚   โ”‚   โ”œโ”€โ”€ manifest.py       # AVA Manifest
โ”‚   โ”‚   โ”œโ”€โ”€ entities.py       # DetectedEntity
โ”‚   โ”‚   โ””โ”€โ”€ token_vault.py    # Vault implementations
โ”‚   โ”œโ”€โ”€ engines/              # Detection engines
โ”‚   โ”‚   โ”œโ”€โ”€ base.py           # Abstract interface
โ”‚   โ”‚   โ””โ”€โ”€ presidio.py       # Presidio adapter
โ”‚   โ””โ”€โ”€ gateways/             # Remote gateway clients
โ”‚       โ””โ”€โ”€ http.py           # REST client
โ”œโ”€โ”€ tests/                    # Test suite
โ”œโ”€โ”€ pyproject.toml           # Package config
โ”œโ”€โ”€ README.md                # This file
โ””โ”€โ”€ PUBLISH.md               # PyPI release guide

๐Ÿงช Development

# Clone repo
git clone https://github.com/ava-protocol/ava-protocol.git
cd ava-protocol

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[all,dev]"

# Download Presidio models (if using local)
python -m spacy download en_core_web_lg

# Run tests
pytest

# Lint
black src/ava tests/
ruff check src/ava tests/

๐Ÿ›ก๏ธ Security Considerations

  • Zero-Retention Mode: Tokens auto-expire (default: 1 hour)
  • Vault Isolation: Session-scoped token storage
  • Audit Trail: Every transformation logged in manifest
  • Hash-Only Storage: Original values never in manifests (only tokens)

๐Ÿ“„ License

MIT License โ€” see LICENSE

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ”— Links


AVA: Making AI interactions private by default, visible by design.

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

ava_protocol-0.1.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

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

ava_protocol-0.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file ava_protocol-0.1.0.tar.gz.

File metadata

  • Download URL: ava_protocol-0.1.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for ava_protocol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 182e9bfed3fe47d7a0f22912dfaff616002ffed360ea8ece626782e6e4877777
MD5 73de7460cf2d1545d9b51ce1b3936881
BLAKE2b-256 c4c70832c523f1c7c9c07415ef0ed17f187a83ba72fe7ad10ff64b1f06aa9af5

See more details on using hashes here.

File details

Details for the file ava_protocol-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ava_protocol-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for ava_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4892b85e091fc7e4f417c2c5f5b98f14c16af90358cdaebdaa5a0607c3dea442
MD5 03b8e9de3564417bbe850cdb283efd0b
BLAKE2b-256 97cb016704efe9899ffd0856d05f6086df4c8975416fa26d58000372bfa446d0

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