# account takedown runbook This runbook is for operator action against accounts hosted on this ZDS instance. It covers test-account cleanup, emergency suspension, and long-term host takedown. It is not a global identity takedown mechanism. ## authority boundary A PDS operator controls local hosting for accounts on that PDS: - whether this PDS reports a hosted account as active - whether this PDS serves the account's repo, records, and blobs - whether this PDS accepts authenticated writes for the account - whether this PDS emits account-status events on its local firehose - whether this PDS retains or purges local account data according to policy A PDS operator does not, by this action alone, erase all downstream copies, control every relay or appview, or tombstone a PLC identity. Downstream services are expected to respect account-status changes, but propagation is hop-by-hop and can lag or diverge. References: - Account lifecycle guide: - Account hosting status spec: - Sync and `#account` events: ## status vocabulary Atproto distinguishes several inactive hosting states: - `deactivated`: user or host temporarily pauses the account. Content should not be displayed or redistributed, but infrastructure does not need to delete local copies. - `suspended`: host temporarily pauses the account. - `takendown`: host or service removes the repository long-term for policy or terms reasons. - `deleted`: account deletion. Downstream services should stop serving content and may delete data according to policy. ZDS stores account hosting state in `accounts.account_status`. The currently implemented operator states are: - `active` - `deactivated` - `takendown` `suspended` is reserved vocabulary from the protocol, but ZDS does not yet expose an operator workflow for it. `deleted` is reached only through permanent deletion (below); no account row carries it. Current behavior: - `com.atproto.server.deactivateAccount` sets `account_status: "deactivated"`. Under a takedown it records the deactivation separately, so clearing the takedown leaves the account deactivated, as the reference PDS keeps `deactivatedAt` apart from the takedown. - `com.atproto.server.activateAccount` returns the account to `active` only from `deactivated`. - `com.atproto.admin.updateSubjectStatus` can apply or clear `takendown` for a repo subject, and take down or restore a single record or blob (see [record and blob takedowns](#record-and-blob-takedowns)). - `com.atproto.admin.getSubjectStatus` reads the takedown status of an account, record, or blob, and the account's deactivation. - applying `takendown` ends refresh tokens and revokes OAuth token families. Access tokens stay valid until they expire, as in the reference PDS, so clients get `AccountTakedown` instead of a dead session. - ZDS emits a `#account` event with `active: false` and the precise inactive status. - `com.atproto.sync.getRepoStatus` reports `active: false` and the precise inactive status, and omits `rev` while inactive. - public repo/blob/read XRPCs and authenticated repo writes are denied while the account is inactive. ## response levels ### test account cleanup Use this when the operator owns the test account and wants to remove clutter. Default action: 1. Verify the account DID and handle. 2. Export or snapshot enough metadata to undo mistakes. 3. Deactivate first. 4. Leave physical purge as a separate, reviewed step. ### temporary safety pause Use this when an account may be compromised, abusive, or causing operational harm, but the final policy decision is not ready. Default action: 1. Capture evidence and timestamps. 2. Deactivate the account. 3. Revoke active local sessions and OAuth grants if the compromise involves credentials. 4. Verify `getRepoStatus` reports inactive. 5. Watch relay/appview behavior and logs. 6. Decide later whether to reactivate, keep suspended, or perform long-term takedown. ### long-term host takedown Use this when the PDS will no longer host the account. ZDS has a first-class `takendown` state for hosted repo subjects. It stops local hosting without deleting rows or blob bytes. Treat takedown as the normal long-term operator action; treat physical purge as a separate retention-policy decision. Behavior: - durable status distinct from user deactivation - `#account` event with `active: false` and `status: "takendown"` - `getRepoStatus` returns `active: false` and `status: "takendown"` - writes, repo exports, record reads, and blob reads are denied - refresh tokens end and OAuth grants are revoked; access tokens run out on their own Remaining gap: - ZDS should add a richer admin audit row for operator status changes. Until then, preserve external notes with actor, reason, timestamps, and affected DID. ## investigation checklist Before changing account state: ```sh fly ssh console -a zds-pds -C "sqlite3 /data/zds.sqlite3 \ \"select handle,did,account_status,datetime(created_at,'unixepoch'),\ datetime(activated_at,'unixepoch'),email \ from accounts order by created_at;\"" ``` For a candidate DID, inspect footprint before deciding: ```sh did='did:plc:example' fly ssh console -a zds-pds -C "sqlite3 /data/zds.sqlite3 \" select 'records', count(*) from records where did='$did' union all select 'repo_blocks', count(*) from repo_blocks where did='$did' union all select 'commits', count(*) from commits where did='$did' union all select 'blobs', count(*) from blobs where did='$did' union all select 'spaces_owned', count(*) from permissioned_spaces where authority_did='$did' union all select 'space_actor_state', count(*) from permissioned_space_actor_state where actor_did='$did' union all select 'space_records', count(*) from permissioned_space_records where repo_did='$did' union all select 'space_repos', count(*) from permissioned_space_repos where repo_did='$did' union all select 'session_tokens', count(*) from session_tokens where did='$did' union all select 'oauth_tokens', count(*) from oauth_tokens where did='$did'; \"" ``` Record: - handle and DID - who requested action - why action is justified - whether the account is operator-owned test data or another user's account - current record/blob/space footprint - whether a backup is needed before action - planned status and retention policy ## current ZDS actions For user-initiated deactivation, use the existing XRPC with the user's own bearer token. For operator-driven takedown, use the admin XRPC with `ZDS_ADMIN_TOKEN`: ```sh curl -fsS -X POST "https://pds.zat.dev/xrpc/com.atproto.admin.updateSubjectStatus" \ -H "authorization: Bearer $ZDS_ADMIN_TOKEN" \ -H "content-type: application/json" \ --data-binary @- <