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 with TrueFoundry to inspect LLM prompts and responses for security, safety, privacy, and relevance violations.
Cisco AI Defense 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.
Chat inspection — Evaluates conversation messages (role + content) through the Cisco Inspect conversations API (POST /api/v1/inspect/chat).
Security, safety, privacy, and relevance — Detects violations across classifications such as SECURITY_VIOLATION, PRIVACY_VIOLATION, SAFETY_VIOLATION, and RELEVANCE_VIOLATION.
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.
Regional endpoints — Route inspection traffic to the US, AP, or EU Cisco Inspection API region that matches your AI Defense tenant.
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.
1
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 for the end-to-end flow of adding any guardrail.
Select Cisco AI Defense from the guardrail registry
2
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.
3
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.
Cisco AI Defense guardrail configuration form
Keep the Cisco AI Defense API key in TrueFoundry only — it should never appear in client code or model request bodies.
Chat inspection is sent to POST /api/v1/inspect/chat on the selected regional host. See the Cisco Inspect conversations API reference for request and response fields.
4
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. For the full policy reference, see Guardrails Configuration.
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.
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.