# zenguard-ai/fast-llm-security-guardrails architecture

> Architecture diagram of the GitHub repository zenguard-ai/fast-llm-security-guardrails, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zenguard-ai/fast-llm-security-guardrails
- Repository: https://github.com/zenguard-ai/fast-llm-security-guardrails

## Overview

ZenGuard is a small Python client for ZenGuard’s hosted detection API. A caller configures credentials and a service tier, then submits text with one or more detector choices; the client validates the request, selects an endpoint, and returns the API response. The README documents prompt-injection, jailbreak, PII, topic, keyword, and secrets protections, but this repository exposes detector paths rather than implementing their analysis. The graph therefore focuses on the client’s runtime behavior; detector capabilities share the enum that defines their endpoints.

Main entry points: [`zenguard/zenguard.py`](https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py) (ZenGuard client)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("AI application"))
node_config["Client configuration<br/>[zenguard.py]"]
node_client["ZenGuard client<br/>[zenguard.py]"]
node_detectors["Detector choices<br/>[zenguard.py]"]
node_api["ZenGuard API"]

node_caller -->|"provides credentials"| node_config
node_caller -->|"submits prompt"| node_client
node_config -->|"configures tier"| node_client
node_caller -->|"selects detectors"| node_detectors
node_client -->|"selects endpoint"| node_detectors
node_client -->|"posts request"| node_api
node_api -->|"returns response"| node_client

click node_config "https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py"
click node_client "https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py"
click node_detectors "https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_caller toneIndigo
class node_config,node_client toneBlue
class node_detectors toneTeal
class node_api toneMint
```

## Components

### Other components

- **AI application**
- [Client configuration](https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py): `zenguard/zenguard.py`
- [ZenGuard client](https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py): `zenguard/zenguard.py`
- [Detector choices](https://github.com/zenguard-ai/fast-llm-security-guardrails/blob/main/zenguard/zenguard.py): `zenguard/zenguard.py`
- **ZenGuard API**

## Connections

- AI application → Client configuration: provides credentials (evidence: `README.md`)
- AI application → ZenGuard client: submits prompt (evidence: `README.md`)
- Client configuration → ZenGuard client: configures tier (evidence: `zenguard/zenguard.py`)
- AI application → Detector choices: selects detectors (evidence: `README.md`)
- ZenGuard client → Detector choices: selects endpoint (evidence: `zenguard/zenguard.py`)
- ZenGuard client → ZenGuard API: posts request (evidence: `zenguard/zenguard.py`)
- ZenGuard API → ZenGuard client: returns response (evidence: `zenguard/zenguard.py`)
