Portkey AI Gateway Collectors
You can use AIDR to monitor and protect AI traffic flowing through Portkey AI by deploying the CrowdStrike AIDR plugin in Portkey's Guardrails framework.
When configured, Portkey sends API request and response data to AIDR for analysis. You can define policy rules to evaluate content and determine an action. Portkey then enforces the appropriate action (allow, block, or redact) before forwarding requests to the AI provider or returning responses to users.
Requirements
- A customer account in one of the following CrowdStrike clouds:
- US-1
- US-2
- EU-1
- AIDR for Agents Falcon subscription
- AIDR Admin role explicitly assigned to your Falcon user for the current customer account
- HTTP access to AIDR origins
- Portkey AI platform account
- HTTP access to the Portkey AI gateway
- (optional) OpenAI API key for testing
Register Portkey AI collector
-
On the Collectors page, click + Collector.
- Choose Gateway as the collector type, then select Portkey and click Next.
-
On the Add a Collector screen:
- Collector Name - Enter a descriptive name for the collector to appear in dashboards and reports.
- Logging - Select whether to log incoming (prompt) data and model responses, or only metadata submitted to AIDR.
- Policy (optional) - Assign a policy to apply to incoming data and model responses.
-
You can select an existing policy available for this collector type or create policies on the Policies page.
The selected policy name appears under the dropdown. After you save the collector registration, this label becomes a link to the corresponding policy page.
-
You can also select
No Policy, Log Only. Without a policy, AIDR records activity for visibility and analysis without applying detection rules.
Use the assigned policy to determine which detections run on data sent to AIDR. Policies define rules for detecting malicious activity, sensitive data exposure, topic violations, and other risks in AI interactions.
- Click Save to complete collector registration.
This opens the collector details page, where you can:
- Copy credentials and AIDR base URL from the Config tab to communicate with AIDR APIs.
- View installation instructions for the collector type on the Install tab.
- Update the collector name, logging preference, and policy assignment.
- Click the policy link to view the policy details.
- View the collector configuration activity logs.
To return to the collector details page later, select your collector from the list on the Collectors page.
Deploy collector
Configure CrowdStrike AIDR plugin
Configure the CrowdStrike AIDR plugin to connect Portkey with AIDR APIs.
- In the Portkey AI console , go to Admin Settings > Plugins.
- Find CrowdStrike AIDR, enable it, and click the pencil icon.
- In the CrowdStrike AIDR plugin configuration dialog, enter AIDR API token and Base url. You can copy both values from the Config tab of your collector details page in the AIDR console.
- Click Save.
Configure guardrail using CrowdStrike AIDR
You can configure a Portkey Guardrail with the CrowdStrike AIDR plugin to send API request data to AIDR for analysis and enforce actions based on your AIDR policy rules.
- Return to the main page. In Admin Settings, you can use the < Main Menu link.
- Open the Guardrails page.
- Click Create.
- In the Create Guardrail dialog, find the Guard Chat Completions check in the All checks list under the PARTNER tab.
- Click Add next to the check name.
- In the Selected Guardrail Checks dialog, under the Checks tab:
-
Enable Redact detected content to enforce AIDR redaction actions.
-
Adjust the Timeout (in milliseconds) setting as needed.
Fail-open behavior:If a request to AIDR exceeds this timeout, Portkey proceeds with the request without AIDR checks. Set an appropriate timeout value to balance security coverage with latency requirements.
-
Click Save. To return to the dialog later, click the pencil icon next to the check name.
-
- Switch to the Actions tab:
- Enable Deny the request if guardrail fails to block requests that fail AIDR checks.
- Click Create (again) to save the Guardrail configuration:
- In the Save Guardrail dialog, enter a meaningful Guardrail Name.
- Click Save to create the Guardrail and return to the guardrail details page. You can return to this page by selecting the guardrail from the list on the Guardrails page. Update the configuration as needed and save your changes using the Update button.
After the guardrail is saved, you can use the copy icon (⧉) in the guardrail list or on the guardrail details page to copy its ID for use in your Portkey Configs.
Add CrowdStrike AIDR guardrail ID to Portkey config
Use a Portkey config to define how Portkey routes and manages API requests for your applications. By adding the CrowdStrike AIDR guardrail ID to your Portkey config, you can route API requests through AIDR for analysis and enforcement. You can add the guardrail ID to an existing config or create a new one.
To add the CrowdStrike AIDR guardrail to a new Portkey config:
-
On the main Portkey AI page, click Configs.
-
Click Create.
-
In the Create Config dialog:
-
Enter a descriptive Name for your config as it will appear in the list of configs.
-
In the editor area, add
input_guardrailsandoutput_guardrailssections to include the CrowdStrike AIDR guardrail ID in your config:- input_guardrails - Analyze user prompts before they reach the AI provider.
- output_guardrails - Analyze AI responses before returning them to users.
Use the same guardrail ID in both sections. The CrowdStrike AIDR plugin uses a single collector and applies its policy's Input and Output rules to prompts and responses, respectively.
Example Portkey config with AIDR guardrail{
"retry": {
"attempts": 3
},
"cache": {
"mode": "simple"
},
"input_guardrails": [
{
"id": "pg-aidr-g-d280f6"
}
],
"output_guardrails": [
{
"id": "pg-aidr-g-d280f6"
}
]
}tip:Caching is enabled by default in new configs to improve API performance. To see changes immediately applied during testing, remove the
cachesection. -
-
Click Save Config.
-
Use the copy icon (