Delete agents and traces
A typo in an agent_name, a staging SDK pointed at production, or a malformed batch leaves junk in
your workspace. An owner or admin can remove it themselves, without contacting support:
- Delete an agent from the bottom of its agent page. This removes the agent and every trace recorded under it.
- Delete one trace from the bottom of the trace’s detail view.
To remove everything Morse holds about one of your customers instead, use End-user erasure.
Who can delete
Owners and admins only. Members and viewers do not see the controls, and the API answers 403 for
them. Deleting is not available in demo mode. Another workspace’s agent or trace id answers 404, and
the same agent name in another workspace is never touched.
Confirming
Deleting an agent opens a dialog that names what goes: its traces and spans, and its alerts and service targets (SLOs). The delete button stays disabled until you type the agent’s exact name (case-sensitive). Deleting a trace asks for a plain confirmation, and the dialog names the trace, its agent and its span count.
What is deleted
For every trace deleted, Morse removes the same data as an end-user erasure does:
- the trace, its spans and context segments;
- the rows derived from it, such as eval scores and scoring jobs, eval cases curated from it, replays, outcome and attribution records, record keys, log records and rule candidates;
- comments, feedback and the audit-history rows that held a copy of that content;
- the stored payloads (prompts and outputs) in object storage, once no remaining row refers to them;
- the copies in the analytics store.
Deleting an agent also removes the agent itself, with its alerts, service targets, topology entries, rule configuration and its outcome-failure groups. An error group that spans many agents is kept, but its sample from a deleted run is cleared.
What happens after you confirm
The request returns at once (202 Accepted). The trace, or the agent, disappears from the app
straight away, and a background job removes the data from the database, object storage and the
analytics store. For an agent with many traces, its traces leave lists over the next minute or so as
the job works through them. Analytics charts can show the deleted data for a few minutes longer.
If a store cannot be confirmed clean, the job retries with a growing delay and then hourly checks retry it again, until every store is done.
New traces under a deleted agent’s name
If your SDK keeps sending traces with the deleted agent’s name, they start a new agent. The deletion never reaches traces recorded after it, so stop or rename the source first.
Audit log
Every deletion is recorded in Settings → Workspace → Audit log as “Data deletion requested”, with who asked and what was deleted (“Agent support-bot”, “Trace 1a2b3c4d”). Status changes are recorded too. The record outlives the data it describes.
API
Both routes take your session or a JWT, not an API key: a leaked ingest key must never be able to delete data.
# What deleting the agent removes (nothing is deleted)
curl -H "Authorization: Bearer $MORSE_JWT" \
https://api.morsehq.dev/api/v1/agents/$AGENT_ID/deletion-preview
# Delete the agent: confirm_name must be its exact name
curl -X DELETE -H "Authorization: Bearer $MORSE_JWT" -H "Content-Type: application/json" \
-d '{"confirm_name": "support-bot"}' \
https://api.morsehq.dev/api/v1/agents/$AGENT_ID
# Delete one trace
curl -X DELETE -H "Authorization: Bearer $MORSE_JWT" \
https://api.morsehq.dev/api/v1/dashboard/traces/$TRACE_IDEach delete answers 202 with the deletion record (kind, label, status, per-store stores).
A wrong confirm_name answers 422 and changes nothing.
Backups
Database backups are snapshots and are not edited. Deleted data stays in them until they age out, which takes up to 90 days. The confirmation dialog states this number.
Related
- End-user erasure — erase one of your customers by
user_id. - GDPR — deleting your own account or organization.
- Trace detail