agentmesh-proxy 0.2.1__tar.gz → 0.3.0__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 (149) hide show
  1. agentmesh_proxy-0.3.0/.dockerignore +20 -0
  2. agentmesh_proxy-0.3.0/Dockerfile +18 -0
  3. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/PKG-INFO +83 -10
  4. agentmesh_proxy-0.3.0/PRIVACY.md +39 -0
  5. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/README.md +76 -7
  6. agentmesh_proxy-0.3.0/agentmesh/cache/__init__.py +1 -0
  7. agentmesh_proxy-0.3.0/agentmesh/cache/redis_backend.py +184 -0
  8. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/cache/semantic.py +3 -3
  9. agentmesh_proxy-0.3.0/agentmesh/compliance/pdf_report.py +284 -0
  10. agentmesh_proxy-0.3.0/agentmesh/integrations/__init__.py +1 -0
  11. agentmesh_proxy-0.3.0/agentmesh/integrations/saml_handler.py +226 -0
  12. agentmesh_proxy-0.3.0/agentmesh/integrations/webhooks.py +249 -0
  13. agentmesh_proxy-0.3.0/agentmesh/monitoring/anomaly_detector.py +236 -0
  14. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/embedder.py +1 -1
  15. agentmesh_proxy-0.3.0/agentmesh/optimizer/health_monitor.py +190 -0
  16. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/policy/engine.py +10 -0
  17. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/proxy/server.py +174 -3
  18. agentmesh_proxy-0.3.0/agentmesh/security/injection_detector.py +228 -0
  19. agentmesh_proxy-0.3.0/agentmesh/security/pii_scanner.py +235 -0
  20. agentmesh_proxy-0.3.0/agentmesh/security/toxicity_filter.py +178 -0
  21. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/manifest.json +1 -2
  22. agentmesh_proxy-0.3.0/dashboard_out.txt +0 -0
  23. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/cookbook.md +2 -2
  24. agentmesh_proxy-0.3.0/docs/devto-article.md +142 -0
  25. agentmesh_proxy-0.3.0/docs/linkedin-company-post.md +63 -0
  26. agentmesh_proxy-0.3.0/docs/linkedin-post.md +67 -0
  27. agentmesh_proxy-0.3.0/docs/linkedin-profile.md +203 -0
  28. agentmesh_proxy-0.3.0/docs/medium-article.md +267 -0
  29. agentmesh_proxy-0.3.0/docs/social-assets/AnilLinkedinProfile_Nov2025.png +0 -0
  30. agentmesh_proxy-0.3.0/docs/social-assets/author_card.png +0 -0
  31. agentmesh_proxy-0.3.0/docs/social-assets/devto_cover.png +0 -0
  32. agentmesh_proxy-0.3.0/docs/social-assets/li_hero.png +0 -0
  33. agentmesh_proxy-0.3.0/docs/social-assets/m_pipeline.png +0 -0
  34. agentmesh_proxy-0.3.0/docs/social-assets/sub_cover.png +0 -0
  35. agentmesh_proxy-0.3.0/docs/social-assets/sub_problem.png +0 -0
  36. agentmesh_proxy-0.3.0/docs/social-assets/x1_hero.png +0 -0
  37. agentmesh_proxy-0.3.0/docs/social-assets/x2_benchmark.png +0 -0
  38. agentmesh_proxy-0.3.0/docs/social-assets/x3_semantic.png +0 -0
  39. agentmesh_proxy-0.3.0/docs/substack-article.md +71 -0
  40. agentmesh_proxy-0.3.0/docs/x-thread.md +118 -0
  41. agentmesh_proxy-0.3.0/examples/__init__.py +0 -0
  42. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/dashboard_web.py +1 -1
  43. agentmesh_proxy-0.3.0/generate_store_assets.py +240 -0
  44. agentmesh_proxy-0.3.0/hf-space/.gitattributes +35 -0
  45. {agentmesh_proxy-0.2.1/spaces → agentmesh_proxy-0.3.0/hf-space}/README.md +2 -2
  46. {agentmesh_proxy-0.2.1/spaces → agentmesh_proxy-0.3.0/hf-space}/app.py +8 -12
  47. agentmesh_proxy-0.3.0/hf-space/requirements.txt +1 -0
  48. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/pyproject.toml +5 -3
  49. agentmesh_proxy-0.3.0/spaces/README.md +57 -0
  50. agentmesh_proxy-0.3.0/spaces/app.py +218 -0
  51. agentmesh_proxy-0.3.0/spaces/requirements.txt +1 -0
  52. agentmesh_proxy-0.3.0/store_assets/marquee_1400x560.png +0 -0
  53. agentmesh_proxy-0.3.0/store_assets/promo_small_440x280.png +0 -0
  54. agentmesh_proxy-0.3.0/store_assets/screenshot_1280x800.png +0 -0
  55. agentmesh_proxy-0.3.0/store_assets/screenshot_promo_640x400.png +0 -0
  56. agentmesh_proxy-0.3.0/store_assets/store_icon_128.png +0 -0
  57. agentmesh_proxy-0.3.0/store_assets/store_icon_from_promo.png +0 -0
  58. agentmesh_proxy-0.3.0/store_assets/store_icon_from_screenshot.png +0 -0
  59. agentmesh_proxy-0.3.0/tests/__init__.py +0 -0
  60. agentmesh_proxy-0.2.1/agentmesh/cache/__init__.py +0 -5
  61. agentmesh_proxy-0.2.1/agentmesh/integrations/__init__.py +0 -1
  62. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/.github/workflows/ci.yml +0 -0
  63. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/.github/workflows/codeql.yml +0 -0
  64. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/.gitignore +0 -0
  65. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/CHANGELOG.md +0 -0
  66. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/CONTRIBUTING.md +0 -0
  67. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/LICENSE +0 -0
  68. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/SECURITY.md +0 -0
  69. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/__init__.py +0 -0
  70. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/attribution/__init__.py +0 -0
  71. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/attribution/chargebacks.py +0 -0
  72. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/audit/__init__.py +0 -0
  73. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/audit/trail.py +0 -0
  74. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/bridge/__init__.py +0 -0
  75. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/bridge/bpmn.py +0 -0
  76. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/budget/__init__.py +0 -0
  77. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/budget/enforcer.py +0 -0
  78. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/cli.py +0 -0
  79. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/compliance/__init__.py +0 -0
  80. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/compliance/reporter.py +0 -0
  81. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/core.py +0 -0
  82. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/events/__init__.py +0 -0
  83. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/events/bus.py +0 -0
  84. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/autogen.py +0 -0
  85. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/crewai.py +0 -0
  86. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/google_adk.py +0 -0
  87. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/haystack.py +0 -0
  88. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/langgraph.py +0 -0
  89. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/nvidia_nim.py +0 -0
  90. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/openai_agents.py +0 -0
  91. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/integrations/pydantic_ai.py +0 -0
  92. {agentmesh_proxy-0.2.1/examples → agentmesh_proxy-0.3.0/agentmesh/monitoring}/__init__.py +0 -0
  93. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/__init__.py +0 -0
  94. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/circuit_breaker.py +0 -0
  95. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/compressor.py +0 -0
  96. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/cost_optimizer.py +0 -0
  97. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/multi_vendor.py +0 -0
  98. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/normalizer.py +0 -0
  99. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/optimizer/router.py +0 -0
  100. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/policy/__init__.py +0 -0
  101. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/policy/schema.py +0 -0
  102. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/proxy/__init__.py +0 -0
  103. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/proxy/forwarder.py +0 -0
  104. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/proxy/middleware.py +0 -0
  105. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/quota/__init__.py +0 -0
  106. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/quota/engine.py +0 -0
  107. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/quota/escalation.py +0 -0
  108. {agentmesh_proxy-0.2.1/tests → agentmesh_proxy-0.3.0/agentmesh/security}/__init__.py +0 -0
  109. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/server.py +0 -0
  110. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/__init__.py +0 -0
  111. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/customer_service.yaml +0 -0
  112. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/enterprise.yaml +0 -0
  113. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/fintech.yaml +0 -0
  114. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/healthcare.yaml +0 -0
  115. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/nvidia_nim.yaml +0 -0
  116. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh/templates/research.yaml +0 -0
  117. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/_metadata/generated_indexed_rulesets/_ruleset1 +0 -0
  118. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/background/service_worker.js +0 -0
  119. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/content/interceptor.js +0 -0
  120. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/content/styles.css +0 -0
  121. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/generate_icons.py +0 -0
  122. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/icons/icon128.png +0 -0
  123. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/icons/icon16.png +0 -0
  124. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/icons/icon48.png +0 -0
  125. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/popup/popup.css +0 -0
  126. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/popup/popup.html +0 -0
  127. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/popup/popup.js +0 -0
  128. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/agentmesh-extension/rules/redirect_rules.json +0 -0
  129. /agentmesh_proxy-0.2.1/dashboard_err.txt → /agentmesh_proxy-0.3.0/c/357/200/272Usersanilsprojectsagentmeshagentmeshcache__init__.py" +0 -0
  130. /agentmesh_proxy-0.2.1/dashboard_out.txt → /agentmesh_proxy-0.3.0/dashboard_err.txt +0 -0
  131. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/architecture.md +0 -0
  132. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/blog-how-i-cut-agent-bill-70-percent.md +0 -0
  133. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/demo.gif +0 -0
  134. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/deploying-to-kubernetes.md +0 -0
  135. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/getting-started.md +0 -0
  136. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/docs/policy-reference.md +0 -0
  137. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/benchmark.py +0 -0
  138. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/dashboard_terminal.py +0 -0
  139. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/demo.py +0 -0
  140. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/make_demo_gif.py +0 -0
  141. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/quickstart.py +0 -0
  142. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/simulation.py +0 -0
  143. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/examples/test_extension_e2e.py +0 -0
  144. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_async.py +0 -0
  145. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_attribution.py +0 -0
  146. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_cache.py +0 -0
  147. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_compliance.py +0 -0
  148. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_core.py +0 -0
  149. {agentmesh_proxy-0.2.1 → agentmesh_proxy-0.3.0}/tests/test_templates.py +0 -0
@@ -0,0 +1,20 @@
1
+ .git
2
+ .venv
3
+ venv
4
+ __pycache__
5
+ *.pyc
6
+ *.pyo
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ hf-space/
11
+ .pytest_cache/
12
+ .mypy_cache/
13
+ .ruff_cache/
14
+ htmlcov/
15
+ .coverage
16
+ *.log
17
+ node_modules/
18
+ agentmesh-extension/
19
+ docs/
20
+ spaces/
@@ -0,0 +1,18 @@
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install core deps first for layer caching
6
+ COPY pyproject.toml README.md LICENSE ./
7
+ RUN pip install --no-cache-dir "agentmesh-proxy[semantic]==0.2.1"
8
+
9
+ # Copy source (for SDK / CLI usage on top of installed package)
10
+ COPY agentmesh/ ./agentmesh/
11
+ COPY examples/ ./examples/
12
+
13
+ EXPOSE 8080
14
+
15
+ ENV AGENTMESH_HOST=0.0.0.0
16
+ ENV AGENTMESH_PORT=8080
17
+
18
+ CMD ["python", "-m", "agentmesh.cli", "serve", "--host", "0.0.0.0", "--port", "8080"]
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentmesh-proxy
3
- Version: 0.2.1
4
- Summary: Governance proxy for every AI tool — semantic cache, token quotas, vendor routing, Chrome extension
3
+ Version: 0.3.0
4
+ Summary: Governance proxy for every AI tool — PII/PHI masking, prompt injection detection, anomaly alerts, semantic cache, token quotas, vendor routing, compliance reports
5
5
  Project-URL: Homepage, https://github.com/anilatambharii/agentmesh
6
6
  Project-URL: Documentation, https://github.com/anilatambharii/agentmesh/tree/main/docs
7
7
  Project-URL: Repository, https://github.com/anilatambharii/agentmesh
@@ -34,7 +34,7 @@ Requires-Dist: pydantic>=2.0
34
34
  Requires-Dist: pyyaml>=6.0
35
35
  Requires-Dist: uvicorn>=0.29
36
36
  Provides-Extra: all
37
- Requires-Dist: agentmesh[compression,crewai,langgraph,openai,otel,semantic]; extra == 'all'
37
+ Requires-Dist: agentmesh[compression,crewai,langgraph,openai,otel,pdf,redis,semantic]; extra == 'all'
38
38
  Provides-Extra: compression
39
39
  Requires-Dist: llmlingua>=0.2; extra == 'compression'
40
40
  Provides-Extra: crewai
@@ -59,6 +59,10 @@ Requires-Dist: openai>=1.50; extra == 'openai'
59
59
  Provides-Extra: otel
60
60
  Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25; extra == 'otel'
61
61
  Requires-Dist: opentelemetry-sdk>=1.25; extra == 'otel'
62
+ Provides-Extra: pdf
63
+ Requires-Dist: reportlab>=4.0; extra == 'pdf'
64
+ Provides-Extra: redis
65
+ Requires-Dist: redis>=5.0; extra == 'redis'
62
66
  Provides-Extra: semantic
63
67
  Requires-Dist: sentence-transformers>=2.6; extra == 'semantic'
64
68
  Description-Content-Type: text/markdown
@@ -81,6 +85,75 @@ Description-Content-Type: text/markdown
81
85
 
82
86
  ---
83
87
 
88
+ ## Enterprise Governance Features
89
+
90
+ AgentMesh ships a complete enterprise security and compliance stack — no third-party SaaS required.
91
+
92
+ | Feature | Module | What it does |
93
+ |---|---|---|
94
+ | **PII / PHI / PCI masking** | `agentmesh/security/pii_scanner.py` | Scans every prompt for SSN, credit cards, medical records, AWS keys, JWTs — masks or blocks before the LLM sees them |
95
+ | **Prompt injection detection** | `agentmesh/security/injection_detector.py` | 14 rules covering DAN, roleplay jailbreaks, role confusion, encoding tricks — HIGH risk blocked automatically |
96
+ | **Output toxicity filter** | `agentmesh/security/toxicity_filter.py` | Post-call scan of LLM responses for hate speech, hallucinations, policy leaks, refusal bypasses |
97
+ | **Cost anomaly detection** | `agentmesh/monitoring/anomaly_detector.py` | Sliding-window burn rate, spend spike, runaway agent loop, cache miss flood — fires alerts in real time |
98
+ | **Slack / PagerDuty alerts** | `agentmesh/integrations/webhooks.py` | Fire-and-forget alerts on anomalies, quota blocks, injection detections — never blocks the request path |
99
+ | **Redis distributed cache** | `agentmesh/cache/redis_backend.py` | Shared semantic cache across multiple proxy instances — falls back to in-memory if Redis is unavailable |
100
+ | **SAML / SSO identity** | `agentmesh/integrations/saml_handler.py` | Extracts team/user identity from SAML assertions, OIDC JWTs, or pre-verified proxy headers |
101
+ | **Vendor health monitor** | `agentmesh/optimizer/health_monitor.py` | Per-vendor circuit breaker — automatically routes around degraded APIs |
102
+ | **EU AI Act / HIPAA reports** | `agentmesh/compliance/pdf_report.py` | One-click compliance reports for EU AI Act, HIPAA, SOC2, NIST AI RMF — Markdown and PDF |
103
+ | **Chargeback export** | `agentmesh/attribution/chargebacks.py` | Per-team, per-month, per-model cost attribution — CSV and JSON for internal billing |
104
+
105
+ ### Quick config
106
+
107
+ ```python
108
+ from agentmesh.proxy.server import ProxyConfig, build_proxy_app
109
+
110
+ app = build_proxy_app(ProxyConfig(
111
+ vendors=["anthropic", "openai", "google"],
112
+
113
+ # Security
114
+ pii_mode="mask", # "mask" | "redact" | "block"
115
+ block_injections=True, # block HIGH-risk prompt injection
116
+ toxicity_filter=True, # filter harmful LLM output
117
+
118
+ # Monitoring
119
+ anomaly_detection=True,
120
+ slack_webhook="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
121
+ pagerduty_key="YOUR_PD_ROUTING_KEY",
122
+
123
+ # Infrastructure
124
+ redis_url="redis://your-redis:6379/0", # distributed cache
125
+ sso_enabled=True, # JWT/SAML identity extraction
126
+
127
+ # Deterministic mode — temperature=0 per team
128
+ deterministic_teams={"healthcare": "claude-haiku-4-5", "legal": "claude-sonnet-4-6"},
129
+ ))
130
+ ```
131
+
132
+ New governance response headers:
133
+
134
+ ```
135
+ X-AgentMesh-PII-Findings: 3 # entities masked in this prompt
136
+ X-AgentMesh-PII-Types: EMAIL,SSN # types detected
137
+ X-AgentMesh-Injection-Risk: high # injection detected (request blocked)
138
+ X-AgentMesh-Toxicity: TOXICITY # output toxicity type
139
+ X-AgentMesh-Toxicity-Action: redacted # redacted | blocked
140
+ X-AgentMesh-Anomaly: RUNAWAY_LOOP
141
+ X-AgentMesh-SSO-Source: jwt # jwt | saml | header
142
+ X-AgentMesh-Deterministic: true
143
+ ```
144
+
145
+ ### Compliance report (one line)
146
+
147
+ ```python
148
+ from agentmesh.compliance.pdf_report import ComplianceReporter, Framework
149
+
150
+ reporter = ComplianceReporter(policy=your_policy, audit_trail=your_audit)
151
+ reporter.generate_pdf(Framework.HIPAA, output_path="hipaa_report.pdf")
152
+ reporter.generate_pdf(Framework.EU_AI_ACT, output_path="eu_ai_act_report.pdf")
153
+ ```
154
+
155
+ ---
156
+
84
157
  ## What it does
85
158
 
86
159
  AgentMesh sits between your engineers and every LLM API. It enforces token budgets, semantically caches repeated prompts, and routes calls to the cheapest capable model — without touching a single line of agent code.
@@ -99,7 +172,7 @@ Your LangGraph / CrewAI / AutoGen agents OpenA
99
172
  ## Benchmark — real numbers, demo mode, no API keys needed
100
173
 
101
174
  ```bash
102
- pip install agentmesh-proxy-proxy sentence-transformers
175
+ pip install agentmesh-proxy sentence-transformers
103
176
  python examples/benchmark.py
104
177
  ```
105
178
 
@@ -318,15 +391,15 @@ Your agents (LangGraph etc.) ─────────────────
318
391
  ┌─────────▼──────────┐
319
392
  │ AgentMesh Proxy │
320
393
  │ │
321
- │ 1. Exact cache SHA-256 0 tokens
394
+ │ 1. Circuit breakerkill runaway loops first
322
395
  │ 2. Quota check │ pre-call estimation
323
- │ 3. Compressionbudget < 30%
324
- │ 4. Dry-run gate require_approval mode
396
+ │ 3. Exact cacheSHA-256 0 tokens
397
+ │ 4. Semantic cache sentence-transformers cosine
325
398
  │ 5. Vendor route │ cheapest capable model
326
- │ 6. Audit log Ed25519 tamper-evident
327
- │ 7. LLM call │ Anthropic cache_control
399
+ │ 6. Provider cache Anthropic cache_control
400
+ │ 7. LLM call │ only if all caches missed
328
401
  │ 8. Cache store │ semantic + exact
329
- │ 9. Cost calcper-team attribution
402
+ │ 9. Audit logEd25519 tamper-evident
330
403
  └─────────┬──────────┘
331
404
 
332
405
  ┌─────────────┼──────────────┐
@@ -0,0 +1,39 @@
1
+ # Privacy Policy — AgentMesh
2
+
3
+ **Last updated: June 2026**
4
+
5
+ ## Summary
6
+
7
+ AgentMesh does not collect, transmit, or store any personal data on external servers. All data stays on your local machine.
8
+
9
+ ## What the Chrome extension does
10
+
11
+ The AgentMesh Chrome extension:
12
+
13
+ - Intercepts prompts you type into ChatGPT, Claude.ai, and Gemini **before** they are sent
14
+ - Forwards those prompts to a **locally running proxy** on your own machine (localhost:8080 by default)
15
+ - Displays governance metadata (cache hit/miss, quota usage, tokens saved) in a popup
16
+
17
+ ## Data collected
18
+
19
+ | Data | Where it goes | Stored externally? |
20
+ |---|---|---|
21
+ | Prompt text | Local proxy only (localhost) | No |
22
+ | Cache hit/miss stats | chrome.storage.local (your browser) | No |
23
+ | Tokens saved / cost saved | chrome.storage.local (your browser) | No |
24
+ | Proxy port setting | chrome.storage.sync (your Google account) | No |
25
+
26
+ ## What we do NOT do
27
+
28
+ - We do not send any data to AgentMesh servers (there are none)
29
+ - We do not collect analytics or telemetry
30
+ - We do not sell, share, or transmit any user data to third parties
31
+ - We do not store prompt content beyond the local proxy cache on your machine
32
+
33
+ ## Local proxy
34
+
35
+ The AgentMesh proxy runs entirely on your own machine. Prompt data sent to `localhost` never leaves your device unless you explicitly forward it to an LLM API (Anthropic, OpenAI, Google) — the same call your browser would have made anyway.
36
+
37
+ ## Contact
38
+
39
+ Questions? Open an issue at [github.com/anilatambharii/agentmesh/issues](https://github.com/anilatambharii/agentmesh/issues) or email anil@ambharii.com.
@@ -16,6 +16,75 @@
16
16
 
17
17
  ---
18
18
 
19
+ ## Enterprise Governance Features
20
+
21
+ AgentMesh ships a complete enterprise security and compliance stack — no third-party SaaS required.
22
+
23
+ | Feature | Module | What it does |
24
+ |---|---|---|
25
+ | **PII / PHI / PCI masking** | `agentmesh/security/pii_scanner.py` | Scans every prompt for SSN, credit cards, medical records, AWS keys, JWTs — masks or blocks before the LLM sees them |
26
+ | **Prompt injection detection** | `agentmesh/security/injection_detector.py` | 14 rules covering DAN, roleplay jailbreaks, role confusion, encoding tricks — HIGH risk blocked automatically |
27
+ | **Output toxicity filter** | `agentmesh/security/toxicity_filter.py` | Post-call scan of LLM responses for hate speech, hallucinations, policy leaks, refusal bypasses |
28
+ | **Cost anomaly detection** | `agentmesh/monitoring/anomaly_detector.py` | Sliding-window burn rate, spend spike, runaway agent loop, cache miss flood — fires alerts in real time |
29
+ | **Slack / PagerDuty alerts** | `agentmesh/integrations/webhooks.py` | Fire-and-forget alerts on anomalies, quota blocks, injection detections — never blocks the request path |
30
+ | **Redis distributed cache** | `agentmesh/cache/redis_backend.py` | Shared semantic cache across multiple proxy instances — falls back to in-memory if Redis is unavailable |
31
+ | **SAML / SSO identity** | `agentmesh/integrations/saml_handler.py` | Extracts team/user identity from SAML assertions, OIDC JWTs, or pre-verified proxy headers |
32
+ | **Vendor health monitor** | `agentmesh/optimizer/health_monitor.py` | Per-vendor circuit breaker — automatically routes around degraded APIs |
33
+ | **EU AI Act / HIPAA reports** | `agentmesh/compliance/pdf_report.py` | One-click compliance reports for EU AI Act, HIPAA, SOC2, NIST AI RMF — Markdown and PDF |
34
+ | **Chargeback export** | `agentmesh/attribution/chargebacks.py` | Per-team, per-month, per-model cost attribution — CSV and JSON for internal billing |
35
+
36
+ ### Quick config
37
+
38
+ ```python
39
+ from agentmesh.proxy.server import ProxyConfig, build_proxy_app
40
+
41
+ app = build_proxy_app(ProxyConfig(
42
+ vendors=["anthropic", "openai", "google"],
43
+
44
+ # Security
45
+ pii_mode="mask", # "mask" | "redact" | "block"
46
+ block_injections=True, # block HIGH-risk prompt injection
47
+ toxicity_filter=True, # filter harmful LLM output
48
+
49
+ # Monitoring
50
+ anomaly_detection=True,
51
+ slack_webhook="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
52
+ pagerduty_key="YOUR_PD_ROUTING_KEY",
53
+
54
+ # Infrastructure
55
+ redis_url="redis://your-redis:6379/0", # distributed cache
56
+ sso_enabled=True, # JWT/SAML identity extraction
57
+
58
+ # Deterministic mode — temperature=0 per team
59
+ deterministic_teams={"healthcare": "claude-haiku-4-5", "legal": "claude-sonnet-4-6"},
60
+ ))
61
+ ```
62
+
63
+ New governance response headers:
64
+
65
+ ```
66
+ X-AgentMesh-PII-Findings: 3 # entities masked in this prompt
67
+ X-AgentMesh-PII-Types: EMAIL,SSN # types detected
68
+ X-AgentMesh-Injection-Risk: high # injection detected (request blocked)
69
+ X-AgentMesh-Toxicity: TOXICITY # output toxicity type
70
+ X-AgentMesh-Toxicity-Action: redacted # redacted | blocked
71
+ X-AgentMesh-Anomaly: RUNAWAY_LOOP
72
+ X-AgentMesh-SSO-Source: jwt # jwt | saml | header
73
+ X-AgentMesh-Deterministic: true
74
+ ```
75
+
76
+ ### Compliance report (one line)
77
+
78
+ ```python
79
+ from agentmesh.compliance.pdf_report import ComplianceReporter, Framework
80
+
81
+ reporter = ComplianceReporter(policy=your_policy, audit_trail=your_audit)
82
+ reporter.generate_pdf(Framework.HIPAA, output_path="hipaa_report.pdf")
83
+ reporter.generate_pdf(Framework.EU_AI_ACT, output_path="eu_ai_act_report.pdf")
84
+ ```
85
+
86
+ ---
87
+
19
88
  ## What it does
20
89
 
21
90
  AgentMesh sits between your engineers and every LLM API. It enforces token budgets, semantically caches repeated prompts, and routes calls to the cheapest capable model — without touching a single line of agent code.
@@ -34,7 +103,7 @@ Your LangGraph / CrewAI / AutoGen agents OpenA
34
103
  ## Benchmark — real numbers, demo mode, no API keys needed
35
104
 
36
105
  ```bash
37
- pip install agentmesh-proxy-proxy sentence-transformers
106
+ pip install agentmesh-proxy sentence-transformers
38
107
  python examples/benchmark.py
39
108
  ```
40
109
 
@@ -253,15 +322,15 @@ Your agents (LangGraph etc.) ─────────────────
253
322
  ┌─────────▼──────────┐
254
323
  │ AgentMesh Proxy │
255
324
  │ │
256
- │ 1. Exact cache SHA-256 0 tokens
325
+ │ 1. Circuit breakerkill runaway loops first
257
326
  │ 2. Quota check │ pre-call estimation
258
- │ 3. Compressionbudget < 30%
259
- │ 4. Dry-run gate require_approval mode
327
+ │ 3. Exact cacheSHA-256 0 tokens
328
+ │ 4. Semantic cache sentence-transformers cosine
260
329
  │ 5. Vendor route │ cheapest capable model
261
- │ 6. Audit log Ed25519 tamper-evident
262
- │ 7. LLM call │ Anthropic cache_control
330
+ │ 6. Provider cache Anthropic cache_control
331
+ │ 7. LLM call │ only if all caches missed
263
332
  │ 8. Cache store │ semantic + exact
264
- │ 9. Cost calcper-team attribution
333
+ │ 9. Audit logEd25519 tamper-evident
265
334
  └─────────┬──────────┘
266
335
 
267
336
  ┌─────────────┼──────────────┐
@@ -0,0 +1,184 @@
1
+ """
2
+ Redis Distributed Cache Backend
3
+
4
+ Drop-in replacement for the in-memory CostOptimizer cache.
5
+ Enables shared cache across multiple AgentMesh proxy instances.
6
+
7
+ Features:
8
+ - Exact match cache (SHA-256 key → JSON blob)
9
+ - Semantic cache (vector stored as JSON array alongside blob)
10
+ - TTL support (configurable per cache tier)
11
+ - Atomic get+set via Redis pipelines
12
+ - Graceful fallback to in-memory if Redis is unavailable
13
+
14
+ Usage:
15
+ from agentmesh.cache.redis_backend import RedisCache
16
+
17
+ cache = RedisCache(url="redis://localhost:6379/0", ttl_seconds=3600)
18
+ cache.put("my-key", {"content": "Hello"}, model="claude-haiku-4-5", tokens=100)
19
+ hit = cache.get("my-key")
20
+ """
21
+
22
+ from __future__ import annotations
23
+
24
+ import hashlib
25
+ import json
26
+ import logging
27
+ import time
28
+ from typing import Any, Dict, Optional, Tuple
29
+
30
+ logger = logging.getLogger(__name__)
31
+
32
+ _REDIS_AVAILABLE = False
33
+ try:
34
+ import redis as _redis
35
+ _REDIS_AVAILABLE = True
36
+ except ImportError:
37
+ pass
38
+
39
+
40
+ class RedisCache:
41
+ """
42
+ Redis-backed distributed cache for AgentMesh.
43
+
44
+ Falls back to a local dict if Redis is unavailable so the proxy
45
+ keeps running without a Redis dependency.
46
+
47
+ Args:
48
+ url: Redis URL e.g. "redis://localhost:6379/0"
49
+ or "rediss://user:pass@host:6380/0" for TLS
50
+ ttl_seconds: Default TTL for cache entries (default 3600)
51
+ key_prefix: Namespace prefix for all keys (default "agentmesh:")
52
+ max_local_fallback: In-memory fallback entries when Redis is down
53
+ """
54
+
55
+ def __init__(
56
+ self,
57
+ url: str = "redis://localhost:6379/0",
58
+ ttl_seconds: int = 3600,
59
+ key_prefix: str = "agentmesh:",
60
+ max_local_fallback: int = 1000,
61
+ ):
62
+ self.ttl = ttl_seconds
63
+ self.prefix = key_prefix
64
+ self._local: Dict[str, Any] = {} # fallback
65
+ self._local_ts: Dict[str, float] = {}
66
+ self._max_local = max_local_fallback
67
+ self._client = None
68
+
69
+ if _REDIS_AVAILABLE:
70
+ try:
71
+ self._client = _redis.from_url(
72
+ url, decode_responses=True,
73
+ socket_connect_timeout=2,
74
+ socket_timeout=1,
75
+ )
76
+ self._client.ping()
77
+ logger.info("RedisCache connected to %s", url)
78
+ except Exception as e:
79
+ logger.warning("RedisCache: Redis unavailable (%s) — using local fallback", e)
80
+ self._client = None
81
+ else:
82
+ logger.warning("RedisCache: redis-py not installed. Run: pip install redis")
83
+
84
+ # ── Public API (mirrors CostOptimizer cache interface) ────────────────────
85
+
86
+ def get(self, key: str) -> Optional[dict]:
87
+ """Return cached response dict or None."""
88
+ rkey = self._rkey(key)
89
+ if self._client:
90
+ try:
91
+ raw = self._client.get(rkey)
92
+ if raw:
93
+ return json.loads(raw)
94
+ except Exception as e:
95
+ logger.debug("Redis get error: %s", e)
96
+ # Fallback
97
+ if key in self._local:
98
+ if time.monotonic() - self._local_ts[key] < self.ttl:
99
+ return self._local[key]
100
+ del self._local[key]
101
+ return None
102
+
103
+ def put(self, key: str, value: dict, model: str = "", tokens: int = 0) -> None:
104
+ """Store a response dict with TTL."""
105
+ rkey = self._rkey(key)
106
+ blob = json.dumps(value)
107
+ if self._client:
108
+ try:
109
+ self._client.setex(rkey, self.ttl, blob)
110
+ return
111
+ except Exception as e:
112
+ logger.debug("Redis put error: %s", e)
113
+ # Fallback — evict oldest if full
114
+ if len(self._local) >= self._max_local:
115
+ oldest = min(self._local_ts, key=self._local_ts.get)
116
+ self._local.pop(oldest, None)
117
+ self._local_ts.pop(oldest, None)
118
+ self._local[key] = value
119
+ self._local_ts[key] = time.monotonic()
120
+
121
+ def get_semantic(self, key: str) -> Optional[Tuple[dict, list]]:
122
+ """Return (response, embedding_vector) or None."""
123
+ rkey = self._rkey(f"sem:{key}")
124
+ if self._client:
125
+ try:
126
+ raw = self._client.get(rkey)
127
+ if raw:
128
+ data = json.loads(raw)
129
+ return data.get("response"), data.get("embedding", [])
130
+ except Exception as e:
131
+ logger.debug("Redis get_semantic error: %s", e)
132
+ return None
133
+
134
+ def put_semantic(self, key: str, response: dict, embedding: list) -> None:
135
+ """Store a response + its embedding vector."""
136
+ rkey = self._rkey(f"sem:{key}")
137
+ blob = json.dumps({"response": response, "embedding": embedding})
138
+ if self._client:
139
+ try:
140
+ self._client.setex(rkey, self.ttl, blob)
141
+ return
142
+ except Exception as e:
143
+ logger.debug("Redis put_semantic error: %s", e)
144
+
145
+ def invalidate(self, key: str) -> None:
146
+ rkey = self._rkey(key)
147
+ if self._client:
148
+ try:
149
+ self._client.delete(rkey, self._rkey(f"sem:{key}"))
150
+ except Exception:
151
+ pass
152
+ self._local.pop(key, None)
153
+
154
+ def flush(self) -> int:
155
+ """Clear all AgentMesh keys. Returns count deleted."""
156
+ if self._client:
157
+ try:
158
+ keys = self._client.keys(f"{self.prefix}*")
159
+ if keys:
160
+ return self._client.delete(*keys)
161
+ except Exception:
162
+ pass
163
+ n = len(self._local)
164
+ self._local.clear()
165
+ self._local_ts.clear()
166
+ return n
167
+
168
+ def stats(self) -> dict:
169
+ info = {"backend": "redis" if self._client else "local_fallback",
170
+ "local_entries": len(self._local)}
171
+ if self._client:
172
+ try:
173
+ i = self._client.info("memory")
174
+ info["redis_used_memory"] = i.get("used_memory_human", "unknown")
175
+ info["redis_keys"] = self._client.dbsize()
176
+ except Exception:
177
+ pass
178
+ return info
179
+
180
+ # ── Internal ──────────────────────────────────────────────────────────────
181
+
182
+ def _rkey(self, key: str) -> str:
183
+ h = hashlib.sha256(key.encode()).hexdigest()[:32]
184
+ return f"{self.prefix}{h}"
@@ -75,13 +75,13 @@ class SemanticCache:
75
75
  ``embedder`` callable to use OpenAI / Cohere / local embeddings.
76
76
 
77
77
  Args:
78
- similarity_threshold: Cosine similarity above which a hit is declared (0.85–0.95 typical)
78
+ similarity_threshold: Cosine similarity above which a hit is declared (0.70 for sentence-transformers MiniLM; raise for the char-bigram fallback)
79
79
  ttl_seconds: Cache entries expire after this duration
80
80
  max_entries: Maximum number of entries to retain (LRU eviction)
81
81
  embedder: Optional callable (text) -> List[float] for production embeddings
82
82
 
83
83
  Example:
84
- cache = SemanticCache(similarity_threshold=0.90)
84
+ cache = SemanticCache(similarity_threshold=0.70)
85
85
  cached = cache.get("What is the capital of France?")
86
86
  if cached:
87
87
  return cached # free!
@@ -91,7 +91,7 @@ class SemanticCache:
91
91
 
92
92
  def __init__(
93
93
  self,
94
- similarity_threshold: float = 0.88,
94
+ similarity_threshold: float = 0.70,
95
95
  ttl_seconds: int = 3600,
96
96
  max_entries: int = 10_000,
97
97
  embedder: Optional[Callable[[str], List[float]]] = None,