Get detailed detection results

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. It can be used to analyze data and calibrate detector threshold levels for policies.

You can use the results 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.

It is not recommended to use the results endpoint in runtime GenAI application security decision, as requests are not logged as screening requests in Lakera Guard and it removes the ability to control your defenses using policies.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

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, or system.

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.

payloadbooleanOptional

When true the response will return a payload object containing any PII, profanity or custom detector regex matches detected, along with their location within the contents.

breakdownbooleanOptional

When true the response will return a breakdown list of the detectors that were run, as defined in the policy, and whether each of them detected something or not.

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 objectsOptional

List of detector results