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

# CrowdStrike AIDR

> CrowdStrike AI Detection and Response (AIDR) integration for scanning LLM inputs and outputs to block or redact harmful content.

[CrowdStrike AIDR](https://www.crowdstrike.com/) provides AI Detection and Response capabilities for scanning LLM inputs and outputs. It can block or sanitize text depending on configured rules.

> [card] [Get Started with CrowdStrike](https://www.crowdstrike.com/)

## Using CrowdStrike AIDR with Prisma AIRS AI Gateway

### 1. Add CrowdStrike Credentials to the AI Gateway

* Navigate to the `Integration` page under `Sidebar`
* Click on the edit button for the CrowdStrike AIDR integration
* Add your CrowdStrike API credentials

### 2. Add CrowdStrike's Guardrail Check

* Navigate to the `Guardrails` page and click the `Create` button
* Search for **Guard Chat Completions** and click `Add`
* Configure your guardrail settings
* Set any `actions` you want on your check, and create the Guardrail!

> [!NOTE]
>
> Guardrail Actions allow you to orchestrate your guardrails logic. You can learn them [here](https://docs.portkey.ai/docs/aigw/product/guardrails.md#there-are-7-types-of-guardrail-actions)

| Check Name | Description | Parameters | Supported Hooks |
| - | - | - | - |
| Guard Chat Completions | Pass LLM Input and Output to CrowdStrike's guard\_chat\_completions endpoint. Able to block or sanitize text depending on configured rules. | `Redact`, `Timeout` | `beforeRequestHook`, `afterRequestHook` |

**Parameters:**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `redact` | boolean | `false` | If true, detected harmful content will be redacted |
| `timeout` | number | `5000` | Timeout in milliseconds |

### 3. Add Guardrail ID to a Config and Make Your Request

* When you save a Guardrail, you'll get an associated Guardrail ID - add this ID to the `input_guardrails` or `output_guardrails` params in your AI Gateway Config
* Create these Configs in Strata Cloud Manager, save them, and get an associated Config ID to attach to your requests. [More here](https://docs.portkey.ai/docs/aigw/product/ai-gateway/configs.md).

Here's an example config:

```json theme={"system"}
{
  "input_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"],
  "output_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"]
}
```

> [tab] cURL
>
> ```sh theme={"system"}
> curl https://aigw.portkey.ai/v1/chat/completions \
>   -H "Content-Type: application/json" \
>   -H "Authorization: Bearer $OPENAI_API_KEY" \
>   -H "x-portkey-api-key: $PORTKEY_API_KEY" \
>   -H "x-portkey-config: $CONFIG_ID" \
>   -d '{
>     "model": "gpt-3.5-turbo",
>     "messages": [{
>         "role": "user",
>         "content": "Hello!"
>       }]
>   }'
> ```

> [tab] OpenAI NodeJS
>
> ```js theme={"system"}
> const openai = new OpenAI({
>   apiKey: "PORTKEY_API_KEY",
>   baseURL: "https://aigw.portkey.ai/v1",
>   defaultHeaders: { "x-portkey-config": "CONFIG_ID" }
> });
> ```

> [tab] OpenAI Python
>
> ```py theme={"system"}
> client = OpenAI(
>     api_key="PORTKEY_API_KEY",
>     base_url="https://aigw.portkey.ai/v1",
>     default_headers={"x-portkey-provider": "openai", "x-portkey-config": "CONFIG_ID"}
> )
> ```

For more, refer to the [Config documentation](https://docs.portkey.ai/docs/aigw/product/ai-gateway/configs.md).

Your requests are now guarded by CrowdStrike AIDR and you can see the Verdict and any action you take directly on AI Gateway logs!


## Related topics

- [Enterprise Gateway](https://docs.portkey.ai/docs/changelog/enterprise.md)
- [List of Guardrail Checks](https://docs.portkey.ai/docs/aigw/product/guardrails/list-of-guardrail-checks.md)
- [DSPy](https://docs.portkey.ai/docs/aigw/integrations/libraries/dspy.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.