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

# Overview

export const PublisherBadge = ({size = "md"}) => {
  return <Tooltip tip="Members with the publisher role can execute this action." cta="Workspace roles" href="/admin/users/access-control">
            <Badge icon="git-merge" color="green" size={size}>publisher</Badge>
        </Tooltip>;
};

export const PlatformUnsupportedBadge = () => {
  return <Tooltip tip="Platform API does not support this operation">
      <span className="inline-flex items-center gap-1.5 rounded-lg px-2 py-0.5 text-sm text-[rgb(var(--gray-500))] dark:text-[rgb(var(--gray-400))]" style={{
    marginLeft: '-0.5rem',
    cursor: 'default'
  }}>
        <Icon icon="ban" size={13} color="currentColor" /> Platform API
      </span>
    </Tooltip>;
};

export const ImmutableBadge = ({size = "sm"}) => {
  return <Tooltip tip="Property cannot be modified">
            <Badge icon="lock" color="gray" size={size}>immutable</Badge>
        </Tooltip>;
};

A **file rule** is a standing instruction about files on a device: whenever files matching a source pattern appear, upload them to a [bucket](/data-uploads/concepts/buckets), and govern how long the device retains them. Rules are shipped to devices as part of a [release](/concepts/releases).

For details on how to define file rules, see the [rule definition](/data-uploads/concepts/file-rules/rule-definition) page.

## Properties

<ParamField path="name" type="string" required>
  <ImmutableBadge />

  A human-readable name for the rule.

  Examples: `Robot Logs`, `Crash Reports`, `Camera Footage`
</ParamField>

<ParamField path="digest" type="string">
  <ImmutableBadge />

  A hash of the rule's resolved definition. File rules are deduplicated by digest within
  a workspace: pushing a rule identical to an existing one returns the existing rule
  instead of a duplicate.

  Example: `sha256:1234567890`
</ParamField>

<ParamField path="source" type="Source" required>
  <ImmutableBadge />

  Which files on the device the rule manages. See
  [sources](/data-uploads/concepts/file-rules/rule-definition#sources).
</ParamField>

<ParamField path="upload" type="Upload">
  <ImmutableBadge />

  An optional field that defines where matching files are uploaded to. Absent when the
  rule only manages local retention. See
  [uploads](/data-uploads/concepts/file-rules/rule-definition#uploads).
</ParamField>

<ParamField path="retention" type="Retention">
  <ImmutableBadge />

  An optional field that defines how long the device retains local copies of matching
  files. Absent when the device keeps them indefinitely — Miru never deletes them. See
  [retention](/data-uploads/concepts/file-rules/rule-definition#retention).
</ParamField>

## Immutability

File rules are **immutable**. A rule is created once, shipped to devices as part of
a [release](/concepts/releases), and never edited in place. To change
what is managed, you must create a new rule, release it, and deploy it to your devices.

## Git provenance

Rules are defined as YAML files in your Git repository and created by
[releasing them via the CLI](/data-uploads/define-file-rules). Each rule records the
Git commits it was released from — the commit itself and the rule file's path relative
to the repository root — so any rule in Miru can be traced back to the exact lines of
YAML that defined it.

## Deployment

File rules go into effect when a
[deployment](/concepts/deployments) containing the rule reaches the `deployed`
[activity status](/concepts/deployments#activity-status) on *that device*.

A file is processed only if it was created or modified after the rule took effect. Files that existed before the rule took effect are ignored as long as they remain unchanged.

## Create a file rule  <PublisherBadge />

<PlatformUnsupportedBadge />

File rules must be created as part of a [release](/concepts/releases). Visit the
[define file rules](/data-uploads/define-file-rules) page to learn how to create file
rules and releases.

## View a file rule

<PlatformUnsupportedBadge />

To view a file rule in Miru, navigate to the
[Releases page](https://app.mirurobotics.com/releases), and click into the release that
contains the file rule you want to view.

<Frame>
  ![Releases Page](https://assets.mirurobotics.com/docs/v04/images/releases/page.png)
</Frame>

At the bottom of the page under the **Overview** tab, you will find a list of the
release's file rules.

<Frame>
  ![Release File Rules List](https://assets.mirurobotics.com/docs/v04/images/releases/upload-rule-list.png)
</Frame>

To see more details about a file rule, click the dropdown arrow next to the file rule.

<Frame>
  ![Release File Rule Details](https://assets.mirurobotics.com/docs/v04/images/releases/upload-rule-details.png)
</Frame>
