> For the complete documentation index, see [llms.txt](https://knowledgebase.autorabit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/iz-scan/anypoint-studio/source-code-analysis/anypoint-studio-rules-playground.md).

# Anypoint Studio - Rules Playground

Rules Playground is a tool for quick and easy development of **`Custom Rules`**

{% hint style="warning" %}

* Rules Playground functionality is part of Anypoint Studio plugin. Refer to [Installing Anypoint Studio plugin](/product-guides/integral-zone/iz-suite/iz-scan/anypoint-studio/installation/install-iz-analyzer-studio.md) for more information.
  {% endhint %}

### Features

1. Develop/Create a custom rule definition and evaluate against the project
2. Provides feedback about any syntax errors in the rule definition
3. Capability to evaluate the rule definition on Mule components, APIs, property files, pom.xml, etc.
4. Publish the rule definition to the configured server and activate it

### Custom Rule Editor

5. Click on **`Window`** -> **`Show View`** -> **`Other`** -> **`IZ Scan`** -> **`Custom Rule Editor`**
6. Custom rule editor properties -
   1. **`Rule Name`** - Name of the new custom rule
   2. **`Type`** - Select the type of rule, which can be one of
      1. Code Smell
      2. Bug
      3. Vulnerability
      4. Security Hotspot
   3. **`Severity`** - Select the rule severity, which can be one of
      1. Blocker
      2. Critical
      3. Major
      4. Minor
      5. Info
   4. **`Rule Definition`** - Groovy definition for the custom rule\
      &#x20;

      <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FFF43sHVv1uL4Xuogzx2t%2Fcustom-rules-editor.png?alt=media&amp;token=2405e8ad-7009-449d-83a1-22f203e1bd15" alt=""><figcaption></figcaption></figure>

### Evaluating Custom Rule

1. Click on **`Evaluate Rule`** button to validate and execute the rule definition
2. Custom rule will be applied on the current project and results will be displayed in **`Evaluation Results`** section
3. Results in case of valid rule definition\
   &#x20;

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FSc3gyeBxz4idGhMIQUi7%2Fcustom-rules-eval-results.png?alt=media&amp;token=dfa83cb3-11d2-4fac-b929-e1476cb783aa" alt=""><figcaption></figcaption></figure>
4. Results in case of syntax errors in the rule definition\
   &#x20;

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FfpWrETKAAjjT3wVQPg14%2Fcustom-rules-eval-results-error.png?alt=media&amp;token=76a4e98c-68f8-4a10-9a03-da043a50263c" alt=""><figcaption></figcaption></figure>

### Publishing Custom Rule

{% hint style="warning" %}
Before publishing a custom rule, make sure you have:

* Created a custom Quality Profile from the default Profile.
* Appropriate access in the server to publish the rule.
  {% endhint %}

1. Expand the **`Publish Rule`** section
2. Enter the Rule Key and Description -
   1. **`Key`** - Unique key for the custom rule. The key will be auto populated, which can be changed if there are any conflicts
   2. **`Description`** - Description of the rule. Markdown syntax can be used to describe the rule\
      &#x20;

      <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FOcmhmqJDjn6aF5w6RMuJ%2Fcustom-rules-publish.png?alt=media&amp;token=3d97c2fc-7c3c-47c7-b1b2-e65513d9962b" alt=""><figcaption></figcaption></figure>
3. Click on **`Publish Rule`** to upload the rule to the configured server. Rule will be activated in the selected Quality Profile.

### See Also

* [On The Fly Results](/product-guides/integral-zone/iz-suite/iz-scan/anypoint-studio/source-code-analysis/anypoint-studio-analysis.md)
* [Source Code Analysis - Auto Fix Issues](/product-guides/integral-zone/iz-suite/iz-scan/vs-code-extension/source-code-analysis/autofix.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/iz-scan/anypoint-studio/source-code-analysis/anypoint-studio-rules-playground.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
