Most offboarding checklists stop at the same point: disable the login, collect the laptop, remove the person from the group chat. That handles the person. It doesn't handle what the person built.
Over a year or two, an engineer, analyst or ops lead creates access that isn't tied to their own sign-in. A service account for a nightly job. An API key pasted into a reporting script. An OAuth grant that lets a SaaS tool read the shared drive. And now, an AI agent connected to their mailbox or the ticketing system. Some of this breaks loudly when they leave. Most of it keeps running with nobody watching.
The quiet part is the risk. Verizon's 2025 Data Breach Investigations Report says credential abuse is still the most common way attackers get in, and that the median time to remediate leaked secrets found in a GitHub repository was 94 days. A key with no owner is a key nobody rotates.
This is the order I'd work in.
In the first week of notice, ask the person leaving for a written list: every service account, API key, token, webhook, scheduled job and AI tool they set up or connected. They know more than any scan will find. Make it a handover task with a due date, not a favour.
Memory misses things, so verify. Look in:
Anything the systems show that isn't on their list goes to the top of the review.
A person, not a team. "The data team" owns nothing at 2 a.m. when a job fails. The new owner should know what the item does and be able to say whether it still needs to exist.
They probably had access to more secrets than they created: shared vault folders, .env files, config for tools they administered. Rotate those too. It isn't about trust. Former employees' laptops and password managers get compromised like anyone else's.
Cut interactive access on the last day as normal. Hold off deleting the account until steps 3 to 5 are done, because in some platforms deleting a user also removes or breaks what they owned. Then watch the logs for a week for failed authentications tied to the old account. Each one is something you missed.
Agents are where this gets harder each month. An agent connected "as me" inherits everything that person could do, and it may keep its own saved connections outside your identity provider. IBM's Cost of a Data Breach Report 2025 found that 13% of organisations reported breaches of AI models or applications, and 97% of those said they lacked proper AI access controls. For each agent the person connected, revoke its tokens in the source app (not only inside the agent), and if the work still matters, rebuild it under a dedicated identity with an owner.
The real win is never having to rebuild this from memory again. Three habits cover most of it:
You can do all of this with admin consoles and a spreadsheet. It's slower, and it depends on someone remembering every time, so it's worth automating the discovery step once you've done it by hand a couple of times. Whatever you use, the steps above are what matter: an owner, a decision and a rotation for everything a departing person leaves behind.
Originally published on my Substack: https://nurankhan.substack.com/p/when-someone-leaves-their-api-keys