# Domains

Domains allow you to logically group resources in your data model based on EQL rules. Each domain defines a subset of resources (e.g., "Sales Data", "PII Assets", "Production Models") and metadata tags are scoped to domains, so you can organize and manage tags separately within each domain.

## What Are Domains?

A **domain** is a named grouping of resources defined by one or more EQL conditions. When you create a domain, you specify:

* **Name**: A descriptive name (e.g., "Sales Data", "PII Assets")
* **Description**: Optional text explaining the domain's purpose
* **Defining EQLs**: A list of EQL expressions. A resource belongs to the domain if it satisfies **any** of these EQLs.

Each account starts with a **Default** domain that includes all resources (`true`). You can create additional domains to segment your data model.

{% hint style="info" %}
**Recommendation**: Keep the Default domain and its defining EQL as `true` so it includes all resources. This ensures new resources are always assigned to at least one domain.
{% endhint %}

## The "domains" Property

Euno maintains a built-in property called **domains** for every resource. This property is a list of domain names that the resource belongs to. For example, a dbt model in the "Sales" schema might have `domains = ["Default", "Sales Data"]`.

You can use the `domains` property in EQL to filter resources by domain membership. See [EQL Examples Using Domains](#eql-examples-using-domains) below.

A Resource can belong to any number of domains, or even to no domains.

## Managing Domains

### Creating a Domain

1. Navigate to **User Menu -> Account Settings -> Domains**
2. To create a new domain, click *Create New Domain*\*

When creating a domain, you must provide:

* **Name**: Unique within the account (e.g., "Sales Data")
* **Defining EQLs**: At least one EQL. Each EQL is validated against indexed properties only (not custom properties). Examples:
  * `database_schema = 'sales'` — resources in the sales schema
  * `type = 'dbt_model' AND 'production' in tags` — dbt models tagged as production
  * `has upstream(type = 'dbt_source')` — resources that depend on dbt sources
* Optionally, you can provide a **description**

### Listing and Editing Domains

You can list all domains for your account, view a domain's details, and update its name, description, or defining EQLs. Deleting a domain removes it and its associated metadata tags.

## Examples of Domains

| Domain Name   | Defining EQL(s)                                           | Purpose                            |
| ------------- | --------------------------------------------------------- | ---------------------------------- |
| Sales Data    | `database_schema = 'sales'`                               | Resources in the sales schema      |
| PII Assets    | `contains_pii is true`                                    | Resources marked as containing PII |
| Production    | `'production' in tags`                                    | Production-tagged resources        |
| dbt Models    | `type = 'dbt_model'`                                      | All dbt models                     |
| BI Dashboards | `type = 'looker_dashboard' OR type = 'tableau_dashboard'` | Looker and Tableau dashboards      |

## EQL Examples Using Domains

The `domains` property is a list of strings. You can use it in EQL to filter resources by domain membership. For full EQL syntax, see the [Euno Query Language (EQL)](/using-euno/euno-query-language-eql.md) documentation.

**Filter resources in a specific domain:**

```
'Sales Data' in domains
```

**Filter resources in multiple domains (OR):**

```
'Sales Data' in domains OR 'PII Assets' in domains
```

**Filter resources that are in Sales Data but not PII:**

```
'Sales Data' in domains AND NOT ('PII Assets' in domains)
```

**Filter resources in any domain except Default:**

```
domains is not null AND NOT ('Default' in domains)
```

**Combine with other properties:**

```
type = 'dbt_model' AND 'Production' in domains
```

For more EQL examples and operators, see [Example of Full EQL Statements](/using-euno/euno-query-language-eql/example-of-full-eql-statements.md).

## Metadata Tags and Domains

Metadata tags are scoped to domains. When you create a metadata tag, you assign it to a domain. Tags in one domain are separate from tags in another, so you can organize tags by business area or use case. If your account has more than one domain, you will see a domain selector when creating or editing metadata tags. See [Metadata Tags](/using-euno/metadata-activation/metadata-tags.md) for details.

## Personas and Domains

[Personas](/setup-configuration/personas.md) (roles) can be scoped to specific domains. When a user has a domain-scoped persona, they can only access resources and metadata tags within those domains when using that persona. This lets you align permissions with your domain structure. See [Personas](/setup-configuration/personas.md) for how to create and manage domain-scoped personas.


---

# Agent Instructions: 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:

```
GET https://docs.euno.ai/setup-configuration/domains.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
