# pyveil

> Local PII and secret redaction for Python LLM apps, AI agents, tool calls, MCP resources, logs, traces, and memory.

## Start Here

- [README](README.md)
- [Rendered guide hub](https://hyeonsangjeon.github.io/pyveil/guides/)
- [Python LLM PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/python-llm-pii-redaction.html)
- [MCP PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/mcp-pii-redaction.html)
- [pyveil vs Presidio / NER / DLP](https://hyeonsangjeon.github.io/pyveil/guides/pyveil-vs-presidio.html)
- [Reproducible detector evaluation](https://hyeonsangjeon.github.io/pyveil/evaluation.html)
- [Threat model](docs/threat-model.md)
- [FAQ](docs/faq.md)
- [Cookbook](docs/cookbook.md)
- [OpenAI Agents SDK vs LiteLLM boundary comparison](docs/integrations/openai-agents-vs-litellm.md)
- [OpenAI Agents SDK pre-dispatch wrapper](examples/openai_agents_guardrail.py)
- [LiteLLM SDK and Proxy boundary](examples/litellm_proxy_filter.py)
- [OpenAI integration](pyveil/integrations/openai.py)
- [OpenAI example](examples/openai.py)
- [OpenAI keyless and live guide](docs/integrations/openai.md)
- [Anthropic integration](pyveil/integrations/anthropic.py)
- [Anthropic example](examples/anthropic.py)
- [Anthropic keyless and live guide](docs/integrations/anthropic.md)
- [Ollama integration](pyveil/integrations/ollama.py)
- [Ollama example](examples/ollama.py)
- [Ollama setup and memory guide](docs/integrations/ollama.md)
- [Azure OpenAI integration](pyveil/integrations/azure_openai.py)
- [Azure OpenAI example](examples/azure_openai.py)
- [Redaction reference](docs/redaction-reference.md)
- [Known limitations](docs/known-limitations.md)
- [Compatibility contract](compatibility/README.md)
- [Detector provenance](docs/detector-provenance.md)
- [Roadmap](docs/roadmap.md)
- [Release checklist](docs/release-checklist.md)
- [MCP integration](docs/integrations/mcp.md)
- [Logging integration](docs/integrations/logging.md)
- [Tracing integration](docs/integrations/tracing.md)
- [Agent instructions](AGENTS.md)
- [Contributing](CONTRIBUTING.md)

## Rules for AI Coding Agents

- Use `Veil.redact_text` for strings.
- Use `Veil.redact_data` for dict, list, JSON, tool arguments, and MCP-like payloads.
- Use top-level `redact_text` and `redact_data` only with an explicit secret or `PYVEIL_SECRET`.
- Use `Channel` and `Entity` enums when writing policy examples.
- Use `CustomRule.exact(...)` for values the application already knows are
  sensitive and `CustomRule(...)` for narrow domain identifier regexes.
- Run `python evaluation/evaluate.py --check` before changing built-in detectors.
- Do not expose unmasking functions to a model-controlled tool.
- Do not claim pyveil guarantees compliance or perfect sensitive-data detection.
- Keep integrations thin and the core local.
- OpenAI and Anthropic SDK contract tests use local mock HTTP transports; they require no API keys or provider usage.
