Cookie Consent
Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.
Read our Privacy Policy
Back

Introducing Lakera Guard – Bringing Enterprise-Grade Security to LLMs with One Line of Code

Introducing Lakera Guard: Bringing enterprise-grade security to LLMs with one line of code.

David Haber
October 1, 2024
August 10, 2023
Learn how to protect against the most common LLM vulnerabilities

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

In-context learning

As users increasingly rely on Large Language Models (LLMs) to accomplish their daily tasks, their concerns about the potential leakage of private data by these models have surged.

[Provide the input text here]

[Provide the input text here]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet, Q: I had 10 cookies. I ate 2 of them, and then I gave 5 of them to my friend. My grandma gave me another 2boxes of cookies, with 2 cookies inside each box. How many cookies do I have now?

Title italic

A: At the beginning there was 10 cookies, then 2 of them were eaten, so 8 cookies were left. Then 5 cookieswere given toa friend, so 3 cookies were left. 3 cookies + 2 boxes of 2 cookies (4 cookies) = 7 cookies. Youhave 7 cookies.

English to French Translation:

Q: A bartender had 20 pints. One customer has broken one pint, another has broken 5 pints. A bartender boughtthree boxes, 4 pints in each. How many pints does bartender have now?

Lorem ipsum dolor sit amet, line first
line second
line third

Lorem ipsum dolor sit amet, Q: I had 10 cookies. I ate 2 of them, and then I gave 5 of them to my friend. My grandma gave me another 2boxes of cookies, with 2 cookies inside each box. How many cookies do I have now?

Title italic Title italicTitle italicTitle italicTitle italicTitle italicTitle italic

A: At the beginning there was 10 cookies, then 2 of them were eaten, so 8 cookies were left. Then 5 cookieswere given toa friend, so 3 cookies were left. 3 cookies + 2 boxes of 2 cookies (4 cookies) = 7 cookies. Youhave 7 cookies.

English to French Translation:

Q: A bartender had 20 pints. One customer has broken one pint, another has broken 5 pints. A bartender boughtthree boxes, 4 pints in each. How many pints does bartender have now?

Hide table of contents
Show table of contents

At Lakera, we supercharge AI developers by enabling them to swiftly identify and eliminate their AI applications’ security threats so that they can focus on building the most exciting applications securely.

Businesses around the world are integrating LLMs into their applications at lightning speeds. At the same time, LLM applications bring completely new types of security risks that organizations need to address.

This is why we’re super excited to introduce Lakera Guard – a developer-first API to bring enterprise-grade security to your LLM applications. It is lightning-fast and can be integrated within minutes. We’ve designed it so that developers love working with it!

Over the last few weeks, we’ve given exclusive pre-launch access to a few corporations, cybersecurity teams, and LLM developers and have been happy to receive fantastic feedback:

Today, we are excited to announce that we’ll bring Lakera Guard to more AI teams over the next few weeks.

How do organizations benefit from Lakera Guard?

Lakera Guard provides out-of-the-box protection against the most common LLM security risks that AI teams face when integrating LLMs into their applications. Lakera Guard covers:

  • Prompt injection: Practical defenses against direct and indirect prompt injection attacks that can cause unintended downstream actions.
  • Leakage of sensitive information: Mitigation of security risks when LLMs are connected to PII or corporate data that shouldn’t be revealed to the world.
  • Hallucinations: Detection of model output that is misaligned with the input context or the expected behavior.
  • Content moderation: Ensuring that your LLM operates in line with ethical guidelines, company policies, etc.

AI teams that build with Lakera Guard benefit from our continuously evolving security intelligence that empowers developers with industry-leading vulnerability insights. Our security intelligence combines insights from public sources, data from the LLM developer community, the Lakera Red Team, and the latest LLM security research and techniques. Our proprietary vulnerability database contains tens of millions of attack data points and is growing by roughly 100k entries per day.

We are on a mission to secure every single LLM application in the world – through an easy-to-integrate API for developers. This is why we’ve built Lakera Guard.

**🛡️ Discover how Lakera’s Red Teaming solutions can safeguard your AI applications with automated security assessments, as well as identifying and addressing vulnerabilities effectively.**

How does Lakera Guard work?

Lakera Guard is built by developers for developers and designed to seamlessly integrate with your existing application stack in minutes. Whether you use ChatGPT, host your own LLaMA model or any other LLM, Lakera Guard integrates easily with just a few lines of code.

But how does it work? Lakera Guard acts as a protective shield between your application and your LLM. Just like a traditional network firewall, any message going in or out of your LLM must pass through the firewall. We can look at an example to illustrate this.

Let's imagine you are building a Q&A system using a large database of your internal documents. This allows anyone internally to ask something like "When did we first sell a product in Europe?" and get a customized answer based on your knowledge base.

The catch is that one of your documents contains a reverse prompt injection: a malicious agent has managed to insert a prompt injection into the document that is designed to surface a phishing link to the unsuspecting user. If the user asks a question and the document is used for an answer, the user could become a victim of the attack. This workflow looks as follows in code (for a more in-depth example, take a look at our documentation):


user_question = "When did we first sell a product in Europe?"# Retrieve the relevant context e.g., from a vector DB.context = ...# Call your LLMresponse = call_your_llm(user_question, context)# Interact with the user print(f"Your response: {response}") # Visit malicious-link.com

This is also a wonderful example of why LLM security is so challenging. You can see that the attack surface has multiple entry points. There are several messages going in and out of the LLM: the document context containing the reverse injection used to answer the user question, the user_question itself, and the LLM response. Lakera Guard checks the integrity of all of them to secure your application.

Developers are fully in control of what they want to pass through Lakera Guard and how the resulting assessment should impact the application flow. For example, you can check the context going into the LLM as follows to see if it was flagged by the Lakera Guard. You can then safely stop the flow to protect your user from the attack.


# This is all you need to call Lakera Guardresponse = requests.post( "https://api.lakera.ai/v1/guard", json={"input": context})if response.json()["results"][0]["flagged"]: # Here, Lakera Guard identifies a prompt injection attack in the context. print("I cannot process this input document, it has been flagged by Lakera Guard.") return


That's it! In this case, Lakera Guard checks the document and finds that it contains a prompt injection. The developer can then use this information to revert to a safe behavior, such as informing the user that the question cannot be answered. The user and your organization are kept safe!


Beyond this example, Lakera Guard provides bleeding edge protection against the known vulnerabilities of LLMs, from prompt injections to hallucinations and data leakage. The response from the Lakera Guard is a JSON containing detailed findings that you can use to fully secure the flow of your applications. More information about our API can be found in our documentation.

How can I get started?

You can learn more about the product and get started with Lakera Guard here.

Lakera Guard is currently in private beta and, due to high demand, spaces are strictly limited.

We allocate access to Lakera Guard on a first-come, first-served basis. Sign up today so that you can start securing your LLMs as quickly as possible. We’ll get back to you as soon as we can.

Lakera LLM Security Playbook
Learn how to protect against the most common LLM vulnerabilities

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

Unlock Free AI Security Guide.

Discover risks and solutions with the Lakera LLM Security Playbook.

Download Free

Explore Prompt Injection Attacks.

Learn LLM security, attack strategies, and protection tools. Includes bonus datasets.

Unlock Free Guide

Learn AI Security Basics.

Join our 10-lesson course on core concepts and issues in AI security.

Enroll Now

Evaluate LLM Security Solutions.

Use our checklist to evaluate and select the best LLM security tools for your enterprise.

Download Free

Uncover LLM Vulnerabilities.

Explore real-world LLM exploits, case studies, and mitigation strategies with Lakera.

Download Free

The CISO's Guide to AI Security

Get Lakera's AI Security Guide for an overview of threats and protection strategies.

Download Free

Explore AI Regulations.

Compare the EU AI Act and the White House’s AI Bill of Rights.

Download Free
David Haber

GenAI Security Preparedness
Report 2024

Get the first-of-its-kind report on how organizations are preparing for GenAI-specific threats.

Free Download
Read LLM Security Playbook

Learn about the most common LLM threats and how to prevent them.

Download

Explore AI Regulations.

Compare the EU AI Act and the White House’s AI Bill of Rights.

Understand AI Security Basics.

Get Lakera's AI Security Guide for an overview of threats and protection strategies.

Uncover LLM Vulnerabilities.

Explore real-world LLM exploits, case studies, and mitigation strategies with Lakera.

Optimize LLM Security Solutions.

Use our checklist to evaluate and select the best LLM security tools for your enterprise.

Master Prompt Injection Attacks.

Discover risks and solutions with the Lakera LLM Security Playbook.

Unlock Free AI Security Guide.

Discover risks and solutions with the Lakera LLM Security Playbook.

You might be interested
5
min read
New feature

Introducing Custom Detectors: Tailor Your AI Security with Precision

Lakera's custom detectors allow you to define specific words, text strings, rules and patterns to flag when screening, meeting your unique security and content moderation needs.
Lakera Team
October 7, 2024
5
min read
New feature

No-Code GenAI Security with Lakera Policy Control Center

With Lakera's Policy Control Center you can define application-specific controls for every one of your GenAI applications—in real time and without developers having to change a single line of code.
Lakera Team
October 7, 2024
4
min read
New feature

Introducing Lakera Chrome Extension - Privacy Guard for Your Conversations with ChatGPT

Lakera introduces Lakera PII Extension—a user-friendly Chrome plugin that allows you to input prompts to ChatGPT securely.
Lakera Team
September 27, 2024
3
min read
Update

Lakera Guard Expands Content Moderation Capabilities to Protect Your AI Applications and Users

Lakera Guard now offers expanded coverage to detect violent and dangerous content, ensuring that your AI applications remain safe, secure, and compliant.
Lakera Team
September 27, 2024
3
min read
Update

Lakera Guard Enhances PII Detection and Data Loss Prevention for Enterprise Applications

Lakera Guard introduces Advanced PII Detection and DLP capabilities.
Lakera Team
September 27, 2024
3
min read
Update

Lakera Guard Expands Enterprise-Grade Content Moderation Capabilities for GenAI Applications

We are excited to announce a significant upgrade to Lakera Guard's Content Moderation capabilities.
Lakera Team
September 25, 2024
6
min read
New feature

Lakera’s Prompt Injection Test (PINT)—A New Benchmark for Evaluating Prompt Injection Solutions

We've released the first version of a new Prompt Injection Test (PINT) Benchmark that can be used to evaluate any prompt injection detection system with a comprehensive dataset that no model, including ours, is directly trained on.
Lakera Team
September 27, 2024
10
min read
New feature

ChainGuard: Guard Your LangChain Apps with Lakera

In this tutorial, we'll show you how to integrate Lakera Guard into your LangChain applications to protect them from the most common AI security risks, including prompt injections, toxic content, data loss, and more!
Lakera Team
October 1, 2024
Activate
untouchable mode.
Get started for free.

Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.

Join our Slack Community.

Several people are typing about AI/ML security. 
Come join us and 1000+ others in a chat that’s thoroughly SFW.