# Retention Rules

Retention Rules are a special type of Automation that is only available for sites using HyperPrivacy Mode.

Retention rules help enforce your company's document retention policy by removing items after a certain period of time. You can also enforce the uniqueness of items with a retention rule that deletes copied files automatically.

## Retention is a Path Based Rule

Retention rules apply to a single path, or to all of the paths accessible to the rule's creator. All users can make new retention rules, but each user's rules apply to paths in the user's home folder or paths which are shared with them. An administrator cannot create a rule that globally applies to all folders in other users' home folders.

### Site-Wide Retention Rule

You can emulate a retention rule for your entire site. Choose one administrator who will be the only user with a home folder. Set up all of your other users without a home folder. The administrator creates any needed folders in their own home folder, then shares each folder with the users or groups who need access.

All of the folders in the site belong to one administrator's home folder, so that administrator can create a global retention rule.

## Event-Based Triggers

Retention rules delete files from the affected paths when specific actions are taken in those folders by any user. This can be any combination of read operations (either downloading or opening a file) or copying a file.

A retention rule that triggers on file Reads removes files whenever they are opened or downloaded. One use is an automated exchange flow where each file is downloaded only once for processing. If you deliver files to a counterparty who uses an SFTP script to download all files in a folder shared with their user account, a retention rule means the counterparty does not have to keep the folder tidy or determine whether a file has already been downloaded.

When an event-based rule triggers when files are copied, the copy of the item is immediately deleted. This essentially disables the copy function for the affected folders. You might use this rule for version control, so that only a single version of a particular file exists.

## Time-Based Triggers

Retention rules can be set to remove files a certain number of days after they are uploaded, or a certain number of days after they were last modified. The system checks for files that meet these time-based triggers every 12 hours.

## Activity

File deletions caused by retention rules appear in the Activity listing. The IP address for the action is 0.0.0.0. When a user performed an action that triggered the deletion, that user is logged as performing the deletion.

## Notifications

When configuring a new retention rule, you can add a step for notifying users about the deletions. As with notification automations, this can be configured to send to a combination of users or groups, but only those users who have access to the path that is removed receive the email.

File deletions caused by retention rules trigger any matching notification automations for deletions. Users only receive emails for files deleted from paths they have access to.

When notifications are configured for a retention rule and as a stand-alone notification automation, users may receive more than one email for the same activity.


---

# 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.exavault.com/hyperprivacy-mode/retention-rules.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.
