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

# Data Inventory

> Discover, classify, and label your data with built-in and custom data labels and tags

export const G = ({term, anchor, children}) => {
  const href = anchor ? `/docs/glossary/index#${anchor}` : `/docs/glossary/index`;
  return <a href={href} className="glossary-link" style={{
    textDecoration: "underline",
    textDecorationLine: "underline",
    textDecorationColor: "#6b7280",
    textDecorationThickness: "1px",
    textUnderlineOffset: "2px",
    color: "inherit",
    transition: "text-decoration-color 0.2s ease",
    borderBottom: "none"
  }} onMouseEnter={e => e.target.style.textDecorationColor = "#fff"} onMouseLeave={e => e.target.style.textDecorationColor = "#6b7280"}>
  {children || term}
</a>;
};

> **Outcome:** Learn where to list available data labels in Formal and how inventory labels and tags work.

## Overview

Formal automatically discovers and catalogs databases, schemas, tables, and columns across your infrastructure. The data inventory gives you visibility into what data exists, where it lives, and how sensitive it is.

The inventory is populated by the [Data Discovery Satellite](/docs/guides/core-concepts/satellites#data-discovery-satellite), which scans your <G anchor="resource">resources</G> on a schedule. When linked to an [AI Satellite](/docs/guides/core-concepts/satellites#ai-satellite), columns are automatically classified with **data labels** that identify sensitive data types.

## List Available Labels

Formal has two places to see available data labels.

* **Built-in labels:** Open **Data Inventory** and select a column label. The picker shows the built-in labels available for manual assignment.
* **Custom labels:** Open **Data Inventory** and use **Settings** -> **Manage Data Labels** to list the custom labels created for your organization.

You can also list custom labels with the [ListDataLabels API](/api-reference/corev1inventoryservice/listdatalabels).

## Discovery

The Data Discovery Satellite connects to your resources and catalogs their structure:

* **Databases** and **schemas**
* **Tables** and **views**
* **Columns** with data types

Configure discovery schedules per resource with options for frequency (every 6, 12, 18, or 24 hours, or custom cron) and deletion policy for removed schemas.

See [Satellites](/docs/guides/core-concepts/satellites#data-discovery-satellite) for deployment and configuration.

## Data Labels

Data labels identify the type of sensitive data in a column or field (e.g., `email_address`, `ssn`, `phone_number`). Use labels in <G anchor="policy">policies</G> to enforce masking, filtering, and access control based on data sensitivity.

Formal ships with built-in labels and supports custom labels. The AI Satellite can automatically detect and assign labels during discovery.

### Built-in Labels

These labels are available in the Formal console label picker.

#### Personal and Sensitive Data

| Label                  | Identifier        |
| ---------------------- | ----------------- |
| Date/Time              | `date_time`       |
| Email Address          | `email_address`   |
| Height                 | `height`          |
| IP Address             | `ip_address`      |
| Location               | `location`        |
| Passport Number        | `passport_number` |
| Person Gender          | `gender`          |
| Person Name            | `name`            |
| Phone Number           | `phone_number`    |
| Social Security Number | `ssn`             |
| Weight                 | `weight`          |

#### Healthcare

| Label                   | Identifier                |
| ----------------------- | ------------------------- |
| Blood Type              | `blood_type`              |
| Diagnosis               | `diagnosis`               |
| Drug Code               | `drug_code`               |
| Drug Name               | `drug_name`               |
| Health Insurance Number | `health_insurance_number` |
| Health Plan Type Name   | `health_plan_type_name`   |
| Medical Record Number   | `medical_record_number`   |
| Treatment Type          | `treatment_type`          |

#### Financial

| Label                    | Identifier            |
| ------------------------ | --------------------- |
| Bank Account Number      | `bank_account_number` |
| Credit/Debit Card Number | `credit_card_number`  |

#### Credentials

| Label    | Identifier |
| -------- | ---------- |
| Password | `password` |

### Custom Labels

Custom labels are labels your organization creates for its own data types. They appear in **Manage Data Labels** and in the label picker.

### How Labels Are Assigned

**Automatic classification.** Deploy a [Data Discovery Satellite](/docs/guides/core-concepts/satellites) linked to an [AI Satellite](/docs/guides/core-concepts/satellites#ai-satellite). During schema discovery, the AI Satellite classifies columns and assigns labels automatically.

**Manual assignment.** In the Formal console under **Data Inventory**, select a column and choose a label from the dropdown.

**Custom label management.** Use **Manage Data Labels** in the Formal console to create and delete custom labels for your organization.

### Use Labels in Policies

Reference labels in <G anchor="policy">policies</G> to enforce data-sensitive access control. Labels are available via `col["data_label"]`.

```rego theme={null}
package formal.v2

import rego.v1

default response := {"action": "allow"}

# Mask any column labeled as email_address
response := {"action": "mask_value"} if {
  col := input.row[_]
  col["data_label"] == "email_address"
}
```

```rego theme={null}
package formal.v2

import rego.v1

default response := {"action": "allow"}

# Mask multiple sensitive label types
response := {"action": "mask_value"} if {
  col := input.row[_]
  col["data_label"] in ["email_address", "ssn", "phone_number"]
}
```

See [Policy Examples](/docs/guides/policies/examples) for more patterns.

## Tags

Tags are custom tags you define for organizing inventory objects. Unlike data labels, tags are not used for automatic classification by the AI Satellite.

Use tags to categorize data by team, environment, compliance scope, or any other dimension relevant to your organization. Tags are always custom.

Tags are also available in policy inputs. You can use them to write policies that target specific columns or files based on your own categories.

```rego theme={null}
package formal.v2

import rego.v1

default response := {"action": "allow"}

response := {"action": "mask_value"} if {
  col := input.row[_]
  "finance" in col["tags"]
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Deploy Satellites" icon="satellite" href="/docs/guides/core-concepts/satellites">
    Set up AI and Data Discovery Satellites for automatic classification
  </Card>

  <Card title="Write Policies" icon="shield-check" href="/docs/guides/policies/introduction">
    Use labels to enforce masking and access control
  </Card>

  <Card title="Policy Examples" icon="code" href="/docs/guides/policies/examples">
    See real-world policies using data labels
  </Card>

  <Card title="Terraform Provider" icon="cube" href="/docs/guides/configuration/terraform">
    Manage labels and inventory as code
  </Card>
</CardGroup>
