---
canonical_url: "https://docs.composio.dev/toolkits/lakera_guard"
markdown_url: "https://docs.composio.dev/toolkits/lakera_guard.md"
product: "platform"
version: null
last_updated: null
---

# Lakera Guard

Lakera Guard screens AI application interactions for security and safety risks and provides Enterprise APIs for managing guardrail policies and projects.

- **Category:** ai safety compliance detection
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 10
- **Triggers:** 0
- **Slug:** `LAKERA_GUARD`
- **Version:** 00000000_00

## Tools

### Create Policy

**Slug:** `LAKERA_GUARD_CREATE_POLICY`

Create an Enterprise Lakera policy with built-in detectors and/or custom guardrails. Lakera may omit the new policy ID; if omitted, later retrieval, replacement, and deletion require external policy lookup.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Policy name, unique within the organization. |
| `detectors` | array | No | Built-in detector configurations. Provide at least one detector or custom_guardrail_id. |
| `default_threshold` | string ("l1_confident" | "l2_very_likely" | "l3_likely" | "l4_less_likely") | Yes | Default confidence threshold at or above which configured detectors trigger. |
| `custom_guardrail_ids` | array | No | Existing custom guardrail IDs to include. Provide at least one ID or detector. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Project

**Slug:** `LAKERA_GUARD_CREATE_PROJECT`

Create an Enterprise Lakera project, optionally assigning a policy, metadata, and detect-or-flag action. Omit policy_id to use the default policy. Lakera does not return the generated project ID, so later retrieval, updates, and deletion require external project lookup.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Name for the new project. |
| `action` | string ("detect" | "flag") | No | Project response action: detect reports detections, while flag applies flagging behavior. |
| `policy_id` | string | No | Existing policy ID to assign; omit to use the default policy. |
| `project_metadata` | object | No | String-valued project metadata stored by Lakera. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Policy

**Slug:** `LAKERA_GUARD_DELETE_POLICY`

Permanently delete an Enterprise Lakera policy by ID. The provider rejects deletion while any project is assigned to the policy.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `policy_id` | string | Yes | ID of the unassigned policy to permanently delete. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Project

**Slug:** `LAKERA_GUARD_DELETE_PROJECT`

Permanently and irreversibly delete an Enterprise Lakera project by ID. Historical requests lose their association with the project's metadata and assigned policy.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `project_id` | string | Yes | ID of the project to permanently and irreversibly delete. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Evaluate Detectors

**Slug:** `LAKERA_GUARD_EVALUATE_DETECTORS`

Evaluate content and return one confidence result per configured detector without producing an aggregate flagging decision or Guard screening log. Use for analysis and tuning, not runtime allow/block decisions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dev_info` | boolean | No | Whether to request Guard build and model version information. |
| `messages` | array | Yes | OpenAI-style conversation in chronological order; each message requires a role, while assistant tool-call messages may omit content. |
| `metadata` | object | No | Optional arbitrary request metadata passed to Lakera Guard. |
| `project_id` | string | No | Lakera project whose policy should be evaluated; omit to use the default policy. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Policy

**Slug:** `LAKERA_GUARD_GET_POLICY`

Retrieve an Enterprise Lakera policy by ID, including its detector configuration, custom guardrails, version, and assigned projects.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `policy_id` | string | Yes | Policy ID returned by Create Policy. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Project

**Slug:** `LAKERA_GUARD_GET_PROJECT`

Retrieve an Enterprise Lakera project by ID, including its assigned policy, metadata, and detect-or-flag action.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `project_id` | string | Yes | Lakera project ID to retrieve. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Screen Content

**Slug:** `LAKERA_GUARD_SCREEN_CONTENT`

Screen the latest LLM or agent interaction with Lakera Guard and return the policy decision. Use this for runtime allow/block decisions; earlier messages provide context, but only the latest interaction is screened.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `payload` | boolean | No | Whether to include matched text locations for supported detectors such as PII, profanity, and custom regex. |
| `dev_info` | boolean | No | Whether to include Guard build and model version information. |
| `messages` | array | Yes | OpenAI-style conversation in chronological order. Earlier messages provide context, but Guard screens only the latest interaction. |
| `metadata` | object | No | Optional request tags, commonly user_id, session_id, ip_address, and internal_request_id. |
| `breakdown` | boolean | No | Whether to include detector-by-detector decisions and confidence levels. |
| `project_id` | string | No | Lakera project whose policy should screen the interaction; omit to use the default policy. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Policy

**Slug:** `LAKERA_GUARD_UPDATE_POLICY`

Replace an Enterprise Lakera policy's complete configuration and create a new policy version. Omitted detectors or custom guardrails are removed, so retrieve the policy first when preserving existing settings.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Complete replacement policy name. |
| `detectors` | array | No | Complete replacement built-in detector list. Omission removes existing detectors; provide at least one detector or custom guardrail ID. |
| `policy_id` | string | Yes | ID of the policy to replace. |
| `default_threshold` | string ("l1_confident" | "l2_very_likely" | "l3_likely" | "l4_less_likely") | Yes | Complete replacement default detector threshold. |
| `custom_guardrail_ids` | array | No | Complete replacement custom guardrail ID list. Omission removes existing custom guardrails. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Project

**Slug:** `LAKERA_GUARD_UPDATE_PROJECT`

Update an Enterprise Lakera project by ID. Name is required by the official request schema; retrieve the project first when preserving its current name or other optional settings.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Project name; required by the official Platform request schema. |
| `action` | string ("detect" | "flag") | No | Project action. Omission keeps the existing action. |
| `policy_id` | string | No | Policy ID to assign to the project. |
| `project_id` | string | Yes | ID of the project to update. |
| `project_metadata` | object | No | String-valued project metadata to send in the update. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
