Data Retention
Data retention decides how long ANTS Platform keeps the data your organization sends and collects. You set an organization default that every project follows. Each category of data can have its own period, each AI agent can have its own period, and a retention policy can give every agent with a tag one period. Audit logs have a separate setting. A nightly job permanently deletes data older than its period.
The page has three tabs: Retention periods (the organization default and the category table), Agent retention (one period per agent) and Retention policies (one period per tag value).
Open Organization Settings → Data Retention. Viewing the page needs tenantSecurity.dataRetention:read and changing any period needs tenantSecurity.dataRetention:admin. Among the built-in roles, Owner and Security & Compliance hold both. Saving a period also needs the data-retention entitlement (Enterprise plan, cloud or self-hosted); without it the controls are read-only and show Upgrade your plan to configure a data retention period. See Members & Roles and Billing & Plans.
How periods are decided
Every category uses the organization default, unless it has its own period or is locked to follow another category. A category period can be longer or shorter than the organization default.
| Category | What it covers | When it has no period of its own | Limits |
|---|---|---|---|
| LLM traces & observability | Traces, observations, scores and dataset run items. | Organization default | None |
| Session metadata | The records that group traces into sessions. A session is deleted once every trace in it is past the period. | Always follows LLM traces | Not editable |
| Attachments & file records | Media files attached to traces and the records that point to them. | Always follows LLM traces | Not editable |
| Prompt & response text | The prompt and response text inside traces and observations, and the raw payload files kept in object storage. | Files: platform default of 90 days, or the organization default if shorter. Text: follows LLM traces | At most the LLM traces period |
| Discover AI usage activity | Browser activity, desktop app sessions, command-line sessions, file transfers, network flows, MCP server activity, warn banner shows and dismissals, and prompt parser sessions from the Discover AI agents. | Organization default | None |
| Guardrail decisions | The record of each guardrail check and its result. | 90 days until the organization default is applied to all categories, then the organization default | Minimum 90 days |
| Device & agent telemetry | Check-ins from the agents installed on devices. No user content. | Organization default | None |
| Support tickets | Bug reports and feature requests raised from the Support menu, with their attachments. See Support Tickets. | Kept indefinitely until the organization default is applied to all categories, then the organization default | None |
| Administrative audit trail | Audit log entries. | Set separately, see Audit log retention | Minimum 1 year |
The periods you can pick are 30 days, 90 days, 6 months, 1 year, 2 years, 7 years and Indefinite. Periods below a category's minimum are not offered.
Prompt and response text
Prompt & response text can be kept for less time than LLM traces, so who called, when, with which model, at what cost and latency stays for the traces period while the text goes sooner. For example, traces for 1 year and text for 30 days.
- From the day a trace passes the text period, its input and output are hidden everywhere: trace and observation views, sessions, the public API, exports, evaluations, blob storage export and search. The trace view shows Content deleted by retention policy.
- The text is then erased in bulk once its whole calendar month (UTC) is past the period, so the stored bytes can remain on disk for up to about a month after they are hidden. Erased text cannot be restored by lengthening the period later.
- Agents with their own period or a retention policy keep their text for that period.
- Guardrail decision records keep their own period, and copies outside ANTS Platform, such as SIEM events, your own exports and dataset items, are not affected.
The text follows this period only once the row is saved. An organization that set a shorter period before this behaviour existed sees Text follows LLM traces on the row until it saves the row again; saving counts as a shortening and asks for confirmation.
Some records follow their own rules: server errors are deleted after 90 days with no occurrence and no open ticket, resolved automation alerts 30 days after they were resolved, and the reasons people give to continue to an AI tool 90 days after they expire, whatever the period.
What the page shows
On Retention periods, the coverage chips count how many categories use the default, a custom period, the platform default or are set separately; hover a chip to list them. The table lists each category with four columns:
| Column | Meaning |
|---|---|
| Data type | The category. Hover the info icon for a description, and select the chevron to show the records it covers. Session metadata and Attachments & file records appear inside the LLM traces row. |
| Kept for | The period in effect. Varies by project or Could not be read when there is no single value. People who can change retention see a dropdown here. |
| Source | Where the period comes from: Organization default, Custom, Minimum applies, Same as traces, Platform default, Set separately or Per project. Hover it for the reason, for example a note that the organization default is below the category's minimum and the category is held at it. |
| Last run | When the category was last purged and about how many records it removed. Failed with the time when the latest run failed; hover it for the error. A night that failed and then succeeded on retry shows as successful. |
Change the organization default
Pick a period
Under Organization default, choose a period. The hint says how many categories have their own period and ignore this setting.
Save and review
Select Save. A dialog lists every category with its Before and After period and the Result: Older data is deleted, Kept longer, No change, Held at its minimum, Follows LLM traces, Keeps its own period or Set separately. For a category that shortens, it estimates how many records will be deleted.
Confirm
Select Confirm, or Shorten retention when any category gets shorter.
Saving the organization default also applies it to Guardrail decisions and Support tickets. Until that happens, they keep their platform defaults and the page shows a notice with Review and apply, which opens the same review for the current default.
Give a category its own period
Pick a period in the category's Kept for dropdown. Choose Same as organization (or Platform default) to remove the category's own period.
A dialog shows the category with its previous and new period. When the change shortens retention, it is titled Shorten data retention?, estimates how many records older than the new cutoff will be deleted (and how many of those are already past the current period), and you confirm with Shorten retention. A longer period is confirmed with Save and deletes nothing.
Shortening retention permanently deletes all data older than the new period at the next purge. There is no grace period and no undo. Export anything you need to keep first. See Data Exports.
Audit log retention
Audit logs have their own setting in the Administrative audit trail row of the Retention periods table, with its own Save: 1 year, 2 years, 3 years, 5 years, 7 years or Indefinite (the default). It can never be shorter than one year, and the organization default and category periods never change it.
- Saving shows the period before and after. Shortening asks you to confirm in Shorten audit retention? with Shorten retention. The shorter period starts 7 days later.
- When audit log export to your storage is enabled for the deployment, entries are deleted only after the export has delivered them.
- Each purge writes an audit entry recording the period and how many entries were removed.
- A change raises the Audit settings changed automation event, and a failed purge raises Retention purge failed.
See Audit Logs.
Agent retention
An AI agent can have its own period, longer or shorter than the category periods. An override covers that agent's traces, observations, scores, raw prompt files, attachments and sessions. Guardrail decisions are not affected. An agent without its own period follows a retention policy it matches, or else the category periods.
A period for an agent reaches only traces that carry an agent ID, which your SDK sends. The tab shows what share of traces in the last 7 days carry one. Traces without an agent ID always follow the category periods.
The Agent retention tab lists every agent in the organization with its project, owner and what applies now, for example Own period: kept 30 days, No own period: follows retention policy or No own period: follows category period (2 years).
- Search agents, and filter by Project (when the organization has more than one), Owner (including Unowned), Retention (All agents, Has its own period, No period of its own or a specific own period) and agent tags. Clear All resets the filters.
- Show 25, 50 or 100 agents per page.
- Pick a period in an agent's dropdown, or Same as category period (Same as retention policy when a policy covers the agent) to remove its own period. The same confirmation as for a category applies, with an estimate of the agent's records that will be deleted.
To change many agents at once, tick them (the header checkbox selects the page, then Select all N matching agents selects every agent matching the search and filters). Choose a period in Set retention for selected agents, or Remove own period (same as category period). When some selected agents already have a period, choose Change them too or Keep their current period. A dialog shows how many agents are shortened, lengthened or unchanged, with a size estimate when retention shortens. Only the agents listed now are changed. One bulk change covers at most 500 agents.
When the only filter is one tag with any of its values, the bulk change can create a retention policy instead, so agents that get the tag later are covered too (Create policy).
You can also open an agent's period from the AI Agent Center detail panel: More actions → Data retention. The menu item needs data retention read access; changing the period needs admin access.
Retention policies
A retention policy keeps every agent whose tag holds one of the chosen values for one period, now and in future. For example, every agent tagged environment: production for 2 years. Nothing is copied onto the agents: an agent that gets the tag later is covered at once, and one that loses it goes back to its category period.
An agent's period is decided in this order:
- Its own period.
- The policy it was moved to, while it still carries that policy's tag.
- The longest period of any policy it matches.
- The category period.
Filter by the tag
On Agent retention, filter the agents by one tag with any of the values the policy should cover, then select Create policy. Only tags your agents have reported are offered.
Choose the period
Check the tag, pick the period in Keep for and select Review.
Answer for agents that already have a period
The review lists the matching agents. Agents with their own period need an answer: Yes, follow this policy removes their own period, No, keep their own period leaves them as they are. Agents already on another policy: Yes, move them to this policy or No, leave them on their current policy. Agents that stop matching after an edit are listed so a shortening is confirmed.
Save
Select Save policy, or Shorten retention when any agent keeps its data for less time.
- A policy has one tag key and up to 50 values, and an organization can have up to 50 policies. Tags whose name starts with
_are reserved. - Policies apply to every project in the organization.
- A change to an agent's tags changes its period at once. Removing a tag from an agent covered by a policy can shorten what it keeps.
- Guardrail decisions are not affected.
- The Retention policies tab lists each policy with its tag, period (Kept for) and agents. Edit a policy's values or period, show its agents, or delete it. Deleting a policy returns its agents to another policy they match, or to their category period.
Each policy change writes one audit entry, organization.data_retention_tag_policy_changed.
How the purge works
- The purge runs every night at 03:15 UTC. Data is deleted by the first run after it passes its period, so deletion can be up to a day late but is never early.
- For every project it deletes, per category and per agent override, data older than its period: traces, observations, scores, dataset run items, prompt and response files and text, attached media files, session records, Discover AI activity, device check-ins and guardrail decisions. Support tickets and their attachments are deleted per organization.
- Sessions and attachments are judged by the agent that owns them. A session or file shared by several agents is kept for the longest of their periods.
- When the database is busy, a project's purge waits and tries again later. After a period is shortened, a large backlog is removed over several nights.
- Indefinite deletes nothing.
- Audit log entries are purged by their own job, see Audit log retention. Notifications are not deleted by this job.
- Deleted projects are removed in full by project deletion, whatever the retention setting.
- Date range pickers do not offer ranges older than the period of the data they show: the LLM traces period on tracing pages and the Discover AI usage activity period in Discover AI.
Every change is recorded in Audit Logs with the old and new values: organization.data_retention_changed for the organization default, organization.data_retention_category_changed for a category, organization.data_retention_agent_changed for each agent (one entry per agent in a bulk change), organization.data_retention_tag_policy_changed for a retention policy and organization.audit_retention_changed for audit log retention.
Retention failure alerts
When a project's purge fails after its last retry, ANTS Platform raises the Data retention job failed automation event, naming the data that was not deleted, for example LLM traces & observability, Prompt & response text, Discover AI usage activity, Device & agent telemetry, Guardrail decisions, Agent retention overrides, Media files, Sessions or Unknown step. A failed purge of support tickets is reported to every project of the organization. Earlier attempts that fail and then succeed raise nothing, and a project raises at most one event per UTC day. The event has severity Medium and carries the retention period, the number of attempts and the error.
To be told, create an automation rule on Data retention job failed, for example an email to the platform owners. Rules on this event need project settings edit access. A failed audit log purge raises Retention purge failed (severity High) instead, which needs audit log read access.
To be told about changes, use the starter template Email project admins when data retention changes. It emails on organization and category changes, not on agent overrides, at most 20 emails an hour.
Project retention
Projects do not have their own retention control in the UI. Project Settings → General shows the organization period as read-only, with a link to Organization Settings.
When the organization period has never been set, a project can still carry its own period, set when it was created or updated through the organization Admin API (retention, either 0 or at least 3 days; a value above 0 needs the data-retention entitlement). In that case the table shows Varies by project. Once the organization period is set, it applies to every project.
Next steps
- Data Privacy: hide prompt and response content.
- Data Exports: keep a copy in your own storage.
- Audit Logs: review who changed retention.