When the contract ends, the client decides whether its data dies
GDPR gives the client the choice between deletion and return; the FDE's job is to work in the right order and keep proof that every step was done.
In brief
- Under GDPR Article 28(3)(g), the client (the controller) chooses whether data is deleted or returned; the FDE does not get to decide.
- Deleting a KMS key makes data encrypted under it permanently unrecoverable, so disable the key first and only then schedule deletion.
- Clients are entitled to proof of compliance, so every step should leave something that can be produced in an audit.
For personal data, one short clause in GDPR decides how the last week of every contract plays out. Article 28(3)(g) says that when the service ends, the processor shall delete or return all the personal data, and the choice between the two belongs to the controller: the client.
It reads like a line for the legal department. In practice, the person holding admin rights, the encryption keys and the integration tokens is usually the FDE. On the final day you are the one typing the commands, so you need to know whose decision you are carrying out.
In the last week of an engagement you typically still hold admin rights on the client’s cloud account, a project-specific encryption key and a few tokens your connectors use to read their systems.
A clean close means nobody keeps access they no longer need, the data ends up where the client chose, and you have enough evidence to answer when the client asks again six months later.
Why does the order matter more than the commands?
Offboarding involves three jobs: revoking access, exporting or returning data, and deleting. Get the order wrong and the damage is usually permanent. Delete the key before the export finishes and the data is gone for good.
Revoke access too late and you leave behind exactly the anti-pattern AWS Well-Architected names: identities that have ended or gone inactive still holding permissions, which raises the risk of unauthorized access.
That guidance recommends documenting an access lifecycle, from initial grant through periodic review to offboarding, so this final stage should be planned from the first day.
The fourth job, and the easiest to forget, is evidence. GDPR Article 28(3)(h) requires the processor to give the client all information needed to demonstrate compliance and to allow for audits. Saying “it’s deleted” is not enough. You must be able to show what was deleted, when and how.
The first step is an email
Before touching any system, get the client’s choice in writing. Make the question specific: delete or return; if return, in what format, sent where, and who on their side signs to confirm receipt. Because GDPR gives the choice to the controller, a verbal yes in the final meeting will not do.
If the client chooses return, export the data while you still have read access. Use a narrow permission, just enough to export, and record checksums and record counts so the recipient can reconcile. Move on to revocation and deletion only once the client confirms they have received everything.
Revoke people and machines
The visible part is human accounts: IAM users, SSO, VPN, repository access. The Cloud Security Alliance notes that accounts and credentials can be revoked the moment someone leaves. It also warns that data not cleaned up after offboarding can easily lead to compliance violations and unauthorized access.
The part that gets missed is machine identities. The pipelines, agents and connectors you built often hold OAuth tokens issued by the client’s systems. RFC 7009 defines how to revoke them: servers must support revoking refresh tokens and should support revoking access tokens.
So on a server that follows the RFC, revoking the refresh token is the step you can always rely on. An access token may stay usable until it expires if the server does not support revoking that type, so record its expiry time in the handover record.
A sample runbook, start to finish
Take an FDE who has just finished a RAG project for an insurance company. Customer case files sit in S3, encrypted with a project-specific KMS key. The connector reads the CRM over OAuth. The client has replied to the email: they want one export, and the rest deleted.
Once the client confirms the export arrived complete, the runbook might look like this:
# 1. Revoke the connector's refresh token (RFC 7009)
curl -X POST https://auth.example-crm.com/oauth/revoke \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d "token=$REFRESH_TOKEN" -d "token_type_hint=refresh_token"
# 2. Deactivate the project service account's access key
aws iam update-access-key --user-name rag-pipeline \
--access-key-id "$KEY_ID" --status Inactive
# 3. Disable the KMS key first and watch for anything that breaks
aws kms disable-key --key-id "$PROJECT_KMS_KEY"
# 4. Once certain, schedule deletion with the longest waiting period
aws kms schedule-key-deletion --key-id "$PROJECT_KMS_KEY" \
--pending-window-in-days 30
Steps 3 and 4 are where you most need to slow down. AWS states plainly that once a KMS key is deleted, you can no longer decrypt data encrypted under it, and that data becomes unrecoverable. It is a very powerful way to delete, with no way back.
That is why AWS enforces a waiting period of 7 to 30 days before deletion, and advises disabling the key first if you are unsure. If, while the key is disabled, one of the client’s dashboards suddenly reports decryption errors, you have found a shared use of the key that nobody documented. There is still time to re-enable it.
Crypto-erase and the backup trap
Deleting data by deleting its key has an official name. NIST SP 800-88 Rev. 2, the media sanitization guidance published in September 2025 to replace Rev. 1, keeps cryptographic erase (CE) as the commonly used technique for any encrypted media.
For other techniques, Rev. 2 points to IEEE 2883, NSA specifications or standards approved by the organization.
But crypto-erase is only complete when the key itself exists nowhere else. AWS warns that for keys backed by CloudHSM, KMS does not delete the key material from the cluster’s backups. These are copies of the key, not the data: as long as those backups exist, the key can be restored, so they must be deleted separately.
Copies of the data itself are a separate gap. Snapshots, old exports on a laptop or a staging bucket encrypted with a different key all fall outside the reach of deleting the project key, so each needs its own deletion method.
The fix is to build a scope table before running the runbook. Give each place that holds data or keys one row: which key it uses, how it is deleted, and what the evidence is.
| Where data or keys live | Deletion method | Evidence kept |
|---|---|---|
| S3 bucket encrypted with the project key | Crypto-erase via KMS | Log of the schedule-key-deletion command and the deletion date |
| Key material in CloudHSM cluster backups | Delete the backups that still hold the key separately | List of deleted backup IDs |
| Connector OAuth tokens | Revoke under RFC 7009 | Response from the revoke endpoint |
| Exports on personal machines | Delete according to the organization’s standard | Signed confirmation from the machine’s owner |
The most common mistakes
The most common mistake is deciding on the client’s behalf. A conscientious FDE wants everything “cleaned up” and deletes it all, when the client needed a returned copy to move to a new vendor. Under Article 28, that choice is not yours.
The second is picking the shortest KMS waiting period to finish sooner. Seven days is valid, but it shrinks the window for discovering shared uses of the key. The third is forgetting tokens and backups, the two things that never show up on the user management page.
The last is treating offboarding as a one-off. NIST describes sanitization as building a program with appropriate techniques. If you write a fresh runbook for every project, sooner or later one project will miss a step.
Put the last day of the contract on your CV
Closing a project ships no new feature to show off, so it rarely makes the CV. Write one specific line: you wrote the offboarding runbook, used disable-then-wait to prevent accidental deletion, and handed the client a scope table with evidence.
When you describe a past project in an interview, explain how you closed it too. Interviewers will see that you treat responsibility for client data as lasting until the final day of the contract.
The last day is the last time the client sees how you handle their data. A complete scope table and a confirmation email are enough to keep the farewell from becoming an incident.
Was this article useful?
Thanks for the feedback!
7 sources
- Article 28 – Processor (GDPR text)
- NIST SP 800-88 Rev. 2, Guidelines for Media Sanitization · 2025-09
- Guidelines for Media Sanitization: NIST Publishes SP 800-88r2
- Delete an AWS KMS key – AWS Key Management Service
- SEC03-BP06 Manage access based on lifecycle – AWS Well-Architected Framework · 2024-06-27
- RFC 7009: OAuth 2.0 Token Revocation
- Best Practices for Deleting Information After Employee Offboarding – Cloud Security Alliance