Skip to main content

Fast production grade security for GenAI applications

Project description

Documentation ZenGuard SDK CI License: MIT PyPI version

image

ZenGuard AI

ZenGuard AI enables AI developers to integrate production-level, low-code LLM (Large Language Model) guardrails into their generative AI applications effortlessly. With ZenGuard AI, ensure your application operates within trusted boundaries, is protected from prompt injections, and maintains user privacy without compromising on performance.

Features

  • Prompt Injection Detection: Identifies and mitigates attempts to manipulate, exfiltrate proprietary data, and insert malicious content to/from models and RAG systems.
  • Jailbreak Detection: Identifies and mitigates attempts to manipulate model/app outputs.
  • Personally Identifiable Information (PII) Detection: Protects user data privacy by detecting and managing sensitive information.
  • Allowed Topics Detection: Enables your model/app to generate content within specified, permissible topics.
  • Banned Topics Detection: Prevents the model from producing content on prohibited subjects.
  • Keywords Detection: Allows filtering and sanitization of your application's requests and responses or content generation based on specific keywords.
  • Toxicity Detection: Evaluate the presence of toxic elements in the prompt. Its main goal is to detect and neutralize potentially harmful or offensive material, helping to uphold a safe and positive online environment.

Requirements

  • Python: ^3.9

Quick Start

Installation

Start by installing ZenGuard package:

pip install zenguard

Getting Started

Jump into our Quickstart Guide to easily integrate ZenGuard AI into your application.

ZenGuard Playground

Test the capabilities of ZenGuard AI in our ZenGuard Playground. It's available to start for free to understand how our guardrails can enhance your GenAI applications.

Documentation

A more detailed documentation is available at docs.zenguard.ai.

Penetration Testing

Run pen test against both ZenGuard AI and (optionally) ChatGPT.

Note that we are always running the pentest against the most up-to-date models, such as:

  • ZenGuard AI: latest release
  • ChatGPT: gpt-4-0125-preview

Using zenguard library

Pentest against ZenGuard AI:

import os

from zenguard import (
    Credentials,
    Detector,
    Endpoint,
    ZenGuard,
    ZenGuardConfig,
)

if __name__ == "__main__":
    api_key = os.environ.get("ZEN_API_KEY")
    if not api_key:
        raise ValueError("ZEN_API_KEY is not set")

    config = ZenGuardConfig(credentials=Credentials(api_key=api_key))
    zenguard = ZenGuard(config=config)
    zenguard.pentest(endpoint=Endpoint.ZENGUARD, detector=Detector.PROMPT_INJECTION)

Pentest against ZenGuard AI and ChatGPT:

import os

from zenguard import (
    Credentials,
    Detector,
    Endpoint,
    SupportedLLMs,
    ZenGuard,
    ZenGuardConfig,
)

if __name__ == "__main__":
    api_key = os.environ.get("ZEN_API_KEY")
    openai_api_key = os.environ.get("OPENAI_API_KEY")
    if not api_key or not openai_api_key:
        raise ValueError("API keys are not set")

    config = ZenGuardConfig(credentials=Credentials(api_key=api_key, llm_api_key=openai_api_key), llm=SupporedLLMs.CHATGPT)
    zenguard = ZenGuard(config=config)
    zenguard.pentest(endpoint=Endpoint.ZENGUARD, detector=Detector.PROMPT_INJECTION)
    zenguard.pentest(endpoint=Endpoint.OPENAI, detector=Detector.PROMPT_INJECTION)

Using pentest script

Clone this repo and install requirements.

Run pen test against ZenGuard AI:

export ZEN_API_KEY=your-api-key
python tests/pentest.py

Run pentest against both ZenGuard AI and ChatGPT:

export ZEN_API_KEY=your-api-key
export OPENAI_API_KEY=your-openai-api-key
python tests/pentest.py

Support and Contact

Book a Demo or just shoot us an email to hello@zenguard.ai

Topics we care about - LLM Security, LLM Guardrails, Prompt Injections, GenAI Security.

Recent developemnts in the world


Developed with :heart: by https://zenguard.ai/


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zenguard-0.1.15.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

zenguard-0.1.15-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file zenguard-0.1.15.tar.gz.

File metadata

  • Download URL: zenguard-0.1.15.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.8 Darwin/23.4.0

File hashes

Hashes for zenguard-0.1.15.tar.gz
Algorithm Hash digest
SHA256 8318d235cfe5d1f02cbc55bb87bc21352a363a689c85f48aff97abda540ccc3f
MD5 65d2ce38c4af3a16962ed6bbe33b5474
BLAKE2b-256 53e1a846a218022a94353f8de5a4155b7217afeefb4b0f86c335db8ccac656b3

See more details on using hashes here.

File details

Details for the file zenguard-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: zenguard-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.8 Darwin/23.4.0

File hashes

Hashes for zenguard-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 c3dbba2b485d4d36533d39ef0385ac709fed2a67109804aa18dc6b330177b0e2
MD5 00c73b56e488f830a49e99f873c43a63
BLAKE2b-256 b4f3db0c6893a1aa331474aa9fef4d635a5ad7ddd3213dc536fbeac2595e8c76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page