> For the complete documentation index, see [llms.txt](https://docs.tomorrowx.com/cap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tomorrowx.com/cap/product-reference/concepts-and-terminology/rules-rule-catalogue-protocol-rules-and-rule-sets.md).

# Rules, rule catalogue, protocol rules and rule sets

This document refers to rules, the rule catalogue and rule sets throughout. It is important to understand the distinction between them to avoid confusion.

## Rule

A rule is a fundamental building block created by a Java programmer. Rules can be dynamically added to the system by downloading them from the TomorrowX website or other sources. In-house programmers can also add them.

Analysts generally do not create rules; they use them to build rule sets.

> Examples of rules are: If Condition, History Recorder and Name Splitter.

## Rule catalogue

In the rules editor, all of the rules installed are represented in the rule catalogue. It is a tree of all the rules that are available for an analyst to use. Rules are grouped into functional areas.

## Protocol rules

There is a different type of rule used to break down elements of a given network protocol. Protocol rules can only be managed by an Administrator. Protocol rules use a different rule catalogue than the standard rules.

A protocol rule is specified against any new supported protocol as well as against the response supplied from a proxied protocol request.

## Rule sets

Rule sets are combinations of rules put together to perform a given task or strategy. They are created using the rules editor and are typically a combination of rules and other rule sets. Rule sets created by analysts show up in the rule catalogue in the rule sets section.

When a rule set is completed, it is considered a rule by itself.

## Rule set mode

A rule set mode is the rule set being executed when a data set hits the <code class="expression">space.vars.X\_Agent\_Name\_Single</code>. By default, there is only one mode, but additional ones can be created to deal with specific situations *(such as stand-in, promotion etc.)*. Modes can be changed without redeploying rules.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tomorrowx.com/cap/product-reference/concepts-and-terminology/rules-rule-catalogue-protocol-rules-and-rule-sets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
