Portkey
Overview
Akto integrates with Portkey AI Gateway to provide comprehensive security guardrails for AI applications. This integration enables automatic guardrail detection and prevention at both the request and response stages of LLM interactions.
What is Portkey?
Portkey is an AI gateway that routes requests to various LLM providers (OpenAI, Anthropic, etc.) and provides a unified interface for managing AI infrastructure. Learn more at portkey.ai.
Key Benefits
Guardrails: Identify prompt injection, data leakage, and other LLM-specific attacks
Flexible Response Actions: Block, sanitize, alert, or log suspicious activity
Transparent Integration: Works seamlessly with existing Portkey configurations
Centralized Management: Configure guardrails from Portkey's admin dashboard
Architecture
The integration operates as a Portkey plugin that hooks into two critical lifecycle points:
Setup Guide
Prerequisites
Ensure the following requirements are available:
Access to Portkey AI Gateway (v2.0.0 or later)
Administrative access to Portkey settings
Akto API key
Akto API domain
Configure Akto Credentials in Portkey
Log in to your Portkey dashboard
Navigate to Admin Settings → Plugins
Find the Akto plugin section
Enter the following credentials:
Akto API Key: Your Akto API key from the dashboard
Akto API Domain: Your Akto Agentic component domain (e.g.,
api.akto.io)
Click Save to activate the plugin.
Obtain Guardrail IDs from Our Support
Guardrails are pre-configured and managed by the Akto team. To get the guardrail IDs for your specific guardrail detection needs:
Contact Akto Support at [email protected] or through your account manager,
Our team will provide you with:
Input Guardrail IDs: For request-level scanning
Output Guardrail IDs: For response-level scanning
Configuration details and any specific requirements
Create a Portkey Configuration with Akto Guardrails
Define a reusable configuration that includes guardrails and model settings.
Navigate to Portkey Configurations
Create a new configuration
Add:
Input guardrails: List of Akto guardrail IDs
Output guardrails: List of Akto guardrail IDs
Configure:
Provider (for example: OpenAI)
Model (for example: gpt-4)
Save the configuration
Portkey generates a config ID.
Use Config ID in API Requests
You now attach the Portkey configuration at the client level using the generated config ID. The config ID encapsulates Akto guardrails and model settings.
For more guidance, refer to the Portkey Config.
You can now route all LLM traffic through Portkey with Akto guardrails enforced.
Troubleshooting
Issue: Guardrails Not Applied
Symptoms: Requests passing without guardrail validation
Solutions:
Verify guardrail IDs in configuration match Portkey records
Check Akto credentials are correctly configured in Portkey
Confirm Akto plugin is enabled in Admin Settings
Check network connectivity to Akto service
Issue: Legitimate Requests Being Blocked
Symptoms: Valid requests returning 403 errors
Solutions:
Review blocked request details in logs
Adjust guardrail sensitivity settings
Temporarily switch BLOCK action to ALERT for analysis
Contact Akto support with examples
Issue: Performance Degradation
Symptoms: Increased latency in API requests
Solutions:
Reduce number of guardrails applied
Use caching for repeated queries
Monitor Akto service health
Consider separating critical vs. non-critical paths
Issue: Akto Service Unavailable
Symptoms: Errors about inability to reach Akto
Solutions:
Check network firewall rules allow Akto domain
Verify API key is valid and not expired
Check Akto service status page
Configure fallback policy (fail open/closed)
Get Support for your Akto setup
There are multiple ways to request support from Akto. We are 24X7 available on the following:
In-app
intercomsupport. Message us with your query on intercom in Akto dashboard and someone will reply.Join our discord channel for community support.
Contact [email protected] for email support.
Contact us here.
Last updated