Skip to content

Releases: seotarek/LightGuard-Agent

v0.7.1 - Post-v0.7.0 Enterprise Security Hardening

Choose a tag to compare

@seotarek seotarek released this 21 Oct 05:54

Highlights of v0.7.1

  • Pure Python Schema Validation: Added deterministic stdlib JSON schema validation before RBAC evaluation.
  • Authorization Modes: Enforced strict/production_secure/compatibility/permissive policy modes.
  • Streaming Secret Guard: Added rolling buffer for cross-chunk secret detection and redacted sensitive tokens in exceptions.
  • Context Propagation: Thread-safe ContextVar authorization propagation across async tasks and MCP gateways.
  • SSRF Hardening: Pure-Python IP normalization (hex, decimal int, IPv6 mapped) and pre-resolution DNS rebinding defense.
  • SVG Multi-Modal Security: Hardened XML ElementTree parser neutralizing entity expansion, script handlers, and dangerous schemes.
  • Resource Roots: Strict path containment enforcing resource_roots boundary limits on file tools.
  • Atomic Threat Intel: ReDoS-safe regex length constraints and all-or-nothing rollback for threat signature feeds.
  • Zero External Runtime Dependencies: 100% standard library compliance with sub-millisecond inspection latency.

v0.7.0 - Enterprise AI Security Platform

Choose a tag to compare

@seotarek seotarek released this 21 Oct 04:36

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

v0.6.1 - Production Hardening & Independent Security Audit Resolutions

Choose a tag to compare

@seotarek seotarek released this 21 Oct 01:02

🛡️ LightGuard-Agent v0.6.1: Enterprise Hardening Release

This maintenance release directly resolves all findings from the Independent Developer Security Audit (October 21, 2026), elevating LightGuard-Agent from beta status to a hardened production-grade AI security architecture.

🔧 Key Fixes & Enhancements

  1. Hybrid RedactionResult: PrivacyGuard.redact() now returns a RedactionResult container supporting tuple unpacking (redacted, mapping, ms = guard.redact()), dict key access (res['entities_found'], res['redacted_text']), and attribute access.
  2. Flexible RAG Chunk Ingestion: RAGContextShield.build_fenced_context() now accepts raw strings, dictionary chunks ({'id': ..., 'text': ...}), and LangChain/LlamaIndex Document objects seamlessly.
  3. Security Policy Factory & Set Proxy: Added SecurityPolicyConfig.from_profile() and set proxy on policy.custom_high_stakes.add() matching published documentation.
  4. Decoupled Normalization & Multilingual Safety: Linguistic normalization (Unicode homoglyphs, accents, zero-width chars) no longer causes false positives on benign non-English texts (e.g. French, Arabic, German).
  5. Explicit Tool Authorization: Added denied_tools (unconditional blocklist) and allowed_tools (enforcing Principle of Least Privilege / Default-Deny).
  6. Hardened MCP Security Gateway: Protected MCPSecurityGateway against non-dict JSON frames and expanded inspection coverage across tools/call, resources/read, and prompts/get.
  7. Canary Token Bounded LRU/TTL: Added automatic TTL expiration and capacity eviction to CanaryGuard preventing memory bloat in long-running processes.
  8. Standardized Empirical Benchmark: Upgraded lightguard benchmark with an empirical multi-vector test suite measuring latency distributions, mitigation rate (100%), and false positive rate (0.0%).
  9. Automated CI Coverage: Added pytest-cov to automated GitHub Actions matrix, verifying 101/101 tests passing across Python 3.9 through 3.12 with 81% statement coverage.

v0.6.0: Aho-Corasick O(N+M) Matcher, GCG Suffix Detector, Offline Threat Intel, Async Core & Control Center

Choose a tag to compare

@seotarek seotarek released this 21 Oct 00:24

🚀 What's New in LightGuard-Agent v0.6.0

  • ⚡ Zero-Dependency Aho-Corasick Fast Matcher (FastPatternMatcher): Linear-time (N+M)$ multi-pattern matching across thousands of adversarial injection keywords without regex backtracking overhead.
  • 🛡️ Adversarial Suffix & GCG Anomaly Detector (AdversarialSuffixDetector): Statistical bigram transition entropy and punctuation burst clustering detecting automated Greedy Coordinate Gradient jailbreaks in under 0.05 ms.
  • 🔒 Offline Threat Intelligence Registry (ThreatIntelRegistry): Cryptographically verified JSON threat feeds with SHA-256 checksums to sync enterprise signatures offline without updating the core package.
  • ⚡ High-Throughput AsyncIO Core (AsyncLightGuardAgent): Native non-blocking coroutines (process_observation, verify_action) for FastAPI, Starlette, and asynchronous tool loops.
  • 🖥️ Built-in Offline Web Control Center (lightguard dashboard): Zero-dependency local browser dashboard (powered by Python http.server) with interactive scanner, live audit generator, and Prometheus metrics on http://127.0.0.1:8443.
  • 🧪 100% Test Coverage: Expanded unit test suite with 92/92 passing tests in ~1.0s.

PyPI: https://pypi.org/project/lightguard-agent/0.6.0/
Docs: https://seotarek.github.io/LightGuard-Agent/

LightGuard-Agent v0.5.0: Swarm Shield, Standalone MCP Gateway & CISO Compliance

Choose a tag to compare

@seotarek seotarek released this 21 Oct 00:05

LightGuard-Agent v0.5.0: The Autonomous AI Security Standard 🚀

What's New in v0.5.0:

  1. 🐝 Multi-Agent Swarm Lateral Injection Shield (lightguard.integrations.swarm):
    • MultiAgentSwarmShield and AgentTaintTracker prevent lateral prompt injection and agent-to-agent privilege escalation across CrewAI, AutoGen, and LangGraph swarms.
  2. 🔌 Standalone MCP Security Gateway (lightguard-mcp):
    • Intercepts and shields any upstream MCP server in Claude Desktop or Cursor IDE over stdio JSON-RPC 2.0 with sub-millisecond overhead.
  3. 🔗 LangGraph First-Class Guard Node:
    • create_langgraph_guard() hooks into LangGraph workflows to inspect and sanitize state messages between tools and the agent.
  4. 🖼️ Multimodal & Vision Metadata Shield (lightguard.multimodal):
    • Neutralizes prompt injections embedded in SVG vector graphics, image EXIF/IPTC metadata tags, and document streams.
  5. 🛡️ Structured Output & Function Calling Guard (lightguard.structured):
    • Prevents JSON parameter smuggling, command chaining, and path traversal in function calling arguments.
  6. 📋 Executive CISO & OWASP Compliance Reporting (lightguard.reporting):
    • lightguard report --format html generates executive audit reports mapped to OWASP Top 10 for LLMs and MITRE ATLAS.
  7. 🧪 Comprehensive Testing:
    • 76/76 unit tests passing (0.33s), clean Ruff linting, zero external dependencies.
    • Published live to PyPI: pip install lightguard-agent==0.5.0

LightGuard-Agent v0.4.1: Professional Documentation & Enterprise Shields

Choose a tag to compare

@seotarek seotarek released this 20 Oct 23:43

LightGuard-Agent v0.4.1 🛡️

What's New:

  • Upgraded, comprehensive enterprise documentation and architecture diagrams across GitHub, PyPI, and Hugging Face.
  • Head-to-head comparison matrix against Llama-Guard 3, NeMo Guardrails, and Guardrails AI.
  • RAG Context Poisoning Shield (lightguard.rag)
  • Zero-Dependency DLP & PII Redactor with Luhn algorithm (lightguard.privacy)
  • Security Policy Profiles (lightguard.policy)
  • Prometheus Metrics & Telemetry Exporter (lightguard.telemetry)
  • 60/60 unit tests passing in 0.50s with zero external dependencies.

LightGuard-Agent v0.4.0: Enterprise RAG Shield, DLP PII Redaction & Prometheus Telemetry

Choose a tag to compare

@seotarek seotarek released this 20 Oct 23:34

What's New in v0.4.0 🚀

1. 📚 RAG Context Poisoning Shield (lightguard.rag)

  • Chunk Sanitization: Inspects retrieved text chunks for indirect prompt injection directives.
  • XML Context Fencing: Encapsulates retrieved knowledge in tamper-evident boundaries.
  • Poisoned Chunk Dropping: Automatically drops poisoned documents before LLM context construction.
  • Retriever Proxy: Drop-in wrapping for LangChain and LlamaIndex retrievers (shield.protect_retriever(retriever)).

2. 🔒 Zero-Dependency DLP & PII Redaction (lightguard.privacy)

  • Financial Validation: Luhn checksum validation for Visa, MasterCard, Amex, Discover.
  • Secrets Scanning: Auto-redacts OpenAI keys (sk-...), Anthropic keys, AWS Access Keys, GitHub tokens.
  • Contact & PII: Redacts emails, phone numbers, SSNs, and IPv4 addresses.
  • Reversible Anonymization: Restore original sensitive entities before executing secure local database operations.

3. ⚙️ Enterprise Security Policy Profiles (lightguard.policy)

  • Out-of-the-box security postures: STRICT, BALANCED, and PERMISSIVE.
  • Granular per-tool permissions and custom high-stakes registries.

4. 📈 Prometheus Telemetry & Observability (lightguard.telemetry)

  • Real-time thread-safe telemetry collector.
  • Exposes standard Prometheus text metrics (export_prometheus()) with rolling latency percentiles (P95, mean).

5. 💻 CLI Subcommand Expansion

  • lightguard redact <text>
  • lightguard rag-scan <chunk>
  • lightguard metrics

📊 Verification & Tests

  • 60/60 unit tests passing (0.50s)
  • 100% defense rate against 26 red-team attack vectors
  • Zero external runtime dependencies
  • Published to PyPI: pip install lightguard-agent==0.4.0

LightGuard-Agent v0.3.0: Enterprise Multi-Tier Defense & Universal SDK

Choose a tag to compare

@seotarek seotarek released this 20 Oct 23:13

What's New in v0.3.0:

  • Tier 0 Obfuscation Shield: Full protection against Cyrillic/Greek homoglyphs, zero-width steganography, Base64/Hex decoders, and Shannon entropy anomaly detection.
  • Cryptographic Canary Guard: Nonce-fenced boundaries against Indirect Prompt Injection (IPI) and system prompt exfiltration.
  • Stateful Multi-Turn Session Guard: Defeats Crescendo multi-turn jailbreaks and adversarial velocity escalation.
  • Universal 1-Line SDK Wrapper: client = lightguard.wrap(OpenAI()) for instant protection of OpenAI, Anthropic, Groq, and Ollama.
  • Production Middleware: One-line ASGI & WSGI middleware for FastAPI and Flask.
  • Adversarial Red-Team CLI Engine: lightguard audit and lightguard redteam with 26-vector penetration simulation and ANSI dashboards.
  • Official PyPI Release: Available worldwide via pip install lightguard-agent.