CrowdStrike AIDR provides AI Detection and Response capabilities for scanning LLM inputs and outputs. It can block or sanitize text depending on configured rules.
Get Started with CrowdStrike
Using CrowdStrike AIDR with Portkey
1. Add CrowdStrike Credentials to Portkey
- 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!
Guardrail Actions allow you to orchestrate your guardrails logic. You can learn them here
| 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 Portkey Config
- Create these Configs in Portkey UI, save them, and get an associated Config ID to attach to your requests. More here.
Here’s an example config:
{
"input_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"],
"output_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"]
}
NodeJS
Python
OpenAI NodeJS
OpenAI Python
cURL
const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY",
config: "pc-***" // Supports a string config id or a config object
});
portkey = Portkey(
api_key="PORTKEY_API_KEY",
config="pc-***" # Supports a string config id or a config object
)
const openai = new OpenAI({
apiKey: 'OPENAI_API_KEY',
baseURL: PORTKEY_GATEWAY_URL,
defaultHeaders: createHeaders({
apiKey: "PORTKEY_API_KEY",
config: "CONFIG_ID"
})
});
client = OpenAI(
api_key="OPENAI_API_KEY",
base_url=PORTKEY_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
api_key="PORTKEY_API_KEY",
config="CONFIG_ID"
)
)
curl https://api.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!"
}]
}'
For more, refer to the Config documentation.
Your requests are now guarded by CrowdStrike AIDR and you can see the Verdict and any action you take directly on Portkey logs!
Get Support
If you face any issues with the CrowdStrike AIDR integration, just ping the Portkey team on the community forum. Last modified on February 6, 2026