PII and secret redaction for Python AI agents.

Local, dependency-free middleware for LLM prompts, tools, MCP, memory, logs, and traces.

See exactly what the model receives

from pyveil import Channel, Veil

veil = Veil.high(
    secret=b"tenant-secret",
    scope="tenant/session",
)

safe = veil.redact_data(
    messages,
    channel=Channel.PROMPT_INPUT,
)

response = call_llm(safe.data)
Email alice@example.com
API key sk-proj-...

-> pyveil

Email [EMAIL:a3d2b564c825]
API key [API_KEY:38ded98a17e7]

Recipes people actually need

Guides for the question you are solving

Demo

The package keeps core behavior local, deterministic, and small: no network calls, no unmasking API, no third-party core dependency.

pyveil redacts synthetic sensitive context before agent boundaries