Glossary

Soft delete

Marking a record or file as deleted instead of erasing it, so it disappears from normal use but can be restored until it is permanently removed.

Soft delete is a way of deleting data by marking it as deleted rather than removing it. The record or file stays in storage with a flag or timestamp that hides it from normal queries, lists and search, and it can be restored until a later process removes it for good. Most products show this as a trash folder or bin with a retention period, after which the item is hard deleted.

How soft delete works

In a database, soft delete usually means a deleted_at timestamp or an is_deleted flag on each row. Deleting sets the field and restoring clears it. Every query that serves normal reads adds a condition that skips flagged rows, and a scheduled job hard deletes rows once they pass the data retention window. File systems and storage services do the same with a bin: the file moves out of its folder into a holding area with its original location recorded, so a restore can put it back.

Object stores offer a version of this. With versioning turned on, deleting an object in Amazon S3 adds a delete marker and keeps the earlier versions until a lifecycle rule removes them; object storage and Exabase vs AWS S3 cover that model.

Because the item still exists, soft delete also leaves a trace of who removed what and when, which feeds an audit trail. It sits alongside other recovery tools. Version history recovers earlier contents of an item that still exists, a filesystem snapshot shows a whole workspace at an earlier moment, and point-in-time recovery does the same for databases.

Soft delete vs hard delete

The two are usually used together: soft delete first, then hard delete once the retention period ends. Restoring a backup is the blunter option, because it brings back everything as it stood at backup time.

Aspect

Soft delete

Hard delete

Restore from backup

What happens

The item is flagged or moved to a bin

The item is removed from storage

A copy of the whole system is restored

Can be undone

Yes, until the item is purged

No

Yes, to the time of the backup

Effect on other data

None

None

Changes made after the backup are lost

Typical window

Days or weeks, set by policy

Immediate

Depends on the backup schedule

Trade-offs

Soft delete makes every read path responsible for hiding deleted data. One query that forgets the filter shows deleted records to users, the same failure mode as relying on a tenant column for isolation, discussed in a WHERE clause is not tenant isolation. Some teams push the filter into the database with views or row-level security so it cannot be forgotten.

Deleted rows also take up storage, can clash with unique constraints, and stay in search indexes unless something removes them. For AI applications that last point matters: a soft-deleted document still sitting in a vector index can be retrieved and quoted, a form of stale knowledge in a RAG pipeline.

Privacy law sets a hard limit. A soft-deleted record still holds personal data, so an erasure request under the right to be forgotten needs a real hard delete within the required time. GDPR for AI agents covers how that applies to agent memory and logs.

Why soft delete matters for AI agents

An AI agent with write access will sometimes delete the wrong thing. With soft delete those mistakes stay recoverable for a while, and without it they are permanent. That difference is a large part of whether teams give agents write access at all, the argument in read-only agents are a dead end and what a bad agent run does to a workspace.

Soft delete is one piece of agent rollback. It covers deletions, while snapshots or history cover renames, moves and edits. It works best combined with agent permissions that limit which tools an agent may call, so deleting is possible but bounded.

Soft delete in Exabase

In Exabase, deleting a resource from a Base moves it to the bin rather than erasing it. The resource delete endpoint works this way, and so does the resource-delete tool that Workers use, as the Worker tools guide describes. Resources stay in the bin for 30 days and can be restored with the recover endpoint or through snapshot history. After 30 days they are permanently deleted.

If filesystem snapshotting is enabled on a Base, deletion state is recorded along with each resource’s name, folder and other metadata, so querying the Base at an earlier snapshotAt time shows resources that have since been deleted. The filesystem snapshotting guide covers the settings, and agent undo shows how the bin and snapshots fit together when recovering from a bad run. The agent context versioning use case applies the same pattern to agent work.

Deleting a whole Base is different: it is a hard delete of every file, memory, search index and snapshot in it, and it cannot be undone. By default Exabase first emails a deletion confirmation link, unless the request passes force=true.

FAQs

What is the difference between soft delete and hard delete?

Soft delete hides an item and keeps it restorable, while hard delete removes it from storage. Most systems soft delete first and hard delete once a retention period has passed.

Is soft-deleted data still stored?

Yes. It stays in the database or storage service until it is purged, so it still counts towards storage, can appear in backups and may need a hard delete to satisfy an erasure request.

How long should soft-deleted items be kept?

Long enough for people to notice a mistake and short enough to respect your retention policy. Thirty days is a common choice, and it is how long Exabase keeps deleted resources in the bin.

Can an AI agent recover files it deleted?

It can when the system soft deletes. In Exabase, a resource an agent deletes goes to the bin and can be restored for 30 days, from the bin or through snapshot history.

Is soft delete enough to undo an agent run?

It covers deletions only. Renames, moves and edits need snapshots or per-item history, and actions outside your data, such as emails the agent sent, cannot be reversed by any of them.

Related pages: Agent rollback, Filesystem snapshot, Version history, Point-in-time recovery, Data retention, Copy-on-write, Snapshot vs backup, Agent undo, Designing agents for recoverability: a checklist, Exabase vs AWS S3.

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.