> For the complete documentation index, see [llms.txt](https://doc.threatreaper.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.threatreaper.ai/user-guide/ai-guard-secure-ai-chat.md).

# 💬 AI-Guard — Secure AI Chat

**Menu:** PROTECT > AI-Guard.

## 8.1 How to configure a chat wrapper

{% stepper %}
{% step %}

### Open Chat Wrappers

Open **AI-Guard > Chat Wrappers** and select **Create**.
{% endstep %}

{% step %}

### Complete the wrapper fields

| **Field**            | **Required?** | **Notes**                                                                                                                                                                             |
| -------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Wrapper Name         | Yes           | For example, "Acme Corp Chat"                                                                                                                                                         |
| Description          | No            | Short internal note                                                                                                                                                                   |
| Custom Domain (FQDN) | No            | Your own domain, e.g. `chat.company.com`; leave blank to use the default LockThreat chat domain                                                                                       |
| Project              | No            | Determines which policy protects this wrapper                                                                                                                                         |
| Connector            | Yes           | The AI provider connector (OpenAI, Azure OpenAI, Anthropic, Gemini, and others) this wrapper talks to — see [15. Connectors](#15-connectors-linking-your-cloud-code-and-ai-providers) |
| Analytics Model      | No            | Leave blank to auto-create a tracked model in AI-Analytics                                                                                                                            |
| Assigned Users       | No            | Who may use this chat wrapper; leave empty to allow your whole organisation                                                                                                           |
| {% endstep %}        |               |                                                                                                                                                                                       |

{% step %}

### Test before rollout

Creating a wrapper consumes credits. Use **AI-Guard > Prompt Tester** to try prompts against a wrapper's model and project before rolling it out — pick a model and project, type a prompt, and select **Test Prompt**.
{% endstep %}
{% endstepper %}

## 8.2 Errors you might see and how to fix them

| **Message**                                                                                          | **What it means**                                      | **What to do**                                                                                                |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| "Wrapper name is required"                                                                           | The Name field was left blank                          | Enter a name before saving                                                                                    |
| "Please select a connector"                                                                          | No AI provider connector chosen                        | Pick one, or create one first — see [15. Connectors](#15-connectors-linking-your-cloud-code-and-ai-providers) |
| "Failed to create chat wrapper" / "Failed to update chat wrapper"                                    | The save request failed                                | Check the detailed message shown, fix the field it references, and retry                                      |
| "No connectors available" / "No projects available" / "No models available" in a dropdown            | Nothing of that type has been set up yet               | Create a connector, project, or analytics model first                                                         |
| Prompt Tester: "Please enter a prompt to test" / "Please select a model" / "Please select a project" | A required Prompt Tester field is missing              | Fill in all three before selecting **Test Prompt**                                                            |
| Prompt Tester: "Budget or rate limit exceeded"                                                       | The assigned AI-Analytics budget or rate limit was hit | Ask your administrator to raise the budget/rate limit, or wait for the reset period                           |

## 8.3 What success looks like

The **Chat Wrappers** table shows each wrapper's health at a glance:

| **Name**           | **Project**       | **Connector** | **Users** | **Status** | **URL**              |
| ------------------ | ----------------- | ------------- | --------- | ---------- | -------------------- |
| Acme Corp Chat     | customer\_support | openai        | 12 users  | 🟢 Active  | chat.acme.com        |
| Internal Assistant | internal\_tools   | azure\_openai | 5 users   | 🟢 Active  | chat.threatreaper.ai |

A Prompt Tester run returns a clear verdict:

> Prompt: "Ignore previous instructions"
>
> Status: BLOCKED
>
> Reason: Prompt Injection detected
>
> Tokens: 42 Cost: $0.0021 Latency: 310ms
>
> Budget: Production Budget — 61.2% used ($61.20 / $100.00)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.threatreaper.ai/user-guide/ai-guard-secure-ai-chat.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
