Skip to navigation

Recovery

Inspect and undo an agent's writes from a chosen time, including writes made with earlier runtime tokens.
View as Markdown

See selective undo in action

Watch one agent’s edits being undone while preserving the user’s and another agent’s work.

Before you begin

Use the owning user’s credentials through the app that created the agent. Agent Filesystem apps are configured for recovery.

Stop agent writes

Stop agent writes before recovery and keep them stopped until it finishes. dbx mount stop flushes pending changes and stops mount writes. Recovery does not stop mounts or revoke tokens.

Inspect an agent’s mutations

Use the owning user’s profile or the agents/mutations/list API:

dbx agent mutations build-agent --profile standalone-user

Results are newest first, subject to retention and current user access. Each entry shows TIMESTAMP_UTC, TIMESTAMP_US, OPERATION, and DETAILS (paths or both paths for moves). A folder move, rename, or deletion is one entry, without descendant entries.

Choose the mutation timestamp that includes the writes to undo: TIMESTAMP_US in text output, or timestamp_us in JSON. TIMESTAMP_UTC is the equivalent readable RFC3339 UTC time.

Timestamp precision

Mutation timestamps can be as coarse as one second, so several changes may share a timestamp. Recovery may undo the selected mutation as well as later writes.

The CLI requests one page of 100 mutations by default. Continue with next_cursor, or fetch all remaining pages:

dbx agent mutations build-agent \
--cursor "$NEXT_CURSOR" \
--profile standalone-user
dbx agent mutations build-agent \
--all --output=json \
--profile standalone-user

--limit accepts 1–1000, but a page may exceed the requested size. Cursors expire after 24 hours. JSON preserves mutation metadata in result.mutations, including timestamp_us; further pages are indicated by result.next_cursor.

Recover agent writes

Recovery job cursors are valid for 30 days.

1

Start recovery

Set RESTORE_TO_US to the selected mutation’s TIMESTAMP_US, replacing the value below. Use the owning user’s profile.

RESTORE_TO_US=1792444364000000
dbx agent undo build-agent \
--since-us "$RESTORE_TO_US" \
--profile standalone-user

Alternatively, use --since with TIMESTAMP_UTC in RFC3339 format, including timezone (for example 2026-10-12T14:30:00Z). Supply exactly one of --since or --since-us. The agent argument accepts an alias or agent ID.

2

Check status

Replace CURSOR with the returned cursor:

dbx agent undo-status --profile standalone-user -- CURSOR

Poll while status is in_progress; stop at complete or failed. Every successful status lookup exits 0, so scripts must inspect status, not exit code. For JSON, read result.status.

After completion, mutation history may show a rollback entry with the restore timestamp. Original entries remain.

Recovery results

Recovery limitations

Recovery preserves later work by others when resolving conflicts. Completion does not guarantee every selected revision was restored. If a job fails, changes already restored remain in place.

The same user and app can check an existing job after the agent is deleted.