> This page is for Postman Docs, version Latest (v12) (default).
> For other versions, use one of these documentation indexes:
> - Latest (v12) (default): https://learning.postman.com/latest-v-12/llms.txt
> - v11: https://learning.postman.com/v11/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Manage your API governance rulesets and functions

The *Ruleset Library* is where you manage the reusable building blocks of your team's governance strategy:

* [**Rulesets**](#add-a-custom-ruleset) — Sets of governance rules that validate your OpenAPI and AsyncAPI specifications against your custom standards. Rulesets can be applied to your team's workspaces to enforce those standards.
* [**Functions**](#add-a-custom-function) — Custom validation logic written in JSON or YAML and linted by [Spectral](/docs/api-governance/configurable-rules/spectral/). Use functions to enforce checks that aren't covered by the standard rule types or that are custom to your team's needs. Functions can be used in any ruleset.

Use the search field to find a specific ruleset or function, and click ![Add icon](https://assets.postman.com/postman-docs/aether-icons/action-add-stroke.svg#icon) **Create new** to create a ruleset or function. The right pane provides quick access to **Create a ruleset** and **Create a function**. Each ruleset and function includes a rendered documentation view, making reviews easier without reading raw JSON or YAML. Users with the [API Governance Manager or the API Catalog Manager role](/docs/administration/roles-and-permissions#team-roles) can manage rulesets and functions in the Ruleset Library.

![The API Catalog's ruleset and functions interface](https://assets.postman.com/postman-docs/v12/api-catalog-governance-groups-v12-03.png)

When editing your custom rulesets and functions, you can use the following options:

* Use the JSON or YAML dropdown list to switch between the two formats for rulesets. Postman converts your ruleset between the two formats automatically.
* ![Console icon](https://assets.postman.com/postman-docs/aether-icons/v12/descriptive-console-stroke.svg#icon) **View Command Palette** — Opens the command palette, which provides quick access to frequently used commands.
* ![Pretty icon](https://assets.postman.com/postman-docs/aether-icons/action-pretty-stroke.svg#icon) **Beautify** — Formats your ruleset or function to make it easier to read.
* ![Wrap icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-wrap-stroke.svg#icon) **Wrap text** — Wraps long lines of text in the editor.
* ![Copy icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-copy-stroke.svg#icon) **Copy** — Copies the entire ruleset or function to your clipboard.
* ![Search icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-search-stroke.svg#icon) **Find** — Search for specific strings.

![The Ruleset Library editor menu options](https://assets.postman.com/postman-docs/v12/api-catalog-ruleset-library-functions-v12-02.png)

## Use Postman's built-in rulesets

Every team's Ruleset Library includes three rulesets that Postman maintains for you:

* **Postman Standard** — Checks for documentation and schema hygiene, such as descriptions, examples, contact information, and reusable schemas.
* **Postman OWASP** — Checks aligned to the OWASP API Security Top 10.
* **Postman AI Readiness** — Checks that an API specification is ready for use by AI agents and LLM function calling, such as clear descriptions, schemas, examples, error responses, and authentication details.

These rulesets require no authoring. You can review their rules in the **Documentation** tab and test them against a specification in the **Validate** tab, but you can't edit or delete them. Apply any of them to your team's workspaces by adding it to a [governance group](/docs/api-catalog/governance-groups/governance-groups/), the same way you'd apply a custom ruleset.

> **Note**
>
> Postman's built-in rulesets evaluate OpenAPI specifications only. To enforce standards on AsyncAPI specifications, [create a custom ruleset](#add-a-custom-ruleset).

## Add a custom ruleset

Add a custom OpenAPI or AsyncAPI ruleset to create a reusable set of rules you define. You can create a ruleset from scratch or use the boilerplate ruleset to help you get started.

To add a custom ruleset, do the following:

1. Click ![Home icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-descriptive-home-stroke-small.svg#icon) **Home** in the upper-left corner of the Postman app, then select **API Catalog**.
2. Click **Governance Groups** in the sidebar.
3. Click **Create new**, then select **Spectral Ruleset**. Or, select the **Ruleset Library** tab, then click ![Add icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-add-stroke.svg#icon) **Create new** and select **Spectral Ruleset**.
4. (Optional) Click the ruleset's filename to rename it. By default, Postman creates a ruleset with a generic name (for example, "new-openapi-ruleset-1").
5. Select the **Definition** tab to edit the ruleset. You can write your ruleset from scratch or use the boilerplate ruleset to help you get started. As you write your ruleset, the editor provides autocompletion and syntax validation.
6. Click **Save** to save your changes.

To reuse rules from other rulesets in your team, add an `extends` list to your ruleset. To learn more, see [Extend other rulesets](/docs/api-governance/configurable-rules/spectral/#extend-other-rulesets).

After you finish creating your ruleset, you can view your rules in the **Documentation** tab. You can then apply your ruleset to any workspace in your team by adding it to a [governance group](/docs/api-catalog/governance-groups/governance-groups/).

## Add a custom function

You can add custom governance functions to use in your rulesets. Postman provides a boilerplate function to help you start writing your custom governance function. You can write your functions using JavaScript and Node.js. The editor provides autocompletion, syntax validation, and save gating to help you write your functions.

To add a custom function, do the following:

1. Click ![Home icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-descriptive-home-stroke-small.svg#icon) **Home** in the upper-left corner of the Postman app, then select **API Catalog**.
2. Click **Governance Groups** in the sidebar.
3. Click **Create a function**. Or, select the **Ruleset Library** tab, then click ![Add icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-add-stroke.svg#icon) **Create new** and select **Custom Function**.
4. (Optional) Click the function's filename to rename it. By default, Postman creates a function with a generic name (for example, "new_custom_function_1").
5. Write your function in the editor, following the [custom functions guidelines](/docs/api-governance/configurable-rules/spectral/#spectral-custom-functions).
6. Click **Save** to save changes to your function.

## Validate a ruleset against a specification

Use the **Validate** tab to test a ruleset against a sample OpenAPI or AsyncAPI specification and preview the issues your rules would report before applying the ruleset to a governance group.

To validate a ruleset, do the following:

1. Select a ruleset.
2. Select the **Validate** tab.
3. Enter an OpenAPI or AsyncAPI specification in the editor.

Postman evaluates the definition against the ruleset as you edit and reports any problems in the **Issues** panel. Issues are grouped by ruleset, and each entry lists the rule name, the message, and the line and column where the problem was found. Select an issue to jump to that location in the editor. Click the critical, warning, or info icons in the **Issues** panel to filter out issues by severity.

## Delete a function or ruleset

To delete a function or ruleset, do the following:

1. Click ![Options icon](https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-options-stroke.svg#icon) **More actions** and select **Delete** next to the ruleset or function's name.
2. In the confirmation dialog, click **Delete** to confirm that you want to remove it.

> **Warning**
>
> Deleting rulesets and functions removes them permanently and they can't be recovered. Any governance groups that reference removed rulesets or functions will fail to evaluate until the reference is updated.

> **Note**
>
> You can't delete or rename a ruleset that other rulesets [extend](/docs/api-governance/configurable-rules/spectral/#extend-other-rulesets). Remove it from the `extends` list of each ruleset that extends it first.

## Custom governance rule and function guidelines

Postman supports [Spectral](/docs/api-governance/configurable-rules/spectral/) for custom governance rules and functions.

* Learn how to [write custom governance rules using Spectral](/docs/api-governance/configurable-rules/spectral/#how-spectral-works) and configure [Spectral rule properties](/docs/api-governance/configurable-rules/spectral/#spectral-rule-properties).

* Learn how to [write custom governance functions using Spectral](/docs/api-governance/configurable-rules/spectral/#spectral-custom-functions) and use them in your custom governance rules.