v1.2.12 — Dynamic Policy-as-Code (RBAC), Zero-Downtime Hot-Reloading & Enterprise Hardening
What's New in v1.2.12
🛡️ Dynamic Policy-as-Code (RBAC) & Zero-Downtime Hot Reloading
-
Hierarchical Role-Based Access Control: Introduced declarative
policies.yamlmappingvirtual_key_ididentities to granular security roles (e.g.,developer_tier,clinical_tier,financial_tier). - Zero-Downtime Hot-Reloading: Built-in background file watcher dynamically reloads and recompiles policy rules upon file modification without restarting proxy processes or interrupting active streaming connections.
-
Dynamic Thread-Safe Context Settings: Implemented
DynamicSettingsProxyusing Pythoncontextvarsto provide per-request,$O(1)$ setting overrides for masking modes, rate limits, PII profiling, and fail-safe behaviors. - Granular NER & Detection Scoping: Enables per-tenant toggling of Tier 3 ONNX/regex NER engines, custom regex patterns, and synthetic swapping behaviors.
⚡ Concurrency & Architecture Hardening
- Thread-Safe ContextVar Propagation: Redaction workloads dispatched to CPU worker pools via
loop.run_in_executornow utilizecontextvars.copy_context().runto ensure thread-pool execution inherits active request policy overrides. - Lifecycle-Bound Event Loops: Refactored
AppState.shutdown_eventto bind dynamically inside FastAPI's asynclifespanhandler, eliminating event loop concurrency mismatches under multi-worker environments and test harnesses. - BetterProto Python 3.11+ Dataclass Compatibility: Decorated Envoy
ext_procgRPC protobuf definitions with@dataclass(eq=False, repr=False)to guarantee standard compliance and zero serialization overhead across Python 3.11 and 3.12 runtimes.
📖 Documentation & Compliance Hub
- Added POLICIES.md: Exhaustive guide to RBAC configuration, custom role definitions, dynamic overrides, and audit trail schemas.
- Updated DEPLOYMENT.md and FEATURES.md with streamlined enterprise architectural notes.
- Updated README.md with curl verification examples and policy-as-code operational commands.
📦 Installation & Verification
Install the latest release directly from PyPI:
pip install --upgrade llm-shield-proxy==1.2.12
**Full Changelog**: https://github.com/ninadphalak/LLM-Shield-Proxy/compare/v1.2.11...v1.2.12