All articles

AI Agents

AI agents for employee offboarding: revoking the access that outlives the person

You deactivated the leaver's user on Friday. The nightly integration they built still runs, and the agent they stood up still answers, because both authenticate as their own identities, not the person. Here is the Salesforce sequence that doesn't break the org, and the gap an offboarding agent can and can't close.

The developer left on Friday. HR triggered the offboarding, someone cleared the Active checkbox on their user, and the ticket closed. On Monday the nightly sync they wrote is still running, and the lead-qualification agent they built is still answering prospects. Deactivating the person touched neither.

That gap is why offboarding is worth automating well, and why an offboarding agent cannot be a one-click delete. The agents, OAuth tokens, scheduled jobs, and integration logins a leaver leaves behind authenticate as their own identities. Disabling the human account does not reach them.

An agent is good at the mechanical, reversible, evidence-generating half of offboarding. The irreversible calls, and the non-human identities, need a plan around it.

My split: let the agent freeze the account, inventory what the person owned and ran, revoke their tokens, strip their permission sets, and write the audit trail. Gate every destructive and judgment-laden step to a named human.

And treat the identities the person created, agents and integrations included, as a separate problem with its own owner. The onboarding playbook that granted all this access never had a symmetric step to take it back.

The Salesforce sequence that doesn’t break the org

There is a right order, and doing it out of order is how you break a dashboard or jam a nightly job. The order is freeze, reassign, deactivate.

Freeze first. The Freeze button on the user detail page blocks login immediately without touching the person’s profile, roles, sharing, or record ownership. Freezing is the reversible pause that lets you do the cleanup safely.

One thing freezing does not do is free the license: a frozen user still consumes it. Deactivation releases the license back to the org. It does not lower your bill, though; that is a separate change to your contracted license count.

Reassign everything the user owns and runs, because none of it moves on its own. Record ownership does not auto-transfer on deactivation, and Salesforce processes cannot update records owned by an inactive user. A scheduled job that touches those records starts failing.

Use Setup, Quick Find, Mass Transfer Records to move accounts, leads, cases, and custom objects to an active owner. Transferring away from an inactive owner needs the “Update Records with Inactive Owners” permission. If the person owns more than 10,000 records on an object, transfer before you deactivate, or the sharing recalculation can stall the org for hours.

Records are not the only thing that runs as that user. A dashboard runs as a specific running user, and every component breaks when that user goes inactive. Scheduled Apex, scheduled reports, and data exports owned by the leaver keep firing or start erroring, and automation keeps emailing a person who is gone. Reassign the running user on dashboards and scheduled jobs before you deactivate.

Then deactivate: Setup, Users, edit, clear Active, save. A few constraints are worth knowing first. You cannot delete a standard user at all, only deactivate, because deleting would orphan the records they authored. Integration users and the Automated Process user cannot be deactivated.

The deactivation blockers surface one at a time, clear one, retry, hit the next, which is why freezing first and reassigning methodically beats clicking Active off and fighting the errors live. Keep at least two active System Administrators so you never offboard your way into a locked org.

One step teams miss: a deactivated user can still hold permission set and permission set group assignments, along with group, role, and queue memberships. The profile is a single assignment, but the permission sets are the additive layer, and they are what you strip on the way out.

Revoking what the login can still reach

Blocking login is not revoking access. A refresh token the person’s connected apps hold keeps minting access tokens whether or not they can log in through the UI. Token revocation is its own step.

For a departing user, revoke their OAuth tokens from the user detail page under OAuth Connected Apps, or across the org from Setup, Connected Apps OAuth Usage, where Revoke appears per user. Seeing other users’ tokens needs the Customize Application permission.

The cascade matters: revoking a refresh token also revokes the access tokens issued from it, while revoking only an access token is closer to a logout. In code, Auth.OauthToken.revokeToken() handles it. If you revoke all JWT-based access tokens, budget for up to 30 minutes of propagation, and know it does not delete active sessions or revoke refresh tokens.

Two platform facts change this picture. The revoke tooling splits by app type: the Connect REST API usage resources that revoke one, all-for-a-user, or all-for-an-app tokens work for External Client Apps, not for connected apps. The move to External Client Apps touches offboarding directly for that reason.

If you need to hard-stop a login while cleanup runs, a Transaction Security policy on the LoginEvent can block a specific user ID, part of the toolkit in Real-Time Event Monitoring and Transaction Security. Test any Apex-backed policy in a sandbox first, because a faulty one fails closed and locks people out.

The durable fix is upstream: integrations should never authenticate as a human. A dedicated integration user means a person leaving never breaks a sync, and rotating one client secret affects exactly one integration.

The Salesforce Integration license ships with the Minimum Access API-Only Integrations profile and the API Integration permission set license, and EE, UE, and PE orgs get five of these users free. That discipline keeps token hygiene manageable, the same ground as auditing your OAuth tokens.

The agent that outlives the employee

Here is the part that surprises people the first time. An Agentforce agent runs as its own user, not as the person who built it. Salesforce provisions an agent user record (the Einstein Agent license and the Einstein Agent User profile, or a Salesforce integration user) with minimal access, and the agent operates under that identity.

Deactivating the builder does nothing to the agent’s runtime access, because the agent was never running as the builder.

So when a builder leaves, the thing to offboard is not the agent’s run identity. It is everything they personally owned and authored: the agents, the Flows, the Prompt Builder templates, the connected apps or External Client Apps they registered, and any integration authenticating under their personal login or a token in their name.

Reassign ownership of that metadata to a living owner, and revoke the personal tokens. The agent’s own identity, the one that answers customers, stays put, which is correct, as long as someone who still works there owns and governs it.

Which user an agent runs as, and why it can touch what it touches, is the subject of the agent user. Governing the whole set of them before this becomes a crisis is agent fleet governance.

Non-human identities and the gap SSO doesn’t close

Scale this up and it is the defining identity problem of an org running agents. Disabling someone in your identity provider is a directory action over the login path. It does not reach the OAuth grants, API keys, service accounts, and agent credentials created inside the apps after login.

SCIM deprovisioning, the standard most orgs lean on, flips the Salesforce user’s active flag to false and stops there. It does not hunt down and revoke that user’s tokens or the service identities they spun up.

The industry has caught up to naming this. OWASP’s 2025 Non-Human Identities Top 10 ranks improper offboarding as the number one risk: the orphaned service account or access key nobody deactivated when the work or the person it belonged to went away.

The pattern that answers it is a registry: every non-human identity, agent included, mapped to a named human or team owner and a business purpose. When an owner leaves, every identity they held is flagged, and each one gets one of three decisions: reassign to a new owner, suspend pending review, or revoke outright.

Suspend before you destroy, the same freeze-then-deactivate logic Salesforce already enforces, so you can reverse a mistake.

The standards are catching up more slowly. A set of early IETF Internet-Drafts proposes extending SCIM with an agent resource type and governance metadata, including an owner reference and a lifecycle state richer than an active flag.

They are individual drafts, not ratified standards, and one has already lapsed, so treat them as a direction, not something to build on this quarter. The registry and the owner discipline you can put in place today.

What the agent automates, and what stays a human’s call

An offboarding agent is a strong fit for the deterministic, reversible, logged work:

  • Freeze the account the moment HR signals a departure.
  • Inventory what the person owns and runs: records, dashboards, scheduled jobs, Flows, group and queue memberships, connected-app OAuth usage, active tokens.
  • Revoke their OAuth and refresh tokens, and block the login with a Transaction Security policy while cleanup proceeds.
  • Strip permission set and permission set group assignments, and remove role, group, and queue memberships.
  • Assemble the audit evidence: who did what, to which access, and when.

What stays a human decision is anything irreversible or judgment-laden. Who records, dashboards, and agents transfer to is a business call, not a routing rule. A legal hold has to pause any destructive step until compliance signs off. Whether an orphaned agent gets reassigned, suspended, or retired is a sign-off, not a default.

The working pattern fits every high-stakes automation: the agent executes and logs, and a named person approves each step that cannot be undone, the human-in-the-loop gate you design before you need it.

Where I would start

Two moves pay off immediately. Wire the freeze to the HR trigger, so a departure blocks login in minutes while the slower reassignment work queues behind a human.

And start the registry now: every integration user, every agent, every connected app and token, each with a named owner. The first time you build it, it is tedious. Every offboarding after that, it is the difference between a clean revoke and a Monday-morning surprise that the leaver’s agent is still answering customers and nobody owns it.

Deactivating a user was never the hard part. The access that does not run as that user is, and that is what an offboarding process, agent-assisted or not, is built to catch.

Understanding the basics

Does freezing a Salesforce user free up their license?

No. Freezing blocks login immediately and is reversible, but a frozen user still consumes their license. Deactivation is the step that releases the license back to the org for reassignment. Deactivating does not reduce the number of licenses you are billed for, though; that requires changing your contracted license count separately. Freeze is the safe pause while you reassign ownership; deactivate is the endpoint.

Why does an Agentforce agent keep running after I deactivate the employee who built it?

Because the agent runs as its own user, not as the builder. Salesforce provisions an agent user record (the Einstein Agent license and profile, or a Salesforce integration user), and the agent operates under that identity, so deactivating its creator does not touch its runtime access. When a builder leaves, offboard what they personally owned, the agents, Flows, prompt templates, connected apps, and integrations in their name, and reassign that ownership rather than assuming deactivation stopped anything.

What is the right order to offboard a Salesforce user?

Freeze, reassign, deactivate. Freeze first to block login without side effects. Then reassign everything that runs or is owned as that user: records (via Mass Transfer Records, before deactivating if over 10,000 on an object), dashboard running users, scheduled Apex and reports, and group, role, and queue memberships. Then clear the Active checkbox to deactivate and free the license. Revoke their OAuth and refresh tokens and strip permission set assignments, since those survive deactivation.

Can an AI agent fully automate offboarding?

Not safely. An agent can automate the reversible, mechanical, evidence-generating steps: freezing, inventory, token revocation, stripping permission sets, and assembling an audit trail. It should gate the irreversible and judgment-laden steps to a human: who records and agents transfer to, legal holds, and whether an orphaned identity is reassigned, suspended, or revoked. The durable pattern is the agent executing and logging while a named person approves each step that cannot be undone.


Building an offboarding process that closes the access deactivation leaves behind, and a registry of the agents and integration identities your org now runs on? Talk to us. Designing the freeze-reassign-deactivate flow, the token revocation, and the human gates so a departure never leaves an agent or a token running unowned is exactly the work we do.

Keep reading

All articles