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

# YAML linter tool

The Cortex YAML linter validates your `cortex.yaml` files against both general YAML syntax and Cortex-specific schema requirements, catching invalid or incomplete entity definitions before they reach the platform.

This page covers the built-in tool available in the Cortex UI under **Tools > YAML Linter**. A separate linter is also built into the Cortex GitHub app, which runs checks on pull requests when you use GitHub in a [GitOps workflow](/configure/gitops).

## Using the YAML linter

### Validating a YAML file in the Cortex UI

1. From the main sidebar, expand **Tools**, then select **YAML linter**.

   <Frame>
     <img src="https://mintcdn.com/cortex-290c0c42/Rc9VK2OZxA5RHuut/images/yaml-linter-tool.png?fit=max&auto=format&n=Rc9VK2OZxA5RHuut&q=85&s=3610b4b6978f5566a65c32cbf0d49c4f" alt="The YAML linter tool displayed in the Cortex UI." width="375" data-path="images/yaml-linter-tool.png" />
   </Frame>
2. Paste your YAML into the text editor, then click **Validate YAML**.
3. A status banner appears at the bottom of the page:
   * If the format is valid, a success message is displayed:

     <Frame>
       <img src="https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/images/Screenshot%202025-10-08%20at%201.33.04%E2%80%AFPM.png?fit=max&auto=format&n=qRY2zZcIyXqFVeCq&q=85&s=f5de80ea8d74568975c118361cb9d511" alt="YAML success message and icon." title="Screenshot 2025 10 08 At 1 33 04 PM" width="197" height="63" data-path="images/Screenshot 2025-10-08 at 1.33.04 PM.png" />
     </Frame>
   * If the format is incorrect:
     * For issues with the format of a Cortex-specific block, a warning banner appears:

       <Frame>
         <img src="https://mintcdn.com/cortex-290c0c42/4tRxSDOxhMkPeY0E/images/linter-warning-banner.jpg?fit=max&auto=format&n=4tRxSDOxhMkPeY0E&q=85&s=7baed1419e45c716ac416ce36a588081" alt="The linter warning banner indicates that x-cortex-apm has an empty value in the YAML file." width="868" height="52" data-path="images/linter-warning-banner.jpg" />
       </Frame>
     * For errors that cause the YAML to fail the linter check (such as missing a `title` or `x-cortex-tag`), a failure banner that includes the error message and which line is affected appears:

       <Frame>
         <img src="https://mintcdn.com/cortex-290c0c42/Rc9VK2OZxA5RHuut/images/yaml-invalid-error.jpg?fit=max&auto=format&n=Rc9VK2OZxA5RHuut&q=85&s=15b70f87bfcfc51b48e9fe4dbac43392" alt="YAML fail message and icon." width="682" height="57" data-path="images/yaml-invalid-error.jpg" />
       </Frame>

### Validation scope

The linter checks for valid YAML structure and ensures required Cortex fields (like `openapi` version, `x-cortex-tag`, etc.) are present. If a required field is not present, this results in an error and the YAML does not pass the linter check.

The linter also validates the format of Cortex-specific blocks (e.g., `x-cortex-groups`, `x-cortex-firehydrant`) but does not verify the correctness of referenced data (such as whether a group or monitor ID actually exists). If there is an issue for a Cortex block, such as a block that doesn't contain a value, you will see a warning; however, the YAML will still pass the linter check.

If you submit a file with templating syntax (e.g., Jinja or cookiecutter variables like `{{ variable }}`), the linter will fail because these are not valid YAML until rendered. Only fully rendered YAML files will pass validation.

If the YAML is invalid or missing required fields, the linter will return errors indicating the line and nature of the problem.

### GitOps settings for the linter tool

If you are using GitHub in a GitOps workflow, you can adjust settings related to the linter. See [GitOps Settings](/configure/settings/gitops-settings) for more information.


## Related topics

- [GitOps settings](/configure/settings/gitops-settings.md)
- [Using GitOps for Cortex](/configure/gitops/using-gitops-for-cortex.md)
- [GitHub](/ingesting-data-into-cortex/integrations/github.md)
