> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kernite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Policy Generate API

> POST /policy/generate and POST /v1/policy/generate.

Generate deterministic Kernite policy artifacts from an OpenAPI 3.x JSON document.

Endpoints:

* `POST /policy/generate`
* `POST /v1/policy/generate`

## Request

```json theme={null}
{
  "openapi": {
    "openapi": "3.0.3",
    "paths": {}
  },
  "options": {
    "default_mode": "enforce",
    "fail_on_unsupported": false
  }
}
```

Options:

* `default_mode`: `enforce` | `observe` | `skip`
* `fail_on_unsupported`: mark generation report invalid when unsupported schema constraints are detected

## Response

```json theme={null}
{
  "ctx_id": "ctx_...",
  "message": "Policy bundle generated.",
  "data": {
    "bundle": {
      "schema_version": "kernite.policy.bundle.v1"
    },
    "mapping": {
      "schema_version": "kernite.policy.mapping.v1"
    },
    "report": {
      "valid": true,
      "summary": {},
      "warnings": [],
      "unsupported_constraints": []
    }
  }
}
```

## Notes

* OpenAPI input must be JSON in v1.
* YAML is not accepted by core runtime/CLI in this release.
