> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondguard.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy BeyondGuard Guards Across Your AI Application Stack

> A step-by-step guide to deploying BeyondGuard guards across your AI applications, from first connection to full multi-layer enforcement.

Deploying BeyondGuard follows a deliberate, layered sequence: start with Prompt Guard in Observation Mode to establish a threat baseline, then expand coverage guard by guard until you reach full enforcement across every layer of your AI stack. This approach ensures you have real data to tune policies before activating blocking behavior, minimizing disruption while maximizing protection.

## Before You Begin

Make sure you have the following in place before starting the deployment process:

* A **BeyondGuard account** with access to the Control Plane
* A **BeyondGuard API key** issued for your organization
* An **AI application or pipeline** you want to protect — this can be a chatbot, an agentic workflow, a RAG pipeline, or any LLM-backed service

<Steps>
  ### Create a Project

  Navigate to the BeyondGuard Control Plane and select **Projects** from the main navigation. Click **New Project** and provide a descriptive name that identifies your AI application — for example, `customer-support-bot` or `internal-knowledge-assistant`. Assign the project to the appropriate team so that the right stakeholders receive alerts and have access to threat event data.

  Once the project is created, you will land on the project dashboard. This is the central hub for all guard configuration, threat events, and policy management for this application.

  ### Deploy Prompt Guard

  From your project dashboard, select the **Guards** tab. Click **Enable** next to **Prompt Guard**.

  Set the operating mode to **Observation Mode**. In Observation Mode, Prompt Guard evaluates every incoming prompt and logs threat events — but it does not block or modify any traffic. This lets you observe the threat landscape before committing to enforcement.

  Note your **project API key** displayed on the Guards tab. You will use this key to connect your application to BeyondGuard in the next step.

  ### Integrate the BeyondGuard SDK

  Install the BeyondGuard SDK in your application environment and wrap your LLM calls so that every user prompt is evaluated before it reaches the model.

  ```python theme={null}
  import beyondguard

  bg = beyondguard.Client(api_key="YOUR_API_KEY")

  safe_prompt = bg.guard_prompt(prompt=user_input, project="my-app")

  response = openai_client.chat.completions.create(
      messages=[{"role": "user", "content": safe_prompt}]
  )
  ```

  In Observation Mode, `guard_prompt` returns the original prompt unchanged while logging any detected threats to your project's Threat Events feed. No user-facing behavior changes at this stage.

  ### Review Threat Events

  After your application has been running with Prompt Guard active for a representative period — typically 24 to 72 hours depending on traffic volume — navigate to **Threat Events** in your project dashboard.

  Review the flagged interactions to understand what BeyondGuard is detecting. Look for:

  * **True positives**: genuine injection attempts, jailbreak patterns, or out-of-scope requests that you want to block
  * **False positives**: legitimate user inputs that triggered detection rules incorrectly

  Use this data to tune sensitivity thresholds and adjust detection rules in your project's **Policies** settings. Repeat this review cycle until the false positive rate is acceptable for your application.

  ### Switch to Enforcement Mode

  Once you have established a stable threat baseline and tuned your policies, return to the **Guards** tab and switch Prompt Guard from **Observation Mode** to **Enforcement Mode**.

  In Enforcement Mode, Prompt Guard actively blocks or rewrites prompts that violate your policies before they reach the model. Users submitting malicious or out-of-scope prompts will receive a configurable rejection response instead.

  Monitor Threat Events closely in the first 48 hours after switching to Enforcement Mode and be prepared to adjust thresholds if legitimate traffic is being blocked.

  ### Expand Coverage

  With Prompt Guard operating in Enforcement Mode, you have a solid foundation. Now expand protection to the remaining layers of your AI stack by enabling additional guards from the **Guards** tab:

  * **Agent Guard** — monitors agentic workflows for plan deviations, out-of-scope tool calls, and excessive agency
  * **MCP Guard** — validates every MCP tool call against registered schemas to prevent tool-based attacks
  * **Data Guard** — scans your RAG corpus and data pipelines for poisoned documents and supply chain threats
  * **Output Guard** — inspects model responses for PII, harmful content, and improper output before delivery to users

  Follow the same pattern for each guard: deploy in Observation Mode first, review threat events, tune policies, then switch to Enforcement Mode.
</Steps>

<Tip>
  Deploy one guard at a time and allow each one to reach a stable, tuned baseline before enabling the next. Rushing to full coverage before tuning is complete can generate elevated false positive rates, eroding trust in the platform and creating alert fatigue for your security team.
</Tip>
