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
      • POSTValidate policy configuration
  • Platform API
LogoLogo
Lakera DashboardBook a Demo
Lakera APIPolicies Linter

Validate policy configuration

POST
/v2/policies/lint
POST
/v2/policies/lint
$curl -X POST https://api.lakera.ai/v2/policies/lint \
> -H "Authorization: Bearer <token>"
200Successful
1{
2 "passed": true,
3 "errors": [
4 {
5 "message": "string",
6 "severity": "error"
7 }
8 ]
9}
Lint and validate policy JSON configuration files <Note> The easiest way to check your policy file validity is via the [policy linter tool in the Guard platform](https://platform.lakera.ai/policy-linter). This editor provides basic linting for your policy. It will check for common errors and provide suggestions for improvement. The tool is run locally in the browser, so any policies or JSON entered in it are not saved anywhere. Note this also means that the contents are lost if you close the page. </Note>
Was this page helpful?
Previous

Create policy

Next
Built with

Lint and validate policy JSON configuration files

The easiest way to check your policy file validity is via the policy linter tool in the Guard platform. This editor provides basic linting for your policy. It will check for common errors and provide suggestions for improvement. The tool is run locally in the browser, so any policies or JSON entered in it are not saved anywhere. Note this also means that the contents are lost if you close the page.

Authentication

AuthorizationBearer

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

Response

Policy validation results
passedboolean
Whether validation passed
errorslist of objects
List of validation errors and warnings