Skip to content

v0.7.0 - Enterprise AI Security Platform

Choose a tag to compare

@seotarek seotarek released this 21 Oct 04:36
· 2 commits to main since this release

🛡️ 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

  1. Centralized Tool Authorization & RBAC Engine (lightguard.policy):

    • Added ToolCapability enum, ToolMetadata, and ToolPolicyRegistry.
    • Role-Based Access Control (RBAC) via AuthorizationContext(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.
  2. 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=10 and max_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.
  3. Multi-Provider Streamed Tool Argument Unmarshaling (lightguard.wrapper):

    • Integrated _unmarshal_tool_args across 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.
  4. Hardened RAG Context & Metadata Poisoning Defense (lightguard.rag):

    • Added SourceTrustLevel hierarchy for untrusted vs. trusted retrieval boundaries.
    • Metadata prompt-injection scanning and Markdown exfiltration beacon detection (![beacon](...)).
    • Document length bounds and cryptographic canary provenance tags.
  5. 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/list discovery filtering hiding unauthorized tools based on caller capabilities.
    • Server-to-client response inspection blocking secret canary leaks.
  6. Structured DLP Redaction & Extended Cloud Secrets (lightguard.privacy):

    • Added redact_structured() and restore_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.
  7. Structured Audit Trail & Security Reason Codes (lightguard.audit):

    • Introduced SecurityReasonCode enum providing deterministic, programmatic reason codes for SIEM integration.
    • Structured AuditEvent records and thread-safe AuditLogger with in-memory ring buffer and JSONL file export.
    • Integrated end-to-end into observation processing, action verification, and MCP gateways.

📊 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).