Repository navigation
v0.7.0 - Enterprise AI Security Platform
🛡️ LightGuard-Agent v0.7.0: Production-Grade Enterprise AI Security Platform
This landmark release transforms LightGuard-Agent into an enterprise-grade AI security architecture designed for autonomous tool-calling agents, Model Context Protocol (MCP) gateways, and high-throughput RAG pipelines.
🚀 Key Capabilities & Security Enhancements
-
Centralized Tool Authorization & RBAC Engine (
lightguard.policy):- Added
ToolCapabilityenum,ToolMetadata, andToolPolicyRegistry. - Role-Based Access Control (
RBAC) viaAuthorizationContext(caller_role, caller_id). - Human-in-the-loop approval hooks (
approval_hook) for critical actions. - Enforced strict deny-over-allow precedence with default-deny semantics.
- Added
-
Deep Recursive Argument Security & SSRF Defense (
lightguard.structured):- Recursive inspection of nested dictionaries and arrays with cycle detection (
path_ids). - Bounded complexity defense with
max_depth=10andmax_elements=1000. - Complete SSRF defense blocking loopback (
127.0.0.1), private networks (RFC 1918), and cloud metadata IP (169.254.169.254). - Universal path traversal checks across all string arguments and dangerous command injection prevention.
- Recursive inspection of nested dictionaries and arrays with cycle detection (
-
Multi-Provider Streamed Tool Argument Unmarshaling (
lightguard.wrapper):- Integrated
_unmarshal_tool_argsacross synchronous and asynchronous streaming wrappers. - Transparently parses chunked and delta JSON strings into top-level dictionaries before security validation.
- Verified across OpenAI, Anthropic, Groq, and Ollama multi-tool parallel calls.
- Integrated
-
Hardened RAG Context & Metadata Poisoning Defense (
lightguard.rag):- Added
SourceTrustLevelhierarchy for untrusted vs. trusted retrieval boundaries. - Metadata prompt-injection scanning and Markdown exfiltration beacon detection (
). - Document length bounds and cryptographic canary provenance tags.
- Added
-
Hardened MCP Gateway & Tools Discovery Filtering (
lightguard.mcp_gateway):- Enforced maximum JSON-RPC payload bounds (
max_message_size), rejecting oversized frames with error code-32600. - Dynamic
tools/listdiscovery filtering hiding unauthorized tools based on caller capabilities. - Server-to-client response inspection blocking secret canary leaks.
- Enforced maximum JSON-RPC payload bounds (
-
Structured DLP Redaction & Extended Cloud Secrets (
lightguard.privacy):- Added
redact_structured()andrestore_structured()with non-colliding sequential placeholder tokens across nested JSON. - Extended secret regex patterns for Google Cloud (
AIza...), HuggingFace tokens (hf_...), Stripe keys, Anthropic, and OpenAI. - Automatic TTL pruning and capacity eviction in
CanaryGuard.
- Added
-
Structured Audit Trail & Security Reason Codes (
lightguard.audit):- Introduced
SecurityReasonCodeenum providing deterministic, programmatic reason codes for SIEM integration. - Structured
AuditEventrecords and thread-safeAuditLoggerwith in-memory ring buffer and JSONL file export. - Integrated end-to-end into observation processing, action verification, and MCP gateways.
- Introduced
📊 Verification & Test Suite
- Test Results: 162/162 passing tests (
100% pass rate) across Python 3.9, 3.10, 3.11, 3.12. - Coverage: 82% overall statement coverage (>92% across core security modules).
- Dependencies: 0 external runtime dependencies (Pure Python standard library).