Skip to main content
Lasso Security provides comprehensive protection for your GenAI applications against various security threats including prompt injections, data leaks, and other potential risks that could compromise your AI systems. To get started with Lasso Security, visit their documentation:

Get Started with Lasso Security

Using Lasso with Portkey

1. Add Lasso credentials to Portkey

  • Navigate to the Integrations page under Settings
  • Click on the edit button for the Lasso integration
  • Add your Lasso API Key (obtain this from your Lasso Security account)
  • Optionally, set a custom API Endpoint if you use a dedicated Lasso deployment (defaults to https://server.lasso.security)

2. Add Lasso’s guardrail check

  • Navigate to the Guardrails page and click the Create button
  • Search for “Classifier” and click Add
  • Set any actions you want on your check, and create the Guardrail!
Guardrail Actions allow you to orchestrate your guardrails logic. You can learn more about them here
Check NameDescriptionParametersSupported Hooks
ClassifierClassifies content for security risks using Lasso Security’s Deputies v3 API. Returns detailed findings with action types (BLOCK, WARN, AUTO_MASKING) and severity levels.messages (array), conversationId (string, optional), userId (string, optional)beforeRequestHook, afterRequestHook

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"]
}
const portkey = new Portkey({
    apiKey: "PORTKEY_API_KEY",
    config: "pc-***" // Supports a string config id or a config object
});
For more, refer to the Config documentation. Your requests are now guarded by Lasso Security’s protective measures, and you can see the verdict and any actions taken directly in your Portkey logs!

Verdict behavior

The Lasso plugin uses the Deputies v3 API and determines whether to block a request based on violations_detected and the action field in findings:
ScenarioVerdictBehavior
No violations detectedAllowRequest passes through
Violations with BLOCK actionBlockRequest is blocked
Violations with only WARN actionsAllowRequest passes through, findings included in response data
Violations with only AUTO_MASKING actionsAllowRequest passes through, findings included in response data
API errorBlockRequest is blocked (fail-safe)

Key security features

Lasso Security’s Deputies analyze content for various security risks across multiple categories:
  1. Prompt Injections: Detects attempts to manipulate AI behavior through crafted inputs
  2. Data Leaks: Prevents sensitive information from being exposed through AI interactions
  3. Jailbreak Attempts: Identifies attempts to bypass AI safety mechanisms
  4. Custom Policy Violations: Enforces your organization’s specific security policies
  5. Harmful Content Detection: Flags sexual content, hate speech, illegal content, and more
Learn more about Lasso Security’s features here.

Get Support

If you face any issues with the Lasso Security integration, join the Portkey community forum for assistance.
Last modified on March 25, 2026