# Rules

Rules are short plain-text instructions you give Olly so it understands your environment, conventions, and preferences without you having to repeat them in every chat. There are two kinds:

- **Team rules**: a team admin creates them, everyone in the team sees them, and Olly applies them across everyone's chats — for example, "Production data should always be prioritized over staging.", "The field `service.name` represents the owning team.", or "Security issues should be highlighted before performance issues."
- **User rules**: you create them, only you see them, and Olly applies them only to your chats — for example, "The label `application` in my logs refers to the customer name.", "Only analyze production environment data.", or "Highlight error spikes over latency regressions."

Rules persist across sessions and are automatically included in every interaction.

To open your rules, select **Settings**, then **Olly AI**, then **Rules**. The page has two sections — **Team rules** for the rules your admin has shared with the team, and **User rules** for the rules you've added.

## How rules are applied

Olly merges all enabled rules before responding. When a team rule and a user rule conflict, the team rule wins.

Adding, editing, or deleting a rule does not reprocess past chats — changes apply to subsequent interactions only.

## Permissions for team rules

Anyone with access to Olly can manage their own user rules — no extra permissions required. Team rules are admin-managed, and the following permissions, both in the **AI** permission group, control access:

- The [`OLLY-TEAM-RULES:READ`](https://coralogix.com/docs/user-guides/aaa/access-control/permissions/permissions-list/index.md) permission to view team rules.
- The [`OLLY-TEAM-RULES:MANAGE`](https://coralogix.com/docs/user-guides/aaa/access-control/permissions/permissions-list/index.md) permission to add, edit, enable or disable, and delete team rules.

When you open the **Team rules** section without the manage permission, you see only enabled team rules in read-only mode.

## Create a rule

Open the **Team rules** section to add a team rule, or the **User rules** section to add a user rule. The dialog is the same in both.

1. Select **+ New rule**.
1. Enter the rule in plain text.
1. Select **Create**.

Olly validates the rule, saves it, and applies it to subsequent chats — to your chats only for a user rule, or to everyone in the team for a team rule.

## Edit, disable, or delete a rule

From a rule in either section, you can:

- **Edit**: open the dialog and update the text. Changes apply to subsequent chats; past chats stay unchanged.
- **Enable or disable**: toggle the rule off to remove it from prompts without deleting it. A disabled rule stays in the list with a **Disabled** indicator. Non-admins don't see disabled team rules.
- **Delete**: remove the rule permanently. The action cannot be undone.

## Validation

Olly validates every rule before saving it. The same checks apply to team rules and user rules. Olly rejects a rule if it contains:

- **Prompt injection**: attempts to override Olly's instructions, change tool permissions, exfiltrate data, or reveal internal prompts.
- **Foul language**: hate or harassment, sexual content, self-harm, violence, or guidance for illicit or dangerous activity.

If a rule fails validation, Olly does not save it and returns an error message explaining why.

## Next steps

Teach Olly your team's workflows and response style with [Skills](https://coralogix.com/docs/user-guides/olly/skills/index.md).
