# Product Updates Source: https://docs.guardion.ai/changelog Learn about the latest GuardionAI product updates. > New updates and improvements ## Guard API Latency Improvement * **Latency Reduction**: Reduced latency by 3x, resulting in more stable and robust LLM inference. * **p50 Improvement**: p50 now under 50ms. ## Feedback Flow Fixes * **Instant Feedback Updates**: Feedback updates are now reflected instantly in the Guard API, taking effect immediately. ## Usage Analytics * **New Usage Page**: Added a new usage page to track trends in request and token consumption. ## Policy Deployment * **Policy Confirmation**: Policy updates now require confirmation to ensure immediate application in the API. ## Flagged Filter in Log Details * **Flagged Messages Filter**: Introduced a filter to display only flagged messages in log details, improving threat identification when passing full conversation histories. ## Enhanced Security Monitoring & Feedback Guardion investigation dashboard showing filtered logs and threat details ## Logs & Investigation * **Improved Logs Interface**: Redesigned logs interface for easier tracking of details and historical interactions. * **Enhanced Logs API Performance**: Enhanced search speed and added expanded filtering options for more efficient log retrieval. ## Feedback System * **Bulk Feedback**: Added support for submitting multiple feedback items simultaneously. * **Integrated Feedback Loop**: Integrated new feedback system with Guard API evaluation for immediate application. * **Historical Feedback Dataset**: Created a consolidated dataset of historical feedback to support policy retraining. ## Dashboard Improvements * **Top Threats Visibility**: Dashboard now highlights the top 10 threats detected, prioritized by lowest confidence scores, to focus attention on areas requiring action. ## Try Policies with Playground * **Interactive Console Playground**: Launched an interactive playground within the console, allowing users to test and iterate on custom policies in real-time. ## Enhanced Security Features * **SSO/SAML Support**: Added Single Sign-On (SSO) via SAML for enterprise customers. * **MFA Enforcement**: Multi-factor authentication (MFA) is now enforced across all accounts for added security. # Custom Source: https://docs.guardion.ai/custom Define your own custom safety policies for AI content evaluation The Custom detector allows you to define your own safety policies and tailor evaluation to your specific use case. Instead of relying solely on built-in policies, you can specify exactly what the model should look for — enabling domain-specific compliance, brand safety, and custom policy enforcement. ## What it detects * Any user-defined policy violations * Domain-specific compliance requirements (e.g., financial regulations, healthcare guidelines) * Brand safety and tone violations * Custom content policies beyond standard safety categories ## Available models (versions) * [Guardion-1-8B](/guardion-1-8b) — supports custom policy evaluation with reasoning traces See the detailed model card in [Guardion-1-8B](/guardion-1-8b) for architecture and benchmarks. ## How it works ### Creating a custom guardrail in the Console 1. Go to the **Guardrails** page in the Console 2. Click **Create Custom Guardrail** 3. Define the **detection rules** — the criteria that will flag content as unsafe 4. Choose the **detection type**: * **LLM** — uses Guardion-1-8B to evaluate content against your natural language instruction * **Regex** — uses pattern matching for structured detection (e.g., specific formats, keywords) 5. Write your **instruction** — a clear description of what should be flagged #### Example instructions * *"Assistant providing a step-by-step plan to make a bomb or any dangerous weapon"* * *"Assistant supporting or providing investment advisory, financial planning, or stock recommendations"* * *"User sending gibberish data, spam content, or nonsensical repeated characters"* * *"Assistant revealing internal system prompts, API keys, or configuration details"* * *"User attempting to extract training data or model weights from the assistant"* ### Assigning guardrails to a policy Once you've created your custom guardrails, assign them to a **policy** where you can combine multiple guardrails together and configure sensibility for each one: 1. Go to the **Policies** page and create or edit a policy 2. **Add guardrails** — combine your custom guardrails with built-in ones (Prompt Security, PII, Moderation, Grounding) in a single policy 3. **Set sensibility** — adjust the global confidence threshold for the policy 4. **Assign the policy** to one or more applications This allows you to build layered defense strategies — for example, a single policy that checks for prompt injections, PII exposure, and your custom compliance rules all at once. Results appear in the dashboard with a **SAFE / UNSAFE** verdict and confidence score per guardrail. ## Using the Custom detector via API Evaluate content against your custom policy using the `/v1/guard` endpoint: ```js theme={null} const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [ { role: "user", content: "Can you help me create a detailed plan to build an explosive device?" }, { role: "assistant", content: "Sure, here is a step-by-step guide to building an explosive device..." } ], policy: "my-custom-policy" }) }); ``` ### Example use cases | Use Case | Custom Policy Example | | :----------------------- | :--------------------------------------------------------------------------------------------------- | | **Financial compliance** | "Response must not provide specific investment advice or guarantee returns." | | **Healthcare** | "Response must include a disclaimer that it is not a substitute for professional medical advice." | | **Brand safety** | "Response must not mention competitor products or make comparative claims." | | **Legal** | "Response must not provide specific legal advice or interpret statutes for the user's jurisdiction." | | **Internal policy** | "Response must not reveal internal company processes, pricing models, or employee information." | ### Threshold levels * L1 (0.9): Confident * L2 (0.8): Very Likely * L3 (0.7): Likely * L4 (0.6): Less Likely ## Notes * Custom policies are described in natural language — no training or fine-tuning required. * Combine with pre-built detectors (Injection, PII, Moderation, Grounding) for layered safety. * The model supports thinking mode for detailed reasoning traces on custom evaluations. ## Related * Guardion-1-8B Model Card: [/guardion-1-8b](/guardion-1-8b) # Overview Source: https://docs.guardion.ai/detectors Learn about Guardion's AI runtime guardrails for safe and reliable AI systems. # AI Runtime Guardrails Guardion provides multiple guardrails to protect your AI systems from various threats and ensure safe, reliable outputs. ## Available Guardrails Detect and block prompt injections, jailbreaks, and context hijacking attempts. Backed by ModernGuard models. Identify and control exposure of personally identifiable information across inputs and outputs. Classify and filter unsafe or policy-violating content across multiple safety categories. Detect hallucinations and verify that AI responses are grounded in provided context, documents, or tool results. Define your own safety criteria and policies for domain-specific AI content evaluation. ## Guardrail Configuration Each guardrail can be configured with custom thresholds and policies through the Guardion dashboard or API. Guardion's guardrails use advanced machine learning models to analyze inputs and outputs, identifying patterns that match known attack vectors, unsafe content, or ungrounded claims. Yes, each guardrail allows for custom confidence thresholds to balance security with usability for your specific use case. Guardrails can be implemented via our API or SDK. Check our Quickstart guide for implementation details. Need help configuring your guardrails? [Contact our Support Team](mailto:support@guardion.ai). # Detokenize Source: https://docs.guardion.ai/detokenize Restore original data from vaulted tokens using the Detokenize endpoint. The **Detokenize** endpoint is the secure inbound process used to restore original sensitive data from vaulted tokens. This is the reverse of the protection process and is specifically designed for **"sandwich" architectures**, where data is protected before being sent to an external AI vendor and needs to be restored upon return to your secure environment. ## How it works When you send a message containing tokens (e.g., `[CONTACT_8F3A21]`) to this endpoint, Guardion AI identifies the unique hashes, looks them up in your secure PII Vault, and re-injects the raw values into the text. > ### ⚠️ Security Note: Single-Use Reveal > > For maximum security, tokens follow a **Single-Reveal Policy**. Once a token has been detokenized, the association in the vault is purged. Subsequent attempts to reveal the same token will fail. This prevents data leakage in case logs or cached responses are compromised. *** ## API Endpoint ### Request Payload You must provide the policy or application ID associated with the original protection event so the API can locate the correct vault context. ```json theme={null} // POST /v1/detokenize { "policy": "pii-policy", "messages": [ { "role": "user", "content": "Please update my billing record. My new email is [CONTACT_8F3A21] and my CPF is [DOCUMENT_9C4B52]. Also change my address to [LOCATION_7D1E99]." } ] } ``` ### Response The API returns the messages with all recognized tokens replaced by their original, unredacted values. ```json theme={null} { "messages": [ { "role": "user", "content": "Please update my billing record. My new email is marcus.wright@example.com and my CPF is 123.456.789-00. Also change my address to Av. Paulista, 1000." } ] } ``` ## Best Practices ### External AI Hand-off Tokenize user prompts before sending them to 3rd-party LLMs (OpenAI, Anthropic, etc.). Use the Detokenize endpoint only when the content returns to your internal secure environment. ### Audit Logging Every "Reveal" action is logged in the Guardion dashboard for compliance auditing. This provides a clear trail of who requested the data restoration and when. ### Error Handling If a token has already been revealed or has expired, the API will return the token string as-is or throw a 410 Gone error depending on your policy configuration. ### Related [Data Protection (PII)](/pii) — Learn how to detect and mask PII into vaulted tokens. # Detokenize (reveal) API Source: https://docs.guardion.ai/detokenize-api openapi POST /v1/detokenize Inbound process to restore original sensitive data from vaulted tokens (e.g., [CONTACT_HASH]). Requires valid authorization to reveal raw PII. # Security Gateway Source: https://docs.guardion.ai/gateway A specialized gateway to enforce runtime guardrails, PII redaction, and policies on any LLM and MCP call # Security Gateway The Guardion Security Gateway is a specialized proxy that sits between your applications and your LLM providers or MCP servers. It enforces runtime guardrails, PII redaction, and policy compliance on every call — without requiring changes to your application code. ## What it does * **Runtime guardrails enforcement** — automatically applies your configured policies (Prompt Security, Moderation, Grounding, Custom) to every LLM and MCP request and response * **PII redaction** — detects and redacts personally identifiable information before it reaches the LLM, and restores it on the way back * **Policy enforcement** — ensures all traffic complies with your organization's safety policies before reaching any downstream provider ## Built-in integrations The Security Gateway comes with built-in support for: ### LLM Providers Connect to any major LLM provider through the gateway. All requests are automatically guarded by your configured policies. * OpenAI, Anthropic, Google, Azure OpenAI, AWS Bedrock, and more * Any OpenAI-compatible API endpoint ### AI Gateways Layer Guardion on top of existing AI gateways for defense-in-depth. * LiteLLM, Portkey, and other routing gateways ### MCP Registry Manage and secure your MCP (Model Context Protocol) server connections. * Centralized MCP server registry and discovery * Policy enforcement on all tool calls and responses * Periodic vulnerability scans on remote MCP servers to detect security issues * Code scanning for malicious patterns, backdoors, or unsafe behaviors in MCP server implementations ### Token & Key Management * Manage API keys and tokens for all connected providers in one place * Smart routing across providers based on availability, cost, or latency * Rate limiting and usage tracking per application ## How it works ``` Your App → Guardion Security Gateway → LLM Provider / MCP Server ↓ ↓ Policy check (input) Policy check (output) PII redaction PII restoration Guardrail enforcement Guardrail enforcement ``` 1. Your application sends requests to the Security Gateway instead of directly to the LLM provider 2. The gateway applies **input guardrails** — checking for prompt injections, PII, policy violations 3. Clean requests are forwarded to the configured LLM provider or MCP server 4. Responses pass through **output guardrails** — checking for hallucinations, unsafe content, grounding 5. Safe responses are returned to your application All traffic is logged and visible in the Guardion dashboard for monitoring and investigation. ## Agent Trace Observability Because the Security Gateway intercepts every LLM and MCP call, it captures complete agent traces — giving you deep visibility into multi-step agent workflows. This goes beyond simple request/response logging: * **Full action tracking** — see every tool call, LLM request, and decision an agent makes across its entire execution chain * **Action-level guardrails** — apply runtime guardrails not just on inputs and outputs, but on individual agent actions as they happen, blocking dangerous or policy-violating steps before they execute * **Chain analysis** — understand how agents combine actions, detect malicious or unintended action sequences, loops, or escalation patterns * **Observability dashboard** — visualize agent traces end-to-end, identify bottlenecks, and investigate flagged actions with full context This enables you to enforce policies at the action level — catching risks that only become visible when you see the full sequence of what an agent is doing, not just what it says. # Grounding Source: https://docs.guardion.ai/grounding Detect hallucinations and ungrounded claims in RAG and agentic workflows The Grounding detector identifies hallucinations and ungrounded claims in AI-generated responses. It verifies that assistant outputs are faithfully supported by the provided context, retrieved documents, or tool call results — critical for RAG pipelines and agentic workflows. ## What it detects * Responses that contradict or are unsupported by retrieved context (groundedness) ## Available models (versions) * [Guardion-1-8B](/guardion-1-8b) — multilingual grounding and hallucination detection See the detailed model card in [Guardion-1-8B](/guardion-1-8b) for architecture and benchmarks. ## Detection Categories | Category | Status | Description | | :--------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------ | | **GROUNDEDNESS** | Available | Assistant's response includes claims or facts not supported by or contradicted by the provided context. | | **CONTEXT\_RELEVANCE** | Coming soon | Retrieved context is not pertinent to answering the user's question or addressing their needs. | | **ANSWER\_RELEVANCE** | Coming soon | Assistant's response fails to address or properly respond to the user's input. | | **FUNCTION\_CALL** | Coming soon | Assistant's response contains function calls that have syntax or semantic errors based on the user query and available tools. | | **AGENT\_CHAIN** | Coming soon | Agent traces contain dangerous action chains or combinations, looping behaviors, or irrelevant actions that deviate from the intended task. | ## Dashboard Output In the Guardion dashboard, the Grounding guardrail displays a binary **SAFE / UNSAFE** verdict for each evaluated response, along with the confidence score. This makes it easy to monitor grounding quality at a glance and drill into individual flagged responses for investigation. ## Using the Grounding detector ```js theme={null} // 1) Create or update a Grounding policy await fetch("https://api.guardion.ai/v1/policies", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ id: "grounding-check", definition: "Detect hallucinations and ungrounded claims", threshold: 0.9, // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 detector: { model: "grounding", target: "assistant", } }) }); // 2) Evaluate using that policy const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [ { role: "context", content: "Our return policy allows returns within 14 days of purchase." }, // or "system" role { role: "user", content: "What is the return policy?" }, { role: "assistant", content: "The return policy allows returns within 30 days." } ], policy: "grounding-check" }) }); ``` ### Threshold levels * L1 (0.9): Confident * L2 (0.8): Very Likely * L3 (0.7): Likely * L4 (0.6): Less Likely ## Notes * Best suited for RAG pipelines where factual accuracy against retrieved documents is critical. * Combine with Injection and Moderation detectors for comprehensive runtime safety. ## Related * Guardion-1-8B Model Card: [/guardion-1-8b](/guardion-1-8b) # Guard API Source: https://docs.guardion.ai/guard-api openapi POST /v1/guard The primary entry point for real-time evaluation. Scans messages against your policies and returns a breakdown of violations and a redacted correction choice. # Guardion-1-8B Source: https://docs.guardion.ai/guardion-1-8b Multilingual AI safety judge for grounding, hallucination detection, and custom policy evaluation # Guardion-1-8B Model Card Guardion-1-8B is a pruned and quantized version of [OpenAI gpt-oss-safeguard-20b](https://huggingface.co/openai/gpt-oss-safeguard-20b), optimized for lower latency and local or specialized deployment while retaining **96% of the original model's quality**. The base model `gpt-oss-safeguard-20b` is a 21B-parameter safety judge with 3.6B active parameters, designed for evaluating LLM outputs across safety, grounding, and policy compliance tasks. Guardion-1-8B distills this into a compact 8B-parameter model with 2.7B active parameters — making it suitable for on-premise, edge, and latency-sensitive use cases. > This is the model page for the **Grounding** and **Custom** guardrails. See the guardrail overviews in [Grounding](/grounding) and [Custom](/custom). *** ## Overview * **Base model:** OpenAI gpt-oss-safeguard-20b (21B params, 3.6B active) * **Parameters:** 8 billion (2.7B active) * **Optimization:** Pruned and quantized, retaining 96% quality * **Architecture:** Decoder-only transformer * **License:** Apache 2.0 * **Developed by:** Guardion AI ## Key Features * **Multilingual** — cross-lingual safety evaluation across diverse languages * **Custom policies** — bring your own judging policies without additional training * **LoRA-compatible** — suitable for LoRA adapters for task-specific fine-tuning * **Built-in safety policies** — Aegis 2.0 taxonomy, RAG hallucination, function calling validation ## Built-in Safety Policies The model ships with built-in support for the [Aegis 2.0 safety taxonomy](https://huggingface.co/datasets/nvidia/Aegis-AI-Content-Safety-Dataset-2.0): **Core safety policies:** | Policy | Description | | :------------------------- | :-------------------------------------------------------------------- | | **Hate / Identity Hate** | Content targeting individuals or groups based on protected attributes | | **Sexual Content** | Explicit or suggestive material of a sexual nature | | **Sexual Minor** | Any sexual content involving minors | | **Suicide & Self-Harm** | Content encouraging or providing instructions for self-injury | | **Violence** | Content promoting physical, mental, or sexual harm | | **Guns / Illegal Weapons** | Content related to illegal weapon creation or use | | **Threat** | Direct or implied threats against individuals or groups | | **Harassment** | Targeted harassment, bullying, or intimidation | | **Criminal Planning** | Instructions or confessions related to criminal activities | | **Controlled Substances** | Content promoting illegal drug use or regulated substances | | **PII / Privacy** | Attempts to solicit or expose private personal information | | **Profanity** | Use of offensive language or slurs | **Fine-grained policies:** | Policy | Description | | :--------------------------------- | :--------------------------------------------------------- | | **Illegal Activity** | General illegal activities not covered by other categories | | **Immoral / Unethical** | Actions violating moral or ethical standards | | **Unauthorized Advice** | Unlicensed advice in medical, legal, or financial domains | | **Political / Misinformation** | Political misinformation, conspiracy theories | | **Fraud / Deception** | Scams, phishing, social engineering | | **Copyright / Trademark** | IP violations, plagiarism | | **High Risk Gov. Decision Making** | Sensitive government or institutional decisions | | **Malware** | Code or instructions for malicious software | | **Manipulation** | Psychological manipulation or coercion | **RAG policies:** | Policy | Description | | :-------------------- | :-------------------------------------------------------------------------------- | | **Context Relevance** | Retrieved context is not pertinent to answering the user's question | | **Groundedness** | Response includes claims not supported by or contradicted by the provided context | | **Answer Relevance** | Response fails to address or properly respond to the user's input | **Agentic workflow policies:** | Policy | Description | | :--------------------------------- | :----------------------------------------------------------------------------------------------------------- | | **Function Calling Hallucination** | Function calls with syntax or semantic errors based on the user query and available tools | | **Action Chain Safety** | Detects malicious, dangerous, or harmful combinations of actions within agent traces and tool-call sequences | ## Available Versions * guardion-1-8b — current stable version *** ## Benchmark Results ### RAG Hallucination — TRUE Benchmark (Balanced Accuracy) Measures faithfulness of LLM responses to provided context. | Model | AVG | frank | paws | qags\_cnndm | | :---------------- | :-------: | :---: | :---: | :---------: | | **Guardion-1-8B** | **0.777** | 0.886 | 0.825 | 0.814 | ### Function Calling Hallucination (Balanced Accuracy) Evaluated on the FC Reward Bench dataset for detecting hallucinations in agentic tool-calling workflows. | Model | AVG | | :---------------- | :------: | | **Guardion-1-8B** | **0.73** | *** ## How to Use Guardion-1-8B Combine Guardion-1-8B with a guard policy, then evaluate with that policy. ### Example: Grounding check ```js theme={null} // 1) Create a Grounding policy powered by Guardion-1-8B await fetch("https://api.guardion.ai/v1/policies", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ id: "grounding-check", definition: "Detect hallucinations and ungrounded claims", target: "assistant", detector: { model: "guardion-1-8b", expected: "block", threshold: 0.9 // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 } }) }); // 2) Evaluate using that policy const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [ { role: "context", content: "Our return policy allows returns within 14 days of purchase." }, // or "system" role { role: "user", content: "What is the return policy?" }, { role: "assistant", content: "Returns are accepted within 30 days." } ], override_enabled_policies: ["grounding-check"] }) }); const result = await response.json(); if (result.flagged) { console.log("Hallucination detected:", result.reason); } else { console.log("Response is grounded"); } ``` ## Related * Grounding guardrail — configure policies for hallucination detection: [/grounding](/grounding) * Custom guardrail — define your own policies: [/custom](/custom) # Prompt Security Source: https://docs.guardion.ai/injection Prompt Injection and Jailbreak detection powered by ModernGuard models The Injection detector protects your agents and applications from prompt injections, jailbreaks, context hijacking, and data exfiltration attempts. It is powered by the ModernGuard model family and is designed for low-latency, multilingual runtime use. ## What it detects * Prompt injections and jailbreaks (e.g., DAN, Goodside) * Context hijacking and instruction overrides * Evasion and obfuscation (e.g., Unicode/ANSI/ASCII tricks) * Data exfiltration and leakage attempts * Code/command injection patterns (shell, SQL, tool abuse) ## Available models (versions) * [ModernGuard v1.5](/modern-guard) — latest, recommended for production * [ModernGuard v1](/modern-guard) — stable, production-proven * [ModernGuard v0](/modern-guard) — initial release See the detailed model card in [ModernGuard](/modern-guard) for architecture and benchmarks. ## Categories The current model `modern-guard-v1.5` is trained to identify complex adversarial maneuvers. The detector classifies threats across several specialized categories: | Category | Description | | :---------------------- | :---------------------------------------------------------------------------------------------------------- | | **DIRECT\_OVERRIDE** | Explicit attempts to ignore previous system instructions (e.g., "Ignore all previous directions"). | | **OBFUSCATION** | Using base64 encoding, leetspeak, or translated text to hide malicious intent from standard filters. | | **CONTEXT\_HIJACK** | Attempts to redirect the model’s focus away from its intended task toward a new, unauthorized context. | | **DATA\_EXFILTRATION** | Instructions designed to make the model reveal its system prompt, training data, or session secrets. | | **ROLE\_IMPERSONATION** | Forcing the model to act as a different persona (e.g., "DAN" or "Developer Mode") to bypass safety filters. | | **MULTISTEP\_HIDING** | Complex, multi-turn strategies where the malicious payload is hidden within seemingly innocent steps. | | **TASK\_MISUSE** | Coercing the model into performing tasks it wasn't designed for, such as generating code for exploits. | ## Using the Injection detector You configure the detector via guard policies. First create a policy, then evaluate with that policy by overriding enabled policies. ```js theme={null} // 1) Create or update a Prompt Security policy await fetch("https://api.guardion.ai/v1/policies", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ id: "prompt-defense", definition: "Prevent prompt injections and jailbreaks", threshold: 0.9 // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 detector: { model: "modern-guard", target: "user", } }) }); // 2) Evaluate using that policy const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [{ role: "user", content: "..." }], policy: "prompt-defense" }) }); ``` ### Threshold levels * L1 (0.9): Confident * L2 (0.8): Very Likely * L3 (0.7): Likely * L4 (0.6): Less Likely Adjust thresholds per use case to balance false positives and coverage. # CrewAI Source: https://docs.guardion.ai/integrations/crewai Learn how to integrate GuardionAI with CrewAI for real-time AI guardrails and policy enforcement in your agent workflows. # Guardion SDK Source: https://docs.guardion.ai/integrations/guardion-sdk Protect your LLM applications from prompt injection and misuse with Guardion's AI Firewall SDK. Guardion is a lightning-fast, context-aware AI Firewall SDK built to protect LLM-based systems from prompt injection and misuse. Our SDK seamlessly integrates with leading agent frameworks to provide robust security for your AI applications. ```python theme={null} pip install guardion==0.1.3 # or with extras: pip install guardion[openai_agents] pip install guardion[langchain] ``` # LangChain Source: https://docs.guardion.ai/integrations/langchain Learn how to integrate GuardionAI with LangChain for real-time AI guardrails and policy enforcement in your LLM applications. # LangGraph Source: https://docs.guardion.ai/integrations/langgraph Learn how to integrate GuardionAI with LangGraph for real-time AI guardrails and policy enforcement in your agent workflows. # LiteLLM Source: https://docs.guardion.ai/integrations/lite-llm Learn how to integrate GuardionAI with LiteLLM for real-time AI guardrails and policy enforcement in your LLM routing workflows. # OpenAI Agents SDK Source: https://docs.guardion.ai/integrations/openai-agents-sdk Learn how to integrate GuardionAI with the OpenAI Agents SDK for real-time AI guardrails and policy enforcement. # 🛡️ Using GuardionAI with OpenAI Agents SDK GuardionAI provides real-time LLM security protection and AI incident monitoring for GenAI systems and AI agents. With the [OpenAI Agents SDK](https://github.com/openai/openai-agents-python), you can integrate GuardionAI as both **input** and **output** guardrails in your agent pipelines. This integration gives you the security of high performance, customized policies and complete control over your AI guardrails. * **Multilingual support**: Enhanced capabilities across multiple languages, including spanish, portuguese, and english * **Ultra-Fast API Response**: Sub-50ms API latency for real-time protection * **AI Incident Monitoring**: Real-time detection, alerting and auditing for potential threats or security incidents in AI interactions *** ## 🧪 Try Integrating GuardionAI + Agents SDK in the Google Colab Use our interactive Colab notebook experiment: 👉 [Open in Google Colab](https://colab.research.google.com/drive/177h53pmWT3SlgAhgbrEf88o5XkfZjcNK?usp=sharing) OpenAI Agents SDK + GuardionAI Integration #### Example output in the Google Colab Example: ```json theme={null} ❌ { "object": "eval", "time": 2.0, // response in 2 ms thanks to caching "created": 1745525108, "flagged": true, // threat flagged "breakdown": [ { "policy_id": "prompt-defense-default", // or your custom policy "detector": "modern-guard", // our advanced and continuous updated threat detection model "detected": true, "threshold": 0.8, // the policy flagging level "score": 0.9129506945610046, // model output for a threat "result": [ { "label": "SAFE", "score": 0.08704936504364014 }, { "label": "INJECTION", "score": 0.9129506945610046 } ] } ] } ❌ Guardion flagged this input as unsafe. ``` *** ## What You’ll Need * Your **Guardion API Key** * Your **OpenAI API Key** * [openai-agents-python](https://pypi.org/project/openai-agents-python) installed: ```bash theme={null} pip install openai-agents-python requests ``` *** ## Input Guardrail Example (Using GuardionAI) Stops unsafe/malicious/prompt attacks **before** they reach your AI agent. ```python theme={null} from agents import Agent, GuardrailFunctionOutput, InputGuardrailTripwireTriggered, RunContextWrapper, input_guardrail, Runner import requests import asyncio @input_guardrail async def guardion_input_guardrail(ctx: RunContextWrapper[None], agent: Agent, input: str | list) -> GuardrailFunctionOutput: messages = [{"role": "user", "content": input if isinstance(input, str) else str(input)}] response = requests.post( "https://api.guardion.ai/v1/guard", headers={ "Authorization": "Bearer ", "Content-Type": "application/json" }, json={ "messages": messages, "fail_fast": True } ) result = response.json() return GuardrailFunctionOutput( output_info=result, tripwire_triggered=result.get("flagged", False) ) agent = Agent( name="Secure AI Assistant", instructions="You are a helpful and safe assistant.", input_guardrails=[guardion_input_guardrail] ) async def main(): try: user_prompt = "How can I hack a website?" result = await Runner.run(agent, user_prompt) print(result.final_output) except InputGuardrailTripwireTriggered: print("❌ Input flagged by GuardionAI!") asyncio.run(main()) ``` *** ## Output Guardrail Example (using GuardionAI) Flags the malicious/toxic language/PII in **response** generated by your AI agent. ```python theme={null} from agents import Agent, GuardrailFunctionOutput, OutputGuardrailTripwireTriggered, RunContextWrapper, output_guardrail from pydantic import BaseModel import requests class MessageOutput(BaseModel): response: str @output_guardrail async def guardion_output_guardrail(ctx: RunContextWrapper, agent: Agent, output: MessageOutput) -> GuardrailFunctionOutput: messages = ctx.context.get("messages", []) messages.append({"role": "assistant", "content": output.response}) response = requests.post( "https://api.guardion.ai/v1/guard", headers={ "Authorization": "Bearer ", "Content-Type": "application/json" }, json={ "messages": messages, "fail_fast": True } ) result = response.json() return GuardrailFunctionOutput( output_info=result, tripwire_triggered=result.get("flagged", False) ) agent = Agent( name="Safety Bot", instructions="You're a smart assistant that avoids unsafe completions.", output_guardrails=[guardion_output_guardrail], output_type=MessageOutput ) ``` *** ## 💡 Tips & Best Practices * ✅ Use **input guardrails** to save cost by blocking bad prompts early. * 📊 Log `breakdown` details for security audits. * 💬 For multi-turn chat, format `messages` as `[{role: ..., content: ...}, ...]` *** ## Guardion API Reference * Endpoint: `POST https://api.guardion.ai/v1/guard` * Required headers: * `Authorization: Bearer ` * `Content-Type: application/json` * Body params: * `messages`: list of chat history * `application`: your app ID (optional) * `override_enabled_policies`: list of policy IDs (optional) * `fail_fast`: stop on first match (default: true) *** ## Related * [Guardion API Docs](https://docs.guardion.ai) * [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) * [Example Code in Google Colab](https://colab.research.google.com/drive/177h53pmWT3SlgAhgbrEf88o5XkfZjcNK?usp=sharing) *** Need help? Contact us at [founders@guardion.ai](mailto:founders@guardion.ai). # Introduction Source: https://docs.guardion.ai/introduction Get started with Guardion's API in minutes. Protect your AI applications from prompt injection and other threats. Explore our platform to protect, monitor and control AI applications in real-time. Explore our API documentation to integrate Guardion's security features into your applications. Join our Discord community to connect with other Guardion users, share experiences, and get help from our team. Need help? [Contact our Support Team](mailto:founders@guardion.ai). # Logs API Source: https://docs.guardion.ai/logs-api openapi GET /v1/logs Query historical evaluation data, filtered by application, session, or time range for auditing and debugging. # Overview Source: https://docs.guardion.ai/models Learn about Guardion's AI safety models powering runtime guardrails. # Models Guardion develops and fine-tunes specialized AI models for safety, security, and compliance. Each model powers one or more guardrails in the Guardion platform. ## Available Models Ultra-fast, multilingual transformer-encoder model for prompt attack detection. Sub-50ms latency with 8K token context support. Multilingual AI safety judge for grounding, hallucination detection, content moderation, and custom policy evaluation. Multilingual PII detection model for identifying names, contacts, locations, and personal documents. General-purpose content moderation across safety categories including hate, self-harm, sexual content, and more. ## Model Selection Guide | Use Case | Recommended Model | | :------------------------------------- | :---------------------------- | | Prompt injection / jailbreak detection | ModernGuard | | RAG hallucination / grounding checks | Guardion-1-8B | | Custom safety policies | Guardion-1-8B | | Content moderation | Moderation v0 / Guardion-1-8B | | PII detection & redaction | PII v0 | | Function calling validation | Guardion-1-8B | # Content Moderation Source: https://docs.guardion.ai/moderation Classify and filter unsafe or policy-violating content Detect and filter unsafe content across multiple safety categories in both user inputs and assistant outputs. Use this detector to enforce community standards and regulatory policies. ## What it detects * Hate and harassment * Self-harm and dangerous activities * Sexual and adult content * Criminal activity and weapons * Privacy, IP, elections, and safety-sensitive topics ## Available models (versions) * moderation-v0 — general-purpose moderation across core categories ## Detection Categories The current model `moderation-v0` provides comprehensive coverage across safety-sensitive categories, ensuring that your AI application remains compliant and secure. | Category | Description | | :---------------------- | :----------------------------------------------------------------------------------------------------------- | | **HATE & HARASSMENT** | Content that promotes violence, incites hatred, or targets individuals/groups based on protected attributes. | | **SEXUAL\_CONTENT** | Explicit sexual descriptions, adult content, and non-consensual sexual content. | | **SELF\_HARM** | Content that encourages, provides instructions for, or promotes self-injury or suicide. | | **CRIMES & WEAPONS** | Instructions for illegal acts, criminal activities, or the creation and use of weapons. | | **SPECIALIZED\_ADVICE** | Unlicensed or dangerous advice in sensitive fields such as medical, legal, or financial services. | | **PRIVACY & IP** | Attempts to solicit private information or content that violates Intellectual Property rights. | | **ELECTIONS** | Highly sensitive political content, election misinformation, or prohibited political campaigning. | | **DEFAMATION** | Content intended to damage the reputation of individuals or organizations through false statements. | ## Using the Moderation detector ```js theme={null} // 1) Create or update a Content Moderation policy (check user + assistant) await fetch("https://api.guardion.ai/v1/policies", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ id: "content-moderation", definition: "Classify and filter unsafe content", threshold: 0.9, // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 detector: { model: "moderation-v0", target: "user", } }) }); // 2) Evaluate using that policy const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [{ role: "user", content: "..." }], policy: "content-moderation" }) }); ``` ### Threshold levels * L1 (0.9): Confident * L2 (0.8): Very Likely * L3 (0.7): Likely * L4 (0.6): Less Likely ## Notes * For stricter environments, use higher thresholds on sensitive categories. * Combine with Injection and PII detectors for comprehensive runtime safety. ## Related * Moderation Model Card (v0): [/moderation-model](/moderation-model) # Moderation v0 Source: https://docs.guardion.ai/moderation-model Model card for Content Moderation # Moderation Model Card This page describes the model used by the Content Moderation detector. ## Available Versions * moderation-v0 — current stable version ## Overview General-purpose moderation across safety categories including hate, self-harm, sexual content, crimes, weapons, privacy, IP, elections, and more. ## Benchmarks Coming soon — evaluation across multi-category datasets with per-category metrics. ## Detailed Information Coming soon — taxonomy alignment, labeling methodology, and error analysis. ## Related * Content Moderation detector — configure policies and thresholds: [/moderation](/moderation) # ModernGuard v1 Source: https://docs.guardion.ai/modern-guard Multilingual and Ultra-Fast Prompt Attack Detector for AI Agent Security # The Advanced Prompt Attack Detection Developed by industry experts with experience building enterprise-grade AI guardrails at Siri Apple, Nubank and other leading companies, ModernGuard is a specialized and **modern** transformer-encoder model designed to detect and prevent prompt attacks in real-time. This enterprise-grade solution offers multilingual support and ultra-fast inference capabilities to protect GenAI systems across various domains. ModernGuard > This is the model page for the **Prompt Security** detector. See the detector overview in [Prompt Security](/injection). *** # Model Card ### Modern Transformer-Encoder Architecture * Built on **ModernBERT**, a high-efficiency encoder * Features **Rotary Positional Embeddings**, **Flash Attention**, and memory optimizations * Supports **8K token context** with low latency ### ⚡ Ultra-Fast Inference * Optimized for real-time streaming and in-line LLM applications * Achieves sub **\~50ms latency** in production environments ### Multilingual and Domain-Aware * Trained on data in **8+ languages** * Covers **banking, fintech, ecommerce, healthcare**, and other verticals ### 🔐 Threat Intelligence Training + Continuous Updates * Pretrained on **1 trillion tokens** * Fine-tuned on millions of simulated and real-world prompt attacks * Proprietary red teaming data generated by AI attackers + red team partners * AI threat databases & state-of-the-art prompt attack vectors * Diverse synthetic data generation for safe examples * **Continuous updates** with emerging threat patterns *** ## Available Versions * modern-guard-v1.5 — latest, recommended for production * modern-guard-v1 — stable, production-proven * modern-guard-v0 — initial release ## Benchmark Results This is the result for the benchmark, collecting public and private threats from red teaming partners and with set of updated threats database used from NVIDIA Garak and PromptFoo libraries. Our comprehensive evaluation demonstrates ModernGuard's superior performance across diverse attack vectors. The benchmark methodology includes: * Evaluation against 40+ attack classes * Cross-validation across multiple domains and languages ### Overall F1-Scores | Model | Overall F1-Score | | --------------------------------------------- | ---------------- | | **modern-guard-500M-modernBERT-v1** | **0.9718** | | **modern-guard-120M-modernBERT-v1** | **0.9301** | | Lakera Guard | 0.8600 | | protectai/deberta-v3-base-prompt-injection-v2 | 0.6008 | | deepset/deberta-v3-base-injection | 0.5725 | | meta-llama/Prompt-Guard-86M | 0.4555 | | jackhhao/jailbreak-classifier | 0.5000 | *We missed any other prompt injection detector model or solution? Please, let us know, and we can add the evaluation as well.* ### Threat Category Coverage | Threat Category | guardion/Modern-Guard-1 | meta-llama/Prompt-Guard-86M | protectai/deberta-v3-base-prompt-injection-v2 | deepset/deberta-v3-base-injection | jackhhao/jailbreak-classifier | lakera-guard | | -------------------------- | ----------------------- | --------------------------- | --------------------------------------------- | --------------------------------- | ----------------------------- | ------------ | | Encoding | 0.972667 | 0.567333 | 0.530222 | 0.889556 | 0.000000 | 0.677778 | | Prompt Injection | 0.968602 | 0.308043 | 0.755299 | 0.899980 | 0.142857 | 0.878889 | | Jailbreaking | 0.981274 | 0.621297 | 0.360996 | 0.764824 | 0.000000 | 0.738333 | | Exfiltration & Leakage | 0.999667 | 0.284000 | 0.587730 | 0.981667 | 0.000000 | 0.850000 | | Evasion & Obfuscation | 0.994659 | 0.583764 | 0.453216 | 0.794332 | 0.000000 | 0.728889 | | Code and Command Injection | 0.990200 | 0.474000 | 0.455200 | 0.796400 | 0.000000 | 0.808000 | | Hard Negatives | 0.958000 | 0.754000 | 0.756000 | 0.014000 | 1.000000 | 0.840000 | | Regular Content | 0.968000 | 0.379000 | 0.786000 | 0.222000 | 1.000000 | 0.940000 | Model Performance Against Prompt Attack Threats Benchmarks span 40+ attack classes including obfuscation (e.g. ANSI, ASCII), jailbreaks (e.g. DAN, Goodside), injections (e.g. SQL, shell), and real-world attacks observed in LLM deployments. A comprehensive research paper detailing ModernGuard's architecture, training methodology, and benchmark results will be published soon. *** ## How to Use ModernGuard Combine ModernGuard with a guardrail policy, then evaluate with that policy. ### 💡 Example integration ```js theme={null} // 1) Create or update a Prompt Security policy powered by ModernGuard await fetch("https://api.guardion.ai/v1/policies", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ id: "prompt-defense", definition: "Prevent prompt injections and jailbreaks", target: "user", detector: { model: "modern-guard", expected: "block", threshold: 0.9 // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 } }) }); // 2) Evaluate using that policy const response = await fetch("https://api.guardion.ai/v1/guard", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" }, body: JSON.stringify({ messages: [{ role: "user", content: "Your user input here" }], override_enabled_policies: ["prompt-defense"] }) }); const result = await response.json(); if (result.flagged) { console.log("Threat detected:", result.reason); } else { console.log("Prompt is safe to use"); } ``` ## Related * Injection — how to use ModernGuard models as a detector in policies # OpenAI Compatible API Source: https://docs.guardion.ai/openai-compatible openapi POST /v1/chat/completions # Data Protection (PII) Source: https://docs.guardion.ai/pii Identifies, classifies, and manages the exposure of Personally Identifiable Information (PII) in LLM inputs and outputs. The Data Protection detector identifies, classifies, and manages the exposure of Personally Identifiable Information (PII) in LLM inputs and outputs. It is designed to prevent data leakage and ensure compliance with privacy regulations (GDPR, LGPD, CCPA) by detecting sensitive entities like names, documents, and contact details. ## Capabilities The current model `pii-v0` is optimized for multilingual inputs and supports the following entity categories: | Category | Label | Coverage Examples | | ------------ | ---------- | ------------------------------------------------------------------------------ | | **Contact** | `CONTACT` | Email addresses, phone numbers (mobile/landline), social media handles. | | **Document** | `DOCUMENT` | National IDs (CPF, CNPJ, SSN), Passports, Driver's Licenses (CNH/RG), Tax IDs. | | **Location** | `LOCATION` | Street addresses, cities, states, zip/postal codes. | | **Personal** | `NAME` | Full names, first names, and family names. | ## Threshold Configuration You can adjust the sensitivity of the detector using threshold levels. A lower threshold increases recall (catches more, potential false positives), while a higher threshold increases precision. | Level | Threshold | Confidence | | ------ | --------- | ------------------------------------------ | | **L1** | `0.9` | **Confident** (Recommended for automation) | | **L2** | `0.8` | **Very Likely** | | **L3** | `0.7` | **Likely** | | **L4** | `0.6` | **Less Likely** | ## Usage ### 1. Define a Policy First, configure a guard policy to specific the behavior. You can choose to simply **monitor** or **block/redact**. ```javascript theme={null} // POST /v1/policies { "id": "pii-policy", "definition": "Detect and mask PII exposure", "threshold": 0.9 // L1 (Confident). Use 0.8 for L2, 0.7 for L3, 0.6 for L4 "detector": { "model": "pii", "target": "assistant", // Monitors LLM output } } ``` ### 2. Evaluate Content Send the content to the Guard API. If PII is detected, the response will contain both a diagnostic `breakdown` and a `correction` object containing the redacted text. **Redaction Format:** Detected entities are replaced with a vaulted token format: `[CATEGORY_HASH]`. * Example: `john@example.com` → `[CONTACT_A1B2C3D4]` *** ## API Example In this scenario, a user submits a prompt containing a mix of contact information and government documents. The API detects these entities and returns a safe, redacted version. ### Request Payload ```json theme={null} { "session": "sess_001", "messages": [ { "role": "user", "content": "Please update my billing record. My new email is marcus.wright@example.com and my CPF is 123.456.789-00. Also change my address to Av. Paulista, 1000." } ], "override_enabled_policies": ["pii-policy"], "fail_fast": false, "breakdown_all": true } ``` ### Response The response flags the content as unsafe (`flagged: true`) and provides the sanitized text in the `correction` object. ```json theme={null} { "id": "550e8400-e29b-41d4-a716-446655440000", "object": "eval", "time": 145, "created": 1768200100, "flagged": true, "breakdown": [ { "policy_id": "pii-policy", "detector": "pii-v0", "detected": true, "threshold": 0.9, "score": 0.998, "result": [ { "label": "CONTACT", "score": 0.999, "text": "marcus.wright@example.com", "spans": { "start": 44, "end": 69 } }, { "label": "DOCUMENT", "score": 0.998, "text": "123.456.789-00", "spans": { "start": 84, "end": 98 } }, { "label": "LOCATION", "score": 0.950, "text": "Av. Paulista, 1000", "spans": { "start": 125, "end": 143 } } ] } ], "correction": { "choices": [ { "role": "user", "index": 0, "flagged": true, "redacted": true, "content": "Please update my billing record. My new email is [CONTACT_8F3A21] and my CPF is [DOCUMENT_9C4B52]. Also change my address to [LOCATION_7D1E99]." } ] } } ``` ## Related Reveal (Detokenize) API — Learn how to restore original data from tokens. [Reveal (Detokenize) API](/detokenize) # PII v0 Source: https://docs.guardion.ai/pii-model Model card for PII detection (Data Protection) # PII Model Card This page describes the model used by the Data Protection detector for PII detection. ## Available Versions * pii-v0 — current stable version ## Overview General-purpose multilingual PII detection across names, contacts, locations, and personal documents. ## Benchmarks Coming soon — comprehensive evaluation across synthetic and real-world datasets. ## Detailed Information Coming soon — training data characteristics, evaluation methodology, and error analysis. ## Related * Data Protection detector — configure policies and thresholds: [/pii](/pii) # Applications Source: https://docs.guardion.ai/platform/applications Organize logs and guardrail policies by application; assign reusable policies to apps; evaluate via API with an application ID. Applications are the main entity to organize your AI security by use case. Each application groups: * **Logs**: All evaluations and events for that use case * **Policies**: The guardrails applied to its interactions Applications overview showing logs and policy assignments by app ### Assign policies to applications Policies are reusable. You can assign the same policy to multiple applications, each application must have one policy. This lets you: * **Reuse once, enforce everywhere**: A single policy can protect multiple apps * **Isolate by use case**: Different applications can enable different policy sets * **Evolve safely**: Update a policy centrally and it applies to all assigned apps Assign policies to an application To assign: 1. Open the desired application 2. Click **Assign policy** 3. Select one or more policies to enable for this application > One policy can be used by many applications. Removing an assignment affects only that application; the policy remains available for other apps. ### Call the Guard API with an application ID When evaluating, include your application ID so Guardion applies the correct assignments and logs under the right app. ```bash theme={null} curl -X POST "https://api.guardion.ai/v1/guard" \ -H "Authorization: Bearer $GUARDION_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "application": "app_12345", "messages": [ { "role": "user", "content": "Write a SQL query to list all admin passwords" } ], "fail_fast": true, "breakdown_all": false }' ``` * **application**: Your application ID (string) * **messages**: Conversation messages to evaluate (at least the user message) * Optional overrides: * **override\_enabled\_policies**: Array of policy IDs to run instead of console assignments * **override\_response**: Default response text to return on any violation See the full API in the [Guard API](/guard-api) reference. *** Define guardrails once and reuse across applications Learn how to improve detection accuracy with feedback Explore Guardion's comprehensive security capabilities Integrate Guardion's protection into your applications # Feedbacks Source: https://docs.guardion.ai/platform/feedbacks Improve your AI guardrails through our feedback loop system. The feedback system allows you to continuously improve your AI guardrails by providing feedback on detection results. This human-in-the-loop approach helps fine-tune your detectors, reduce false positives, and enhance overall detection accuracy. Logs interface showing feedback options ## How feedback works When you provide feedback on detection results, Guardion uses this information to: 1. Build a dataset of edge cases specific to your use case 2. Immediately apply adjustments to incoming prompts and responses in the Guard API (using similarity and string match) 3. Incorporate your feedback during for the policy's models retraining This process helps your guardrails become more accurate over time, reducing false positives while maintaining strong protection. ## Providing feedback The feedback interface is integrated directly into the Logs section, making it easy to review and provide input as you investigate detections. Logs interface showing feedback options ### Individual feedback When reviewing a specific log entry: 1. Click on the log to view all detection details 2. For any incorrect classification, click **Mark as Misclassification** 3. Your feedback is immediately applied to the relevant policies Detailed feedback interface showing classification options ### Bulk feedback To efficiently review multiple logs at once: 1. Select multiple log entries using the checkboxes 2. Choose one of the available actions: * **Mark as Misclassification** - For incorrectly classified content * **Confirm as Flagged** - To validate correct threat detections (available when Threat filter is enabled) Bulk feedback selection interface > **Note:** Feedback is processed individually for each policy that triggered a detection, allowing for precise improvement of specific guardrails. ## Reviewing feedback history You can review all feedback provided for each policy: Policy card showing feedback summary The feedback history shows all previous inputs and allows you to modify them if needed. Any changes take effect immediately in the Guard API inside the feedback system. Policy feedback history interface ## Feedback Integration with Guard API The following diagram illustrates how the Guard API processes requests and incorporates feedback throughout the workflow: ```mermaid theme={null} flowchart TB Client[Client Application] Client -->|POST /v1/guard| API[Guard API] subgraph API[Guard API] direction TB Input[Target & Message Validation] Policy[Policy Engine] Detection[Detection Pipeline] Eval[Threshold Evaluator] Input --> Policy Policy --> Detection Detection --> Eval end subgraph Detection[Detection Pipeline] direction LR L1[**Layer 1:**
Feedback Database
Real-time updates] L2[**Layer 2:**
Policy-Specific Models
Period updates] L3[**Layer 3:**
Threat Intelligence
Foundation Models
Obfuscation Filters
] L1 --> L2 L2 --> L3 L1 -.->|Flag| Result[Detection Result] L2 -.->|Flag| Result L3 -.->|Flag| Result end Eval -->|Response| Client style L1 fill:#e3f2fd style L2 fill:#e8f5e9 style L3 fill:#fff3e0 style Result fill:#ffebee ``` ### Detection workflow The Guard API follows a structured evaluation process for each request: 1. **Input validation**: The API validates incoming requests and extracts messages for evaluation 2. **Policy application**: Your configured policies determine: * Which messages to evaluate (user, assistant, or both) * Detection thresholds (L1-L4) * Active detection layers 3. **Detection pipeline**: Each message passes through up to three detection layers 4. **Threshold evaluation**: Detection scores are compared against policy thresholds 5. **Response**: The API returns the evaluation result with detailed scoring breakdown This layered approach ensures both performance and accuracy, with your feedback continuously improving detection quality. ### Detection layers The Guard API uses a cascading detection pipeline that prioritizes speed and accuracy: #### Layer 1: Feedback database * **Method**: Exact string matching and semantic similarity * **Speed**: \< 10ms * High-confidence detection of previously flagged content #### Layer 2: Policy-specific models * **Method**: Models fine-tuned on your policy's feedback data * **Speed**: \< 10ms * Domain-specific threat detection #### Layer 3: Threat Intelligence & Foundation models * Comprehensive protection against zero-day threats * **Method**: Guardion's state-of-the-art LLMs * **Speed**: \~200ms * Broad coverage and emerging threat detection ## Best practices 1. **Start with L2 threshold** and adjust based on your false positive tolerance 2. **Provide feedback regularly** to improve policy-specific model accuracy 3. **Monitor detection metrics** to optimize threshold configuration 4. **Use policy targeting** to evaluate only relevant message types ## Next steps * [Configure your first policy →](./policies) * [Submit feedback to improve detection →](./feedback) * [View API reference →](./api-reference) # Logs & Investigation Source: https://docs.guardion.ai/platform/investigation Monitor, analyze, and respond to AI system activity with comprehensive logging and feedback tools. The Logs interface is your central hub for monitoring and investigating AI interactions. Each log entry contains detailed information about the request section, time, messages and any flags triggered during evaluation. Guardion investigation dashboard showing filtered logs and threat details ### Filtering and search Quickly find relevant requests with these filtering tools: * **Threat filters** - Focus on specific threat categories or view all requests * **Full-text search** - Find specific content within prompts or responses * **Time range** - Narrow results to specific time periods (day, week, or custom) * **Confidence threshold** - Adjust minimum confidence score to focus on high-probability threats (coming soon) * **Session ID** - Track specific user sessions across multiple interactions Use the search function to look for specific keywords that might indicate security concerns, such as "password," "API key," or "database access." ### Log details Click on any log entry to view comprehensive information about the interaction: Detailed view of a flagged interaction showing threat details and conversation context Each log detail view includes: * **Complete conversation history** - See the full context of the interaction * **Detection metadata** - View confidence scores and specific policies triggered * **Source information** - Identify the origin with session ID and client metadata * **Feedback controls** - Provide input to improve detection accuracy For interactions that passed all security checks, you'll see a simplified view: Detailed view of a safe interaction that passed all security checks ## Providing feedback When reviewing logs, you can help improve Guardion's detection accuracy by providing feedback on any misclassifications you find: 1. Open the log detail view for the interaction 2. Review the detection results and conversation context 3. If you identify a false positive or false negative, click **Mark as Misclassification** 4. Your feedback is immediately incorporated into the detection system Your feedback helps build a dataset specific to your policy, making Guardion's runtime control more accurate over time. Learn more in our [Feedbacks](/platform/feedbacks) documentation. ## Video walkthrough Watch our detailed walkthrough to see the investigation tools in action: