For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Lakera DashboardBook a Demo
HomeOverviewGuidesAPI ReferenceChangelogSupport
HomeOverviewGuidesAPI ReferenceChangelogSupport
  • Overview
    • API Overview
    • Guard
    • Guard Results
    • Kubernetes Probes
  • Lakera API
      • POSTGet detailed detection results
  • Platform API
LogoLogo
Lakera DashboardBook a Demo
Lakera APIGuard Results

Get detailed detection results

POST
/v2/guard/results
POST
/v2/guard/results
$curl -X POST https://api.lakera.ai/v2/guard/results \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "messages": [
> {
> "content": "string",
> "role": "system"
> }
> ]
>}'
200Successful
1{
2 "results": [
3 {
4 "project_id": "string",
5 "policy_id": "string",
6 "detector_id": "string",
7 "detector_type": "string",
8 "result": "string",
9 "custom_matched": true,
10 "message_id": 1
11 }
12 ]
13}
The `results` endpoint screens submitted content according to the policy assigned to the specified project. It then returns the confidence level results of the detectors. It doesn't make a flagging decision or create a request log in Guard. It can be used to analyze data and calibrate detector threshold levels for policies. You can use the `results` endpoint to analyze historic LLM prompt and response data without worrying about triggering alerts or affecting monitoring, as they are not logged as screening requests by Lakera Guard. If no project ID is passed in the request, then the default Lakera Guard policy is used, which runs all Guard defenses and detectors at the highest sensitivity level. <Warning>`results` requests are not logged as screening requests in Lakera Guard and do not appear in the platform or exported logs. It should not be used in runtime GenAI application security decisions as it removes the ability to control your defenses using policies.</Warning>
Was this page helpful?
Previous

Check policy configuration health

Next
Built with

The results endpoint screens submitted content according to the policy assigned to the specified project. It then returns the confidence level results of the detectors. It doesn’t make a flagging decision or create a request log in Guard. It can be used to analyze data and calibrate detector threshold levels for policies.

You can use the results endpoint to analyze historic LLM prompt and response data without worrying about triggering alerts or affecting monitoring, as they are not logged as screening requests by Lakera Guard.

If no project ID is passed in the request, then the default Lakera Guard policy is used, which runs all Guard defenses and detectors at the highest sensitivity level.

results requests are not logged as screening requests in Lakera Guard and do not appear in the platform or exported logs. It should not be used in runtime GenAI application security decisions as it removes the ability to control your defenses using policies.

Authentication

AuthorizationBearer

Bearer authentication using API key. Generate an API key from the Lakera platform. Example: Bearer sk_123…

Request

This endpoint expects an object.
messageslist of objectsRequired

List of messages comprising the interaction history with the LLM in OpenAI API Chat Completions format. Can be multiple messages of any role: user, assistant, system, tool or developer.

project_idstringOptional
ID of the relevant project. The request will be screened according to the policy assigned to the project. If no project ID is passed then the Lakera Guard Default Policy will be used for screening.
metadatamap from strings to anyOptional

Metadata tags can be attached to screening requests as an object that can contain any arbitrary key-value pairs. Common use cases include specifying the user or session ID.

dev_infobooleanOptional
When true the response will return an object with developer information about the build of Lakera Guard.

Response

Successful retrieval
resultslist of objects
List of detector results