a23one

llmshield

Changelog

Detection Accuracy Improvements

Reduced false positives with better possessive handling and RFC 5321 email compliance

Detection engine now handles possessive suffixes correctly to prevent false positives on common nouns. Email detection supports single-character local parts in compliance with RFC 5321. Plain text and concept detection have been corrected to avoid flagging isolated generic terms.

  • fixed

    Fixed possessive word stripping to prevent false positives on common nouns like "Grass".

  • added

    Added support for single-character email local parts compliant with RFC 5321.

  • changed

    Corrected plain text detection to avoid spurious PII flags.

  • changed

    Entity detection handled possessive suffixes correctly, preventing common nouns from being misclassified.

  • added

    Email detection supported single-character local parts in compliance with RFC 5321.

  • changed

    Concept detection no longer flagged isolated generic terms like "PII" within plain text.

Public Landing Page Launch

Interactive demo, self-hosted visuals, and social media previews

We have launched public landing page featuring interactive cloak/uncloak demo, self-hosted visuals, and optimised social media previews to improve discovery and engagement.

  • added

    Launched public landing page with interactive cloak/uncloak demo, self-hosted visuals, and social media previews.

  • changed

    Updated public site HTML to ensure correct link previews when shared on social media.

Enhanced Allowlist Controls

Allowlist, Provider Exposure, xAI Support

Users can now specify exact entity strings that should never be cloaked, with per‑call and instance‑level allowlists merging for flexible protection.

  • added

    Added `allowlist` argument to `Shield` constructor, `cloak`, and `ask` methods, enabling case‑insensitive entity strings to bypass cloaking.

Version 2.0.0 – Expanded API and Improved Defaults

New convenience constructor, version exposure, larger cache, config shortcuts, clearer defaults, detection order tweak, CLI tool

The 2.0.0 release introduces a host of new features and improvements that make it easier to customise PII detection, boost performance, and use the library from the command line.

  • added

    Added enable_all() convenience constructor for creating shields with all entity types enabled.

Enhanced Entity Detection and Configuration

Entity detection, configuration, and cloaking improvements, including support for tool-call result formats and new error-handling helpers.

This release enhances entity detection and configuration, including support for tool-call result formats and new error-handling helpers.

  • added

    Full support for tool-call result formats, allowing the Shield to correctly cloak/uncloak responses that contain structured tool-call objects.

Enhanced Shield API

Improved Shield API with optional messages and entity map reuse

The Shield API has been enhanced with optional messages and entity map reuse.

  • changed

    Shield.ask now accepts optional messages parameter and validates input style

Utility Functions

New conversation_hash and LRUCache utilities

New utility functions for conversation_hash and LRUCache have been added.

Validation and error handling improvements

Fixed history concatenation, cache key, added clearer validation errors

Improved stability and developer experience by fixing history handling, cache key bugs, and providing clearer validation errors.

  • fixed

    Corrected conversation‑history concatenation to use a list, keeping history structure consistent.

Chat‑style API and LRU caching

Added chat‑style ask, LRU cache, Message type, conversation hash

Shield now supports multi‑message interactions, reuses entity placeholders via an LRU cache, and offers a stable hash for conversation context.

  • added

    Introduced lightweight LRU cache for entity‑map reuse per conversation.

Improved entity detection accuracy

Enhanced stop‑word list and regex patterns for better shielding precision

The shielding engine now detects entities more accurately, reducing false positives and improving user experience.

Real‑time streaming and API refinements

Added streaming support, improved ask API, and enhanced error handling

Users could now receive LLM responses in real‑time streams, with a cleaner API and better validation.

  • added

    Introduced stream_uncloak method enabling real‑time streaming of LLM responses.

  • changed

    Updated streaming implementation for better chunk handling and lower latency.

  • added

    Created uncloak_stream_response utility to uncloak streamed responses cleanly.

  • added

    Exposed ask_helper function to simplify input validation for ask calls.

  • added

    Introduced is_valid_stream_response to validate stream objects and provide clear errors.

Setup Changes

Legacy setup.py removed, pyproject.toml updated, README.md revised

Changes to library setup and installation workflow.

  • removed

    Legacy setup.py file removed, installation now relies on pyproject.toml.

Structured Output Support

Structured Output Support, Improved Name Detection

Enhanced Shield library with structured output support and improved name detection.

  • added

    Added structured output support to Shield.ask method, allowing for single-shot responses with structured data.

  • added

    Integrated Pydantic model into Shield.uncloak for seamless handling of structured LLM outputs.

Version 0.0.2 – Ask Method Flexibility and Documentation

Ask method now accepts prompt or message, forwards kwargs, version bump

Enhanced the ask interface for flexibility, updated docs, and bumped the package version.

  • changed

    Changed ask method to accept prompt or message, forward kwargs to LLM.

Initial Release – Core Library and PII Protection

Core library, PII detection, ask method, zero‑dependency, README

Launched the core LLM shielding library with PII detection, cloaking, and a simple ask interface.

  • added

    Added core library providing end‑to‑end protection for LLM interactions.