pyveil 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. {pyveil-0.2.0 → pyveil-0.2.2}/AGENTS.md +6 -2
  2. {pyveil-0.2.0 → pyveil-0.2.2}/CHANGELOG.md +51 -0
  3. {pyveil-0.2.0 → pyveil-0.2.2}/CONTRIBUTING.md +7 -0
  4. {pyveil-0.2.0 → pyveil-0.2.2}/MANIFEST.in +5 -2
  5. {pyveil-0.2.0/pyveil.egg-info → pyveil-0.2.2}/PKG-INFO +107 -5
  6. pyveil-0.2.0/PKG-INFO → pyveil-0.2.2/README.md +90 -47
  7. {pyveil-0.2.0 → pyveil-0.2.2}/docs/README.md +7 -1
  8. {pyveil-0.2.0 → pyveil-0.2.2}/docs/cookbook.md +79 -22
  9. {pyveil-0.2.0 → pyveil-0.2.2}/docs/detector-provenance.md +5 -4
  10. pyveil-0.2.2/docs/evaluation.html +139 -0
  11. pyveil-0.2.2/docs/guides/index.html +100 -0
  12. pyveil-0.2.2/docs/guides/mcp-pii-redaction.html +182 -0
  13. pyveil-0.2.2/docs/guides/python-llm-pii-redaction.html +219 -0
  14. pyveil-0.2.2/docs/guides/pyveil-vs-presidio.html +159 -0
  15. pyveil-0.2.2/docs/guides/style.css +221 -0
  16. {pyveil-0.2.0 → pyveil-0.2.2}/docs/index.html +60 -6
  17. {pyveil-0.2.0 → pyveil-0.2.2}/docs/known-limitations.md +9 -1
  18. pyveil-0.2.2/docs/llms.txt +50 -0
  19. {pyveil-0.2.0 → pyveil-0.2.2}/docs/manual.html +93 -11
  20. pyveil-0.2.2/docs/media/favicon.svg +5 -0
  21. {pyveil-0.2.0 → pyveil-0.2.2}/docs/redaction-reference.md +5 -1
  22. {pyveil-0.2.0 → pyveil-0.2.2}/docs/release-checklist.md +6 -2
  23. {pyveil-0.2.0 → pyveil-0.2.2}/docs/roadmap.md +3 -1
  24. pyveil-0.2.2/docs/sitemap.xml +45 -0
  25. pyveil-0.2.2/evaluation/README.md +24 -0
  26. pyveil-0.2.2/evaluation/corpus.json +244 -0
  27. pyveil-0.2.2/evaluation/evaluate.py +141 -0
  28. pyveil-0.2.2/examples/azure_openai.env.example +6 -0
  29. pyveil-0.2.2/examples/azure_openai.example.yaml +10 -0
  30. pyveil-0.2.2/examples/azure_openai.py +10 -0
  31. {pyveil-0.2.0 → pyveil-0.2.2}/examples/fastapi_middleware.py +7 -2
  32. {pyveil-0.2.0 → pyveil-0.2.2}/llms.txt +8 -0
  33. {pyveil-0.2.0 → pyveil-0.2.2}/pyproject.toml +23 -1
  34. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/__init__.py +1 -1
  35. pyveil-0.2.2/pyveil/__main__.py +6 -0
  36. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/cli.py +5 -2
  37. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/detectors.py +32 -10
  38. pyveil-0.2.2/pyveil/integrations/azure_openai.py +293 -0
  39. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/masking.py +4 -2
  40. pyveil-0.2.0/README.md → pyveil-0.2.2/pyveil.egg-info/PKG-INFO +149 -3
  41. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil.egg-info/SOURCES.txt +17 -0
  42. pyveil-0.2.2/pyveil.egg-info/requires.txt +24 -0
  43. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil.yaml +3 -0
  44. pyveil-0.2.2/tests/test_azure_openai_example.py +151 -0
  45. {pyveil-0.2.0 → pyveil-0.2.2}/tests/test_cli.py +17 -1
  46. pyveil-0.2.2/tests/test_patterns.py +243 -0
  47. pyveil-0.2.0/docs/sitemap.xml +0 -15
  48. pyveil-0.2.0/pyveil.egg-info/requires.txt +0 -13
  49. pyveil-0.2.0/tests/test_patterns.py +0 -75
  50. {pyveil-0.2.0 → pyveil-0.2.2}/LICENSE +0 -0
  51. {pyveil-0.2.0 → pyveil-0.2.2}/SECURITY.md +0 -0
  52. {pyveil-0.2.0 → pyveil-0.2.2}/docs/faq.md +0 -0
  53. {pyveil-0.2.0 → pyveil-0.2.2}/docs/integrations/logging.md +0 -0
  54. {pyveil-0.2.0 → pyveil-0.2.2}/docs/integrations/mcp.md +0 -0
  55. {pyveil-0.2.0 → pyveil-0.2.2}/docs/integrations/tracing.md +0 -0
  56. {pyveil-0.2.0 → pyveil-0.2.2}/docs/media/pyveil-awesome-demo.gif +0 -0
  57. {pyveil-0.2.0 → pyveil-0.2.2}/docs/media/social-preview.html +0 -0
  58. {pyveil-0.2.0 → pyveil-0.2.2}/docs/media/social-preview.png +0 -0
  59. {pyveil-0.2.0 → pyveil-0.2.2}/docs/robots.txt +0 -0
  60. {pyveil-0.2.0 → pyveil-0.2.2}/docs/threat-model.md +0 -0
  61. {pyveil-0.2.0 → pyveil-0.2.2}/examples/basic_usage.py +0 -0
  62. {pyveil-0.2.0 → pyveil-0.2.2}/examples/custom_rules.py +0 -0
  63. {pyveil-0.2.0 → pyveil-0.2.2}/examples/litellm_proxy_filter.py +0 -0
  64. {pyveil-0.2.0 → pyveil-0.2.2}/examples/llm_client_boundary.py +0 -0
  65. {pyveil-0.2.0 → pyveil-0.2.2}/examples/log_filter.py +0 -0
  66. {pyveil-0.2.0 → pyveil-0.2.2}/examples/mcp_server_wrapper.py +0 -0
  67. {pyveil-0.2.0 → pyveil-0.2.2}/examples/mcp_tool_result.py +0 -0
  68. {pyveil-0.2.0 → pyveil-0.2.2}/examples/memory_write.py +0 -0
  69. {pyveil-0.2.0 → pyveil-0.2.2}/examples/openai_agents_guardrail.py +0 -0
  70. {pyveil-0.2.0 → pyveil-0.2.2}/examples/redact_json.py +0 -0
  71. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/constants.py +0 -0
  72. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/core.py +0 -0
  73. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/exceptions.py +0 -0
  74. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/findings.py +0 -0
  75. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/integrations/__init__.py +0 -0
  76. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/integrations/logging.py +0 -0
  77. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/integrations/mcp.py +0 -0
  78. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/levels.py +0 -0
  79. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/masker.py +0 -0
  80. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/patterns.py +0 -0
  81. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/placeholders.py +0 -0
  82. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/policy.py +0 -0
  83. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/py.typed +0 -0
  84. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/rules.py +0 -0
  85. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil/utils.py +0 -0
  86. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil.egg-info/dependency_links.txt +0 -0
  87. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil.egg-info/entry_points.txt +0 -0
  88. {pyveil-0.2.0 → pyveil-0.2.2}/pyveil.egg-info/top_level.txt +0 -0
  89. {pyveil-0.2.0 → pyveil-0.2.2}/setup.cfg +0 -0
  90. {pyveil-0.2.0 → pyveil-0.2.2}/setup.py +0 -0
  91. {pyveil-0.2.0 → pyveil-0.2.2}/tests/__init__.py +0 -0
  92. {pyveil-0.2.0 → pyveil-0.2.2}/tests/test_custom_rules.py +0 -0
  93. {pyveil-0.2.0 → pyveil-0.2.2}/tests/test_masker.py +0 -0
  94. {pyveil-0.2.0 → pyveil-0.2.2}/tests/test_utils.py +0 -0
@@ -16,8 +16,9 @@ Do not turn pyveil into a general DLP suite, gateway, Presidio clone, or prompt-
16
16
  - Run typecheck: `uv run --extra dev mypy pyveil tests`
17
17
  - Build package: `uv run --with build python -m build`
18
18
  - Check package: `uv run --with twine python -m twine check dist/*`
19
- - Run CLI demo: `python3 -m pyveil.cli demo`
20
- - Run CLI locally: `PYVEIL_SECRET=dev-secret python3 -m pyveil.cli redact <file>`
19
+ - Run CLI demo: `python3 -m pyveil demo`
20
+ - Run CLI locally: `PYVEIL_SECRET=dev-secret python3 -m pyveil redact <file>`
21
+ - Run detector evaluation: `python3 evaluation/evaluate.py --check`
21
22
 
22
23
  ## Architecture
23
24
 
@@ -68,6 +69,8 @@ This repository includes files meant for coding agents and LLM readers:
68
69
  - [docs/detector-provenance.md](docs/detector-provenance.md)
69
70
  - [docs/roadmap.md](docs/roadmap.md)
70
71
  - [docs/release-checklist.md](docs/release-checklist.md)
72
+ - [docs/evaluation.html](docs/evaluation.html)
73
+ - [docs/guides/](docs/guides/)
71
74
  - [docs/integrations/mcp.md](docs/integrations/mcp.md)
72
75
  - [docs/integrations/logging.md](docs/integrations/logging.md)
73
76
  - [docs/integrations/tracing.md](docs/integrations/tracing.md)
@@ -84,6 +87,7 @@ Examples:
84
87
  - [examples/openai_agents_guardrail.py](examples/openai_agents_guardrail.py)
85
88
  - [examples/fastapi_middleware.py](examples/fastapi_middleware.py)
86
89
  - [examples/litellm_proxy_filter.py](examples/litellm_proxy_filter.py)
90
+ - [examples/azure_openai.py](examples/azure_openai.py)
87
91
 
88
92
  ## Development
89
93
 
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2 - 2026-07-15
4
+
5
+ Azure OpenAI adoption release.
6
+
7
+ ### Added
8
+
9
+ - Runnable Azure OpenAI v1 Responses API integration with environment, `.env`,
10
+ and non-secret YAML configuration.
11
+ - Dry-run output that proves the raw prompt is redacted before the provider
12
+ SDK call, plus tested `.env` and YAML templates.
13
+
14
+ ### Changed
15
+
16
+ - Added an optional `azure-openai` dependency group while keeping the core
17
+ package dependency-free.
18
+ - Expanded the README, Cookbook, web Manual, Pages entry point, and agent-facing
19
+ navigation with a complete Azure OpenAI request path and observed output.
20
+
21
+ ### Fixed
22
+
23
+ - Kept the Azure OpenAI Manual anchor visible below the fixed navigation bar on
24
+ desktop and mobile layouts.
25
+
26
+ ## 0.2.1 - 2026-07-11
27
+
28
+ Evidence and organic-discovery release.
29
+
30
+ ### Added
31
+
32
+ - Search-intent guides for Python LLM PII redaction, MCP redaction, and choosing
33
+ between pyveil, Presidio/NER, guardrail suites, and enterprise DLP.
34
+ - A public 39-case synthetic built-in detector regression corpus, standard-library
35
+ evaluator, rendered methodology page, and CI gate.
36
+ - `python -m pyveil` as an alternative CLI entry point.
37
+ - Compact E.164 phone-number detection.
38
+ - `Token` and `ApiKey` authorization-header scheme detection in free text.
39
+ - A Pages-served `llms.txt`, site favicon, richer social metadata, and expanded
40
+ sitemap.
41
+ - GitHub Discussions as a support and integration Q&A channel.
42
+
43
+ ### Changed
44
+
45
+ - Expanded PyPI classifiers, keywords, and project links for guides, evaluation,
46
+ and funding.
47
+ - FastAPI example moves redaction work to the default executor for large async
48
+ request payloads.
49
+ - Clarified that generated `pyveil.yaml` is a reference/validation schema and is
50
+ not automatically loaded by 0.2.x CLI commands.
51
+ - Documented detector evidence and limitations without claiming general-world
52
+ PII recall or compliance.
53
+
3
54
  ## 0.2.0 - 2026-07-10
4
55
 
5
56
  Discovery and production-adoption release.
@@ -2,6 +2,13 @@
2
2
 
3
3
  Thanks for helping improve pyveil.
4
4
 
5
+ ## Questions And Integration Help
6
+
7
+ Use [GitHub Discussions](https://github.com/hyeonsangjeon/pyveil/discussions)
8
+ for setup questions, architecture tradeoffs, and integration help. Use Issues
9
+ for reproducible bugs and focused feature requests. Report vulnerabilities
10
+ privately through the security policy.
11
+
5
12
  ## Scope
6
13
 
7
14
  pyveil is agent-native redaction middleware. Good contributions usually improve
@@ -9,14 +9,17 @@ include llms.txt
9
9
  include pyveil.yaml
10
10
 
11
11
  # Include examples
12
- recursive-include examples *.py
12
+ recursive-include examples *.py *.yaml *.example
13
+
14
+ # Include reproducible evaluation
15
+ recursive-include evaluation *.py *.json *.md
13
16
 
14
17
  # Include tests
15
18
  recursive-include tests *.py
16
19
 
17
20
  # Include docs
18
21
  recursive-include docs *.md
19
- recursive-include docs *.html *.xml *.txt
22
+ recursive-include docs *.html *.xml *.txt *.css *.svg
20
23
  recursive-include docs/media *.gif *.png
21
24
 
22
25
  # Exclude unnecessary files
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyveil
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Local PII and secret redaction for Python LLM apps, AI agents, tool calls, and MCP
5
5
  Author-email: Hyeon Sang Jeon <wingnut0310@gmail.com>
6
6
  Maintainer-email: Hyeon Sang Jeon <wingnut0310@gmail.com>
@@ -11,7 +11,11 @@ Project-URL: Repository, https://github.com/hyeonsangjeon/pyveil
11
11
  Project-URL: Issues, https://github.com/hyeonsangjeon/pyveil/issues
12
12
  Project-URL: Changelog, https://github.com/hyeonsangjeon/pyveil/releases
13
13
  Project-URL: Security, https://github.com/hyeonsangjeon/pyveil/security/policy
14
- Keywords: agent-native,agent-security,agents,ai-agents,ai-security,anthropic,data-protection,guardrails,llm,llm-security,logs,masking,mcp,memory,observability,pii,pii-redaction,privacy,prompts,redaction,openai,anonymization,security,sensitive-data,tool-calls,traces
14
+ Project-URL: Guides, https://hyeonsangjeon.github.io/pyveil/guides/
15
+ Project-URL: Evaluation, https://hyeonsangjeon.github.io/pyveil/evaluation.html
16
+ Project-URL: Funding, https://github.com/sponsors/hyeonsangjeon
17
+ Project-URL: Support, https://github.com/hyeonsangjeon/pyveil/discussions
18
+ Keywords: agent-native,agent-security,agents,ai-agents,ai-security,anthropic,data-protection,data-masking,de-identification,guardrails,llm,llm-privacy,llm-security,logs,masking,mcp,mcp-security,memory,observability,pii,pii-redaction,privacy,prompts,prompt-redaction,redaction,runtime-redaction,openai,anonymization,security,sensitive-data,tool-calls,traces
15
19
  Classifier: Development Status :: 3 - Alpha
16
20
  Classifier: Intended Audience :: Developers
17
21
  Classifier: Operating System :: OS Independent
@@ -24,12 +28,17 @@ Classifier: Programming Language :: Python :: 3.12
24
28
  Classifier: Programming Language :: Python :: 3.13
25
29
  Classifier: Programming Language :: Python :: 3.14
26
30
  Classifier: Topic :: Security
31
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
27
32
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
33
  Classifier: Topic :: Text Processing
29
34
  Classifier: Typing :: Typed
30
35
  Requires-Python: >=3.8
31
36
  Description-Content-Type: text/markdown
32
37
  License-File: LICENSE
38
+ Provides-Extra: azure-openai
39
+ Requires-Dist: openai>=1.66.0; extra == "azure-openai"
40
+ Requires-Dist: python-dotenv>=1.0.0; extra == "azure-openai"
41
+ Requires-Dist: PyYAML>=6.0.0; extra == "azure-openai"
33
42
  Provides-Extra: dev
34
43
  Requires-Dist: build>=1.2.0; extra == "dev"
35
44
  Requires-Dist: pytest>=7.0.0; extra == "dev"
@@ -38,9 +47,15 @@ Requires-Dist: black>=23.0.0; extra == "dev"
38
47
  Requires-Dist: ruff>=0.1.0; extra == "dev"
39
48
  Requires-Dist: twine>=5.0.0; extra == "dev"
40
49
  Requires-Dist: mypy>=1.0.0; extra == "dev"
50
+ Requires-Dist: openai>=1.66.0; extra == "dev"
51
+ Requires-Dist: python-dotenv>=1.0.0; extra == "dev"
52
+ Requires-Dist: PyYAML>=6.0.0; extra == "dev"
53
+ Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
41
54
  Provides-Extra: test
42
55
  Requires-Dist: pytest>=7.0.0; extra == "test"
43
56
  Requires-Dist: pytest-cov>=4.0.0; extra == "test"
57
+ Requires-Dist: python-dotenv>=1.0.0; extra == "test"
58
+ Requires-Dist: PyYAML>=6.0.0; extra == "test"
44
59
 
45
60
  # pyveil: PII and secret redaction for Python AI agents
46
61
 
@@ -54,14 +69,18 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
54
69
  <a href="https://www.python.org/"><img alt="Python 3.8 to 3.14" src="https://img.shields.io/badge/python-3.8%20to%203.14-3776AB?style=flat-square"></a>
55
70
  <img alt="Zero core dependencies" src="https://img.shields.io/badge/core%20dependencies-zero-111827?style=flat-square">
56
71
  <img alt="Typed package" src="https://img.shields.io/badge/typed-py.typed-7C3AED?style=flat-square">
72
+ <a href="https://hyeonsangjeon.github.io/pyveil/evaluation.html"><img alt="Synthetic evaluation: 39 cases passing" src="https://img.shields.io/badge/synthetic%20evaluation-39%20cases%20passing-4ade80?style=flat-square"></a>
57
73
  <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-green?style=flat-square"></a>
58
74
  </p>
59
75
 
60
76
  <p align="center">
61
77
  <a href="https://hyeonsangjeon.github.io/pyveil/manual.html">Documentation</a> &middot;
78
+ <a href="https://hyeonsangjeon.github.io/pyveil/guides/">Guides</a> &middot;
79
+ <a href="https://hyeonsangjeon.github.io/pyveil/evaluation.html">Evaluation</a> &middot;
62
80
  <a href="https://pypi.org/project/pyveil/">PyPI</a> &middot;
63
81
  <a href="https://github.com/hyeonsangjeon/pyveil/blob/main/docs/cookbook.md">Cookbook</a> &middot;
64
82
  <a href="https://github.com/hyeonsangjeon/pyveil/blob/main/docs/redaction-reference.md">Detection reference</a> &middot;
83
+ <a href="https://github.com/hyeonsangjeon/pyveil/discussions">Support</a> &middot;
65
84
  <a href="https://github.com/hyeonsangjeon/pyveil/security">Security</a>
66
85
  </p>
67
86
 
@@ -82,6 +101,7 @@ No network calls. No reversible vault. No raw values in findings by default.
82
101
  ```bash
83
102
  pip install pyveil
84
103
  pyveil demo
104
+ # or: python -m pyveil demo
85
105
  ```
86
106
 
87
107
  Or run the synthetic demo in an isolated environment:
@@ -120,6 +140,63 @@ response = call_llm(safe.data) # Your provider SDK call
120
140
  The provider receives the same list and dictionary shape, with sensitive values
121
141
  replaced before serialization or transmission.
122
142
 
143
+ ## Azure OpenAI: End To End
144
+
145
+ Install the optional Azure example dependencies, then load configuration from
146
+ environment variables, `.env`, or YAML:
147
+
148
+ ```bash
149
+ pip install "pyveil[azure-openai]"
150
+ ```
151
+
152
+ ```python
153
+ from pyveil.integrations.azure_openai import ask_azure_openai, load_settings
154
+
155
+ settings = load_settings() # AZURE_OPENAI_* + PYVEIL_* environment variables
156
+ result = ask_azure_openai(
157
+ "Write a follow-up for alice@example.com or 010-1234-5678.",
158
+ settings,
159
+ )
160
+
161
+ print(result.redacted_input) # The exact text sent to Azure OpenAI
162
+ print(result.output_text) # The model response
163
+ ```
164
+
165
+ The integration uses Azure OpenAI's v1 endpoint and Responses API. The
166
+ deployment name is passed as `model`; pyveil redacts the prompt before
167
+ `client.responses.create(...)` runs.
168
+
169
+ Prove the boundary without an Azure request:
170
+
171
+ ```bash
172
+ PYVEIL_SECRET=docs-demo-secret \
173
+ python -m pyveil.integrations.azure_openai --dry-run
174
+ ```
175
+
176
+ ```text
177
+ mode: dry-run
178
+ deployment: not configured
179
+ sent-to-azure: Write a one-sentence support follow-up for [EMAIL:347ab11285a3] or [PHONE:548017338f6f].
180
+ findings: EMAIL=1, PHONE=1
181
+ azure-response: skipped (--dry-run)
182
+ ```
183
+
184
+ For a live call, either export `AZURE_OPENAI_ENDPOINT`,
185
+ `AZURE_OPENAI_DEPLOYMENT`, `AZURE_OPENAI_API_KEY`, `PYVEIL_SECRET`, and
186
+ optionally `PYVEIL_SCOPE`, or use the checked-in
187
+ [`.env` template](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.env.example)
188
+ and [YAML template](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.example.yaml):
189
+
190
+ ```bash
191
+ python -m pyveil.integrations.azure_openai --env-file .env
192
+ python -m pyveil.integrations.azure_openai \
193
+ --config examples/azure_openai.example.yaml --env-file .env
194
+ ```
195
+
196
+ Process environment variables override `.env`, which overrides non-secret YAML
197
+ settings. API keys and the pyveil HMAC secret are rejected if placed directly
198
+ in YAML; YAML names the environment variables that contain them.
199
+
123
200
  <p align="center">
124
201
  <img src="https://raw.githubusercontent.com/hyeonsangjeon/pyveil/main/docs/media/pyveil-awesome-demo.gif"
125
202
  alt="pyveil redacts synthetic PII and secrets before an AI agent boundary"
@@ -138,6 +215,25 @@ replaced before serialization or transmission.
138
215
  | Stop credentials in tool calls | Auth headers, private keys, API keys, JWTs, and tokens block by default |
139
216
  | Cover app-specific data | Exact known-value and trusted custom-regex rules |
140
217
  | Audit without leaking | Findings contain type, rule, path, placeholder, and fingerprint, not raw values |
218
+ | Verify supported behavior | Public 39-case synthetic regression corpus, evaluator, and CI gate |
219
+
220
+ ## Reproducible Evidence
221
+
222
+ The repository ships a public synthetic detector corpus and a standard-library
223
+ evaluator:
224
+
225
+ ```bash
226
+ python evaluation/evaluate.py --check
227
+ ```
228
+
229
+ For corpus v1, pyveil 0.2.2 matches all 36 expected findings across 39 cases
230
+ (33 positive, 6 negative), with no corpus false positives, false negatives,
231
+ labeled-value leaks, or non-empty `Finding.raw` values.
232
+
233
+ These numbers describe documented supported shapes only. They are **not** a
234
+ real-world PII recall benchmark and do not cover unknown names, addresses,
235
+ languages, documents, or images. Read the
236
+ [methodology and limits](https://hyeonsangjeon.github.io/pyveil/evaluation.html).
141
237
 
142
238
  ## Known Names And Domain IDs
143
239
 
@@ -198,7 +294,7 @@ Core detection is intentionally conservative and high precision:
198
294
  | Type | Examples | HIGH output |
199
295
  | --- | --- | --- |
200
296
  | `EMAIL` | Email addresses | `[EMAIL:12hex]` |
201
- | `PHONE` | Korean and international-ish phone numbers | `[PHONE:12hex]` |
297
+ | `PHONE` | Korean, separated international, and compact E.164 phone shapes | `[PHONE:12hex]` |
202
298
  | `CREDIT_CARD` | Card numbers that pass Luhn validation | `[CREDIT_CARD:12hex]` |
203
299
  | `JWT` | Compact JSON Web Tokens | `[JWT:12hex]` |
204
300
  | `AUTH_HEADER` | Bearer and Basic authorization headers | `[AUTH_HEADER:12hex]` |
@@ -272,7 +368,7 @@ is parsed and traversed structurally.
272
368
  | --- | --- |
273
369
  | Any LLM provider | [Provider-neutral client wrapper](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/llm_client_boundary.py) |
274
370
  | OpenAI Agents SDK | [Input guardrail example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/openai_agents_guardrail.py) |
275
- | Azure OpenAI | Use the provider-neutral wrapper; only `call_llm` changes |
371
+ | Azure OpenAI | [Runnable env/YAML integration](https://github.com/hyeonsangjeon/pyveil/blob/main/pyveil/integrations/azure_openai.py) and [short example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.py) |
276
372
  | LiteLLM | [Proxy filter example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/litellm_proxy_filter.py) |
277
373
  | FastAPI | [Request middleware example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/fastapi_middleware.py) |
278
374
  | MCP | [Server wrapper](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/mcp_server_wrapper.py) and [integration guide](https://hyeonsangjeon.github.io/pyveil/manual.html#integrations) |
@@ -293,6 +389,7 @@ Choose an enterprise DLP product when you need managed policy, document/image
293
389
  coverage, incident workflows, or compliance reporting.
294
390
 
295
391
  These tools can be layered. `pyveil` does not claim perfect recall.
392
+ See the full [pyveil vs Presidio, NER, guardrails, and DLP decision guide](https://hyeonsangjeon.github.io/pyveil/guides/pyveil-vs-presidio.html).
296
393
 
297
394
  ## Safety Contract
298
395
 
@@ -313,10 +410,14 @@ before production use.
313
410
  ## Guides
314
411
 
315
412
  - [Complete manual](https://hyeonsangjeon.github.io/pyveil/manual.html)
413
+ - [Python LLM PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/python-llm-pii-redaction.html)
414
+ - [MCP PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/mcp-pii-redaction.html)
415
+ - [pyveil vs Presidio / NER / DLP](https://hyeonsangjeon.github.io/pyveil/guides/pyveil-vs-presidio.html)
416
+ - [Reproducible detector evaluation](https://hyeonsangjeon.github.io/pyveil/evaluation.html)
316
417
  - [English video guide](https://github.com/hyeonsangjeon/pyveil/releases/download/v0.1.2/pyveil-usage-guide-en.mp4)
317
418
  - [Korean video guide](https://github.com/hyeonsangjeon/pyveil/releases/download/v0.1.2/pyveil-usage-guide-ko.mp4)
318
419
  - [AGENTS.md](https://github.com/hyeonsangjeon/pyveil/blob/main/AGENTS.md) for coding agents
319
- - [llms.txt](https://github.com/hyeonsangjeon/pyveil/blob/main/llms.txt) for LLM-readable navigation
420
+ - [llms.txt](https://hyeonsangjeon.github.io/pyveil/llms.txt) for LLM-readable navigation
320
421
  - [Contributing](https://github.com/hyeonsangjeon/pyveil/blob/main/CONTRIBUTING.md)
321
422
 
322
423
  ## Development
@@ -325,6 +426,7 @@ before production use.
325
426
  uv run --extra dev ruff check .
326
427
  uv run --extra dev mypy pyveil tests
327
428
  uv run --extra test pytest
429
+ uv run --extra test python evaluation/evaluate.py --check
328
430
  ```
329
431
 
330
432
  CI runs the test suite on Python `3.8` through `3.14`. The core remains typed,
@@ -1,47 +1,3 @@
1
- Metadata-Version: 2.2
2
- Name: pyveil
3
- Version: 0.2.0
4
- Summary: Local PII and secret redaction for Python LLM apps, AI agents, tool calls, and MCP
5
- Author-email: Hyeon Sang Jeon <wingnut0310@gmail.com>
6
- Maintainer-email: Hyeon Sang Jeon <wingnut0310@gmail.com>
7
- License: MIT
8
- Project-URL: Homepage, https://hyeonsangjeon.github.io/pyveil/
9
- Project-URL: Documentation, https://hyeonsangjeon.github.io/pyveil/manual.html
10
- Project-URL: Repository, https://github.com/hyeonsangjeon/pyveil
11
- Project-URL: Issues, https://github.com/hyeonsangjeon/pyveil/issues
12
- Project-URL: Changelog, https://github.com/hyeonsangjeon/pyveil/releases
13
- Project-URL: Security, https://github.com/hyeonsangjeon/pyveil/security/policy
14
- Keywords: agent-native,agent-security,agents,ai-agents,ai-security,anthropic,data-protection,guardrails,llm,llm-security,logs,masking,mcp,memory,observability,pii,pii-redaction,privacy,prompts,redaction,openai,anonymization,security,sensitive-data,tool-calls,traces
15
- Classifier: Development Status :: 3 - Alpha
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
- Classifier: Programming Language :: Python :: 3.10
22
- Classifier: Programming Language :: Python :: 3.11
23
- Classifier: Programming Language :: Python :: 3.12
24
- Classifier: Programming Language :: Python :: 3.13
25
- Classifier: Programming Language :: Python :: 3.14
26
- Classifier: Topic :: Security
27
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
- Classifier: Topic :: Text Processing
29
- Classifier: Typing :: Typed
30
- Requires-Python: >=3.8
31
- Description-Content-Type: text/markdown
32
- License-File: LICENSE
33
- Provides-Extra: dev
34
- Requires-Dist: build>=1.2.0; extra == "dev"
35
- Requires-Dist: pytest>=7.0.0; extra == "dev"
36
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
- Requires-Dist: black>=23.0.0; extra == "dev"
38
- Requires-Dist: ruff>=0.1.0; extra == "dev"
39
- Requires-Dist: twine>=5.0.0; extra == "dev"
40
- Requires-Dist: mypy>=1.0.0; extra == "dev"
41
- Provides-Extra: test
42
- Requires-Dist: pytest>=7.0.0; extra == "test"
43
- Requires-Dist: pytest-cov>=4.0.0; extra == "test"
44
-
45
1
  # pyveil: PII and secret redaction for Python AI agents
46
2
 
47
3
  <p align="center">
@@ -54,14 +10,18 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
54
10
  <a href="https://www.python.org/"><img alt="Python 3.8 to 3.14" src="https://img.shields.io/badge/python-3.8%20to%203.14-3776AB?style=flat-square"></a>
55
11
  <img alt="Zero core dependencies" src="https://img.shields.io/badge/core%20dependencies-zero-111827?style=flat-square">
56
12
  <img alt="Typed package" src="https://img.shields.io/badge/typed-py.typed-7C3AED?style=flat-square">
13
+ <a href="https://hyeonsangjeon.github.io/pyveil/evaluation.html"><img alt="Synthetic evaluation: 39 cases passing" src="https://img.shields.io/badge/synthetic%20evaluation-39%20cases%20passing-4ade80?style=flat-square"></a>
57
14
  <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-green?style=flat-square"></a>
58
15
  </p>
59
16
 
60
17
  <p align="center">
61
18
  <a href="https://hyeonsangjeon.github.io/pyveil/manual.html">Documentation</a> &middot;
19
+ <a href="https://hyeonsangjeon.github.io/pyveil/guides/">Guides</a> &middot;
20
+ <a href="https://hyeonsangjeon.github.io/pyveil/evaluation.html">Evaluation</a> &middot;
62
21
  <a href="https://pypi.org/project/pyveil/">PyPI</a> &middot;
63
22
  <a href="https://github.com/hyeonsangjeon/pyveil/blob/main/docs/cookbook.md">Cookbook</a> &middot;
64
23
  <a href="https://github.com/hyeonsangjeon/pyveil/blob/main/docs/redaction-reference.md">Detection reference</a> &middot;
24
+ <a href="https://github.com/hyeonsangjeon/pyveil/discussions">Support</a> &middot;
65
25
  <a href="https://github.com/hyeonsangjeon/pyveil/security">Security</a>
66
26
  </p>
67
27
 
@@ -82,6 +42,7 @@ No network calls. No reversible vault. No raw values in findings by default.
82
42
  ```bash
83
43
  pip install pyveil
84
44
  pyveil demo
45
+ # or: python -m pyveil demo
85
46
  ```
86
47
 
87
48
  Or run the synthetic demo in an isolated environment:
@@ -120,6 +81,63 @@ response = call_llm(safe.data) # Your provider SDK call
120
81
  The provider receives the same list and dictionary shape, with sensitive values
121
82
  replaced before serialization or transmission.
122
83
 
84
+ ## Azure OpenAI: End To End
85
+
86
+ Install the optional Azure example dependencies, then load configuration from
87
+ environment variables, `.env`, or YAML:
88
+
89
+ ```bash
90
+ pip install "pyveil[azure-openai]"
91
+ ```
92
+
93
+ ```python
94
+ from pyveil.integrations.azure_openai import ask_azure_openai, load_settings
95
+
96
+ settings = load_settings() # AZURE_OPENAI_* + PYVEIL_* environment variables
97
+ result = ask_azure_openai(
98
+ "Write a follow-up for alice@example.com or 010-1234-5678.",
99
+ settings,
100
+ )
101
+
102
+ print(result.redacted_input) # The exact text sent to Azure OpenAI
103
+ print(result.output_text) # The model response
104
+ ```
105
+
106
+ The integration uses Azure OpenAI's v1 endpoint and Responses API. The
107
+ deployment name is passed as `model`; pyveil redacts the prompt before
108
+ `client.responses.create(...)` runs.
109
+
110
+ Prove the boundary without an Azure request:
111
+
112
+ ```bash
113
+ PYVEIL_SECRET=docs-demo-secret \
114
+ python -m pyveil.integrations.azure_openai --dry-run
115
+ ```
116
+
117
+ ```text
118
+ mode: dry-run
119
+ deployment: not configured
120
+ sent-to-azure: Write a one-sentence support follow-up for [EMAIL:347ab11285a3] or [PHONE:548017338f6f].
121
+ findings: EMAIL=1, PHONE=1
122
+ azure-response: skipped (--dry-run)
123
+ ```
124
+
125
+ For a live call, either export `AZURE_OPENAI_ENDPOINT`,
126
+ `AZURE_OPENAI_DEPLOYMENT`, `AZURE_OPENAI_API_KEY`, `PYVEIL_SECRET`, and
127
+ optionally `PYVEIL_SCOPE`, or use the checked-in
128
+ [`.env` template](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.env.example)
129
+ and [YAML template](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.example.yaml):
130
+
131
+ ```bash
132
+ python -m pyveil.integrations.azure_openai --env-file .env
133
+ python -m pyveil.integrations.azure_openai \
134
+ --config examples/azure_openai.example.yaml --env-file .env
135
+ ```
136
+
137
+ Process environment variables override `.env`, which overrides non-secret YAML
138
+ settings. API keys and the pyveil HMAC secret are rejected if placed directly
139
+ in YAML; YAML names the environment variables that contain them.
140
+
123
141
  <p align="center">
124
142
  <img src="https://raw.githubusercontent.com/hyeonsangjeon/pyveil/main/docs/media/pyveil-awesome-demo.gif"
125
143
  alt="pyveil redacts synthetic PII and secrets before an AI agent boundary"
@@ -138,6 +156,25 @@ replaced before serialization or transmission.
138
156
  | Stop credentials in tool calls | Auth headers, private keys, API keys, JWTs, and tokens block by default |
139
157
  | Cover app-specific data | Exact known-value and trusted custom-regex rules |
140
158
  | Audit without leaking | Findings contain type, rule, path, placeholder, and fingerprint, not raw values |
159
+ | Verify supported behavior | Public 39-case synthetic regression corpus, evaluator, and CI gate |
160
+
161
+ ## Reproducible Evidence
162
+
163
+ The repository ships a public synthetic detector corpus and a standard-library
164
+ evaluator:
165
+
166
+ ```bash
167
+ python evaluation/evaluate.py --check
168
+ ```
169
+
170
+ For corpus v1, pyveil 0.2.2 matches all 36 expected findings across 39 cases
171
+ (33 positive, 6 negative), with no corpus false positives, false negatives,
172
+ labeled-value leaks, or non-empty `Finding.raw` values.
173
+
174
+ These numbers describe documented supported shapes only. They are **not** a
175
+ real-world PII recall benchmark and do not cover unknown names, addresses,
176
+ languages, documents, or images. Read the
177
+ [methodology and limits](https://hyeonsangjeon.github.io/pyveil/evaluation.html).
141
178
 
142
179
  ## Known Names And Domain IDs
143
180
 
@@ -198,7 +235,7 @@ Core detection is intentionally conservative and high precision:
198
235
  | Type | Examples | HIGH output |
199
236
  | --- | --- | --- |
200
237
  | `EMAIL` | Email addresses | `[EMAIL:12hex]` |
201
- | `PHONE` | Korean and international-ish phone numbers | `[PHONE:12hex]` |
238
+ | `PHONE` | Korean, separated international, and compact E.164 phone shapes | `[PHONE:12hex]` |
202
239
  | `CREDIT_CARD` | Card numbers that pass Luhn validation | `[CREDIT_CARD:12hex]` |
203
240
  | `JWT` | Compact JSON Web Tokens | `[JWT:12hex]` |
204
241
  | `AUTH_HEADER` | Bearer and Basic authorization headers | `[AUTH_HEADER:12hex]` |
@@ -272,7 +309,7 @@ is parsed and traversed structurally.
272
309
  | --- | --- |
273
310
  | Any LLM provider | [Provider-neutral client wrapper](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/llm_client_boundary.py) |
274
311
  | OpenAI Agents SDK | [Input guardrail example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/openai_agents_guardrail.py) |
275
- | Azure OpenAI | Use the provider-neutral wrapper; only `call_llm` changes |
312
+ | Azure OpenAI | [Runnable env/YAML integration](https://github.com/hyeonsangjeon/pyveil/blob/main/pyveil/integrations/azure_openai.py) and [short example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/azure_openai.py) |
276
313
  | LiteLLM | [Proxy filter example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/litellm_proxy_filter.py) |
277
314
  | FastAPI | [Request middleware example](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/fastapi_middleware.py) |
278
315
  | MCP | [Server wrapper](https://github.com/hyeonsangjeon/pyveil/blob/main/examples/mcp_server_wrapper.py) and [integration guide](https://hyeonsangjeon.github.io/pyveil/manual.html#integrations) |
@@ -293,6 +330,7 @@ Choose an enterprise DLP product when you need managed policy, document/image
293
330
  coverage, incident workflows, or compliance reporting.
294
331
 
295
332
  These tools can be layered. `pyveil` does not claim perfect recall.
333
+ See the full [pyveil vs Presidio, NER, guardrails, and DLP decision guide](https://hyeonsangjeon.github.io/pyveil/guides/pyveil-vs-presidio.html).
296
334
 
297
335
  ## Safety Contract
298
336
 
@@ -313,10 +351,14 @@ before production use.
313
351
  ## Guides
314
352
 
315
353
  - [Complete manual](https://hyeonsangjeon.github.io/pyveil/manual.html)
354
+ - [Python LLM PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/python-llm-pii-redaction.html)
355
+ - [MCP PII redaction guide](https://hyeonsangjeon.github.io/pyveil/guides/mcp-pii-redaction.html)
356
+ - [pyveil vs Presidio / NER / DLP](https://hyeonsangjeon.github.io/pyveil/guides/pyveil-vs-presidio.html)
357
+ - [Reproducible detector evaluation](https://hyeonsangjeon.github.io/pyveil/evaluation.html)
316
358
  - [English video guide](https://github.com/hyeonsangjeon/pyveil/releases/download/v0.1.2/pyveil-usage-guide-en.mp4)
317
359
  - [Korean video guide](https://github.com/hyeonsangjeon/pyveil/releases/download/v0.1.2/pyveil-usage-guide-ko.mp4)
318
360
  - [AGENTS.md](https://github.com/hyeonsangjeon/pyveil/blob/main/AGENTS.md) for coding agents
319
- - [llms.txt](https://github.com/hyeonsangjeon/pyveil/blob/main/llms.txt) for LLM-readable navigation
361
+ - [llms.txt](https://hyeonsangjeon.github.io/pyveil/llms.txt) for LLM-readable navigation
320
362
  - [Contributing](https://github.com/hyeonsangjeon/pyveil/blob/main/CONTRIBUTING.md)
321
363
 
322
364
  ## Development
@@ -325,6 +367,7 @@ before production use.
325
367
  uv run --extra dev ruff check .
326
368
  uv run --extra dev mypy pyveil tests
327
369
  uv run --extra test pytest
370
+ uv run --extra test python evaluation/evaluate.py --check
328
371
  ```
329
372
 
330
373
  CI runs the test suite on Python `3.8` through `3.14`. The core remains typed,
@@ -6,9 +6,13 @@ traces cross application boundaries.
6
6
 
7
7
  Start with:
8
8
 
9
+ - [Rendered guide hub](https://hyeonsangjeon.github.io/pyveil/guides/)
10
+ - [Reproducible evaluation](https://hyeonsangjeon.github.io/pyveil/evaluation.html)
11
+ - [LLM-readable navigation](https://hyeonsangjeon.github.io/pyveil/llms.txt)
9
12
  - [Threat model](threat-model.md)
10
13
  - [FAQ](faq.md)
11
14
  - [Cookbook](cookbook.md)
15
+ - [Azure OpenAI env/YAML integration](../pyveil/integrations/azure_openai.py)
12
16
  - [Redaction reference](redaction-reference.md)
13
17
  - [Known limitations](known-limitations.md)
14
18
  - [Detector provenance](detector-provenance.md)
@@ -30,4 +34,6 @@ Applications can add known sensitive values and narrow domain identifiers with
30
34
  the public `CustomRule` API while keeping semantic NER out of the dependency-free
31
35
  core.
32
36
 
33
- `index.html` is a static GitHub Pages landing page. Serve GitHub Pages from the repository `/docs` directory to publish it.
37
+ `index.html`, `manual.html`, `evaluation.html`, and `guides/` are static GitHub
38
+ Pages content. Serve GitHub Pages from the repository `/docs` directory to
39
+ publish them.