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

# Cisco AI Defense Integration

> Add Cisco AI Defense as a guardrail in TrueFoundry AI Gateway to inspect LLM prompts and responses for security, safety, privacy, and relevance violations.

This guide explains how to integrate [Cisco AI Defense](https://www.cisco.com/site/us/en/products/security/ai-defense/index.html) with TrueFoundry to inspect LLM prompts and responses for security, safety, privacy, and relevance violations.

## What is Cisco AI Defense?

[Cisco AI Defense](https://developer.cisco.com/docs/ai-defense-inspection/inspect-conversations/) provides an Inspection API that evaluates generative AI chat conversations — prompts and completions — for security, safety, and privacy concerns. Policies and rules are managed in the Cisco AI Defense product; the AI Gateway sends each guarded request to the regional Inspection endpoint and enforces the verdict.

In the TrueFoundry AI Gateway integration, Cisco AI Defense runs as a **Validate**-only guardrail: content is inspected and can be blocked, but it is not rewritten or redacted in place.

### Key capabilities

1. **Chat inspection** — Evaluates conversation messages (`role` + `content`) through the Cisco [Inspect conversations](https://developer.cisco.com/docs/ai-defense-inspection/inspect-conversations/) API (`POST /api/v1/inspect/chat`).
2. **Security, safety, privacy, and relevance** — Detects violations across classifications such as `SECURITY_VIOLATION`, `PRIVACY_VIOLATION`, `SAFETY_VIOLATION`, and `RELEVANCE_VIOLATION`.
3. **Built-in rule coverage** — Cisco AI Defense rules include Prompt Injection, PII, PHI, PCI, Code Detection, Harassment, Hate Speech, Profanity, Sexual Content & Exploitation, Social Division & Polarization, and Violence & Public Safety Threats.
4. **Regional endpoints** — Route inspection traffic to the US, AP, or EU Cisco Inspection API region that matches your AI Defense tenant.

## Adding Cisco AI Defense to TrueFoundry

Cisco AI Defense is a first-class guardrail in the AI Gateway — you configure it through the same form as any other built-in guardrail, no adapter service required.

<Steps>
  <Step title="Pick Cisco AI Defense from the guardrail registry">
    From **AI Gateway → Guardrails → Registry**, select **Cisco AI Defense** under **External Providers**. See [Get started with guardrails](/docs/ai-gateway/guardrails-getting-started) for the end-to-end flow of adding any guardrail.

    <Frame caption="Select Cisco AI Defense from the guardrail registry">
      <img src="https://mintcdn.com/truefoundry/DiUAXSON4fwlcGPM/images/cisco-ai-defense-catalog.png?fit=max&auto=format&n=DiUAXSON4fwlcGPM&q=85&s=8b2c303db533e90c1ce05addbed7bed3" alt="TrueFoundry guardrail registry highlighting the Cisco AI Defense card under External Providers" width="1506" height="1054" data-path="images/cisco-ai-defense-catalog.png" />
    </Frame>
  </Step>

  <Step title="Generate an API key in Cisco AI Defense">
    Create an API key in the Cisco AI Defense UI. The AI Gateway sends this key on every inspection call as the `X-Cisco-AI-Defense-API-Key` header. Keep the key secure — it grants access to your AI Defense Inspection API.
  </Step>

  <Step title="Fill in the Cisco AI Defense form">
    Provide the following fields:

    | Field                   | Required | Description                                                                                                                                                                                                                                                   |
    | ----------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Name**                |     ✅    | Identifier for this guardrail (for example, `cisco-ai-defense`). Used when you reference the guardrail from rules.                                                                                                                                            |
    | **Description**         |          | Free-form description shown in the dashboard.                                                                                                                                                                                                                 |
    | **Auth Data → API Key** |     ✅    | Cisco AI Defense API key. Stored encrypted. The AI Gateway attaches it as `X-Cisco-AI-Defense-API-Key` on every call to the Inspection API.                                                                                                                   |
    | **Operation**           |     ✅    | `Validate` only. Cisco AI Defense inspects and validates content without modifying it.                                                                                                                                                                        |
    | **Enforcing Strategy**  |     ✅    | TrueFoundry platform setting. `Enforce` blocks on any violation or guardrail error. `Enforce But Ignore On Error` blocks on violations but lets the request through on guardrail failures (timeouts, 5xx). `Audit` never blocks — violations are logged only. |
    | **Region**              |     ✅    | Cisco Inspection API region. Choose the region that matches your AI Defense tenant: **Us**, **Ap**, or **Eu**.                                                                                                                                                |
    | **Metadata**            |          | When enabled, additional metadata is forwarded to Cisco AI Defense. The authenticated TrueFoundry user is added automatically.                                                                                                                                |

    <Frame caption="Cisco AI Defense guardrail configuration form">
      <img src="https://mintcdn.com/truefoundry/DiUAXSON4fwlcGPM/images/cisco-ai-defense-form.png?fit=max&auto=format&n=DiUAXSON4fwlcGPM&q=85&s=efc832bc3098693f1a37d245a32f8261" alt="TrueFoundry interface for configuring Cisco AI Defense with fields for description, API key, operation, enforcing strategy, region, and metadata" width="1670" height="1410" data-path="images/cisco-ai-defense-form.png" />
    </Frame>

    <Note>
      Keep the Cisco AI Defense API key in TrueFoundry only — it should never appear in client code or model request bodies.
    </Note>

    #### Regional endpoints

    The **Region** field selects which Cisco Inspection API base URL the AI Gateway calls:

    | Region | Inspection API base URL                               |
    | ------ | ----------------------------------------------------- |
    | **Us** | `https://us.api.inspect.aidefense.security.cisco.com` |
    | **Ap** | `https://ap.api.inspect.aidefense.security.cisco.com` |
    | **Eu** | `https://eu.api.inspect.aidefense.security.cisco.com` |

    Chat inspection is sent to `POST /api/v1/inspect/chat` on the selected regional host. See the [Cisco Inspect conversations](https://developer.cisco.com/docs/ai-defense-inspection/inspect-conversations/) API reference for request and response fields.
  </Step>

  <Step title="Bind the guardrail to models with a rule">
    Once the guardrail is saved, attach it to one or more models through a **Guardrail Rule**. Use `llm_input_guardrails` to scan prompts before they reach the model and `llm_output_guardrails` to scan completions before they're returned to the caller.

    For a step-by-step walkthrough, see [Getting Started](/docs/ai-gateway/guardrails-getting-started). For the full policy reference, see [Guardrails Configuration](/docs/ai-gateway/guardrails-configuration).
  </Step>
</Steps>

## Validation logic

TrueFoundry uses the Cisco AI Defense Inspection response to decide whether content is safe:

* If Cisco returns `is_safe: false` (or reports one or more violated rules / classifications), the AI Gateway blocks the request and returns a **400** error to the caller — subject to your **Enforcing Strategy**.
* If Cisco returns `is_safe: true` with no violated rules, the request is allowed to proceed.
* If the Inspection API call fails (timeout, 5xx, auth error), behavior follows your **Enforcing Strategy**:
  * **Enforce** — fail closed; the request is blocked.
  * **Enforce But Ignore On Error** — fail open; the request proceeds and the failure is logged.
  * **Audit** — never block; violations and errors are logged only.

### Example Inspection response

When a prompt or completion violates policy, Cisco AI Defense can return fields such as:

```json theme={"dark"}
{
  "is_safe": false,
  "severity": "HIGH",
  "classifications": ["SECURITY_VIOLATION"],
  "rules": [
    {
      "rule_name": "Prompt Injection",
      "classification": "SECURITY_VIOLATION"
    }
  ],
  "attack_technique": "prompt_injection",
  "explanation": "The prompt attempts to override system instructions.",
  "event_id": "evt_123"
}
```

You can inspect the full guardrail evaluation in **AI Gateway → Monitor → Request Traces**.

## Supported rules

Cisco AI Defense can evaluate conversations against rules including:

| Rule                               | Typical classification |
| ---------------------------------- | ---------------------- |
| Prompt Injection                   | `SECURITY_VIOLATION`   |
| Code Detection                     | `SECURITY_VIOLATION`   |
| PII / PHI / PCI                    | `PRIVACY_VIOLATION`    |
| Harassment, Hate Speech, Profanity | `SAFETY_VIOLATION`     |
| Sexual Content & Exploitation      | `SAFETY_VIOLATION`     |
| Social Division & Polarization     | `SAFETY_VIOLATION`     |
| Violence & Public Safety Threats   | `SAFETY_VIOLATION`     |

Exact rule enablement and integration profiles are configured in Cisco AI Defense. The AI Gateway forwards messages for inspection and enforces the returned verdict.

## Reference

* [Cisco AI Defense Inspection — Inspect conversations](https://developer.cisco.com/docs/ai-defense-inspection/inspect-conversations/)
* [TrueFoundry guardrails overview](/docs/ai-gateway/guardrails-overview)
* [Get started with guardrails](/docs/ai-gateway/guardrails-getting-started)
* [Configure guardrail policies](/docs/ai-gateway/guardrails-configuration)
