Security

How to Offboard a Contractor Who Had Agent Access

Antonio Evans10 min read

A split-scene illustration: on the left, a contractor's ID badge being deactivated at a turnstile; on the right, a security engineer reviewing a dashboard of agent activity logs, with a checklist showing 'revoke'.
Key points

Key points

  1. 1Revoke the contractor's personal credentials first, starting with single sign-on and any API keys or tokens the agent used on their behalf, because agent connections often sit outside your identity provider.
  2. 2Rotate every secret the agent could reach, not just the ones the contractor created, since a delegated agent acts with whatever credentials it was configured to hold.
  3. 3Read the agent's action logs for the full tenure before you call the offboarding complete, looking for data reads, external calls and configuration changes.
  4. 4Assign a named security lead to sign off within 24 hours and record the evidence, so the review is auditable rather than a memory of what someone did.

Why agent access changes the offboarding math

Agent access breaks the assumption behind most offboarding checklists: that disabling the identity provider account closes the door. When a contractor connects an AI agent to internal systems, the connections usually live outside centralized identity infrastructure. The Scalekit team describes the pattern plainly: an engineer adds MCP servers to a tool's local settings file, authenticates each one with an OAuth flow or with API keys generated directly from each service, and those keys sit in a configuration file on a laptop, not in your SSO directory (Scalekit on revoking an agent's access).

That is the decision rule for the whole process. Anything the agent authenticated with is a credential you must treat as compromised at offboarding, regardless of whether it appears in your identity provider. Disabling Okta is necessary, but it is not sufficient, and it does not revoke a personal GitHub token or a bot token the contractor minted from a personal Slack app.

The contractor case is worse than the employee case for one structural reason: there is often no laptop return and no two-week notice period. Contracts end with a day's notice or none, and the service-specific credentials the contractor created may never be revoked if nobody knows they exist (Scalekit). Access also tends to accrete over an engagement: a contractor who needed one app ends up with root on a shared server, secrets handed over in world-readable files, and production deploying from repos under their personal account (MavenHandle on what to rotate).

Make the checklist trigger-driven, not calendar-driven

An offboarding checklist that depends on a manager remembering to open a ticket will fail on the day a contract ends early. Attach the checklist to events instead. Any of these should open the same ticket automatically, with the same owner and the same sign-off requirement:

Trigger eventWho fires itChecklist opens within
Contract end date reached or notice givenHR or the contracting managerSame business day
Contractor disappears or work stops without formal noticeProject leadSame business day
Agent permissions escalate unexpectedlySecurity monitoringImmediately
Contractor disputes a charge or leaves a platform account openFinance or the vendorSame business day
Quarterly access review finds an orphaned contractor identitySecurityAt the review, same week

Two design notes matter. First, the trigger must create the ticket, not just a reminder, because the work needs an audit trail. SecureSlate's guidance on access reviews is blunt about this: an unapproved review is not evidence, and auditors expect a named approver with a date (SecureSlate access review template). Second, if your reviews keep finding departed contractors with live accounts, the review is working and your offboarding is broken, so fix the offboarding rather than reviewing more often (SecureSlate).

CISA's Cyber Essentials frames the same idea for access generally: the authority you grant into your digital environment needs limits, and setting approved access privileges requires knowing who operates on your systems and with what level of authorization and accountability (CISA Cyber Essentials Starter Kit). Agent credentials belong in that inventory too.

Step 1: Revoke the contractor's credentials, same day

Work from the identity outward. The order matters because each step tells you what to look for next.

  1. Disable the identity provider account. This cascades to SSO-connected apps, but treat it as step one of six, not the job. Blocking new sign-ins is not evidence that every application session or token has stopped working (Elba offboarding checklist).
  2. Kill active sessions and refresh tokens. A disabled account with a live session is still a live account. Review the provider's documented procedure for credentials, sessions and authorized apps before deletion (Elba).
  3. Revoke personal access tokens the contractor generated. This is the step most teams miss. The token was made eight months ago, is not linked to SSO, and appears in no registry (Scalekit).
  4. Revoke or reassign non-human credentials tied to the agent. Bot tokens from personal Slack apps, deployment API keys with write access, and read keys into the data warehouse all fall here (Scalekit).
  5. Remove the agent's MCP server configuration and OAuth grants. Review direct sign-ins, guests, privileged roles and OAuth grants separately, and keep unknown coverage explicit rather than assuming full visibility (Elba).
  6. Do not delete shared or service accounts solely because the contractor used them. Preserve business continuity: identify files, mailboxes, billing ownership and automations that depend on the account and assign future owners first (Elba).

A useful mental model comes from WorkOS's agent permissions checklist: give every agent its own identity separate from the user it serves, and never pass the user's session or access token to the agent, exchanging it instead for a new, narrower token (WorkOS AI agent permissions checklist). If you built it that way, revoking the agent identity is clean and fast. If you did not, you are hunting tokens today, which is why the next step is non-negotiable.

Step 2: Rotate every secret the agent could reach

Rotate on the assume-compromise principle: rotation after exposure is the only safe default, and you cannot revoke what you cannot see. An audit should record a secret's type, location and permission, never its value, so the audit does not become the next leak (MavenHandle).

The rotation set is wider than "secrets the contractor personally created." It is every secret the agent's configuration could read or use. Use this checklist to scope it:

Secret familyRotate?Why
Root or admin password on shared serversYesAccess accretes; root on a shared server multiplies blast radius to every co-tenant (MavenHandle)
SSH keys with password login enabledYes, and disable password SSHSame reasoning (MavenHandle)
Third-party API keys (GitHub, Jira, Slack, hosting)YesThe agent held them in a local config (Scalekit)
Internal service tokens and deployment keysYesWrite access to a deploy path is a change path (Scalekit)
Database passwords in .env filesYesCommitted-secret history is a standard audit dimension (MavenHandle)
Signing keysYesKey compromise breaks trust in artifacts, not just access
Values in a shared secrets manager the agent could queryYes"Rotating credentials, even those in secure storage, and especially those granted to third-party services, helps mitigate risk" (Doppler)
Consumer-grade API keys used only for local testing with no production reachMaybeDocument the reasoning either way; a reader should be able to defend the call

Two practical cautions. Rotation is easier said than done at scale: manual processes and fear of downtime are the main reasons teams skip it, so automate where you can and stage the cutover (Doppler on secrets rotation). And rotation closes the credential, not the historical exposure: if the agent read data during the engagement, the fix is a determination about that data, covered in the next section.

A worked figure helps set scope. If your secrets inventory for one contractor engagement lists 14 distinct credentials across GitHub, Jira, a data warehouse, a deployment system, Slack and a database, the rotation is 14 changes plus verification, not a single password reset. Budget the ticket accordingly and write the count into the evidence record.

Step 3: Read the agent's action logs for the full tenure

Pull logs from the first day of the engagement to the revocation timestamp, not just the last week. The question the logs answer is specific: what did the agent do on the contractor's behalf? WorkOS reduces this to five questions every agent request should be able to answer: who is the agent, who is it acting for, what it is allowed to do in general, is this action allowed right now, and can you prove what happened and undo access (WorkOS).

If your logging records both identities plus the decision for every action, you can reconstruct the tenure. If it does not, that gap is a finding in itself. WorkOS lists "log both identities (agent and user) plus the decision for every action" as one of eight minimum controls (WorkOS).

Look for four patterns:

  • Volume and breadth of data reads. A agent reading a table it never needed is a signal, especially if the read happened late in the engagement.
  • External calls. Any outbound request to a domain you do not own deserves an explanation. The risk with agents is that the gap between "has credentials" and "can do something consequential" is essentially zero, and a schedule-configured agent does not need to decide anything (Scalekit).
  • Configuration changes. Deploy keys, CI settings, repository ownership, webhook targets.
  • Untrusted input handlers. An agent reads content, and content can contain instructions, so any action that followed text from an external source needs human review (UiChemy WordPress agent checklist).

A small filter helps you triage. Export the log and pull the exceptions rather than reading everything:

Filter agent action log where:
  actor = contractor's agent identity
  timestamp between engagement_start and revocation_time
  AND ( destination_host not in allowlist
     OR data_class in (restricted, regulated)
     OR action_type in (deploy, config_change, credential_create, external_write)
     OR called_after_contract_end = true )

The last clause is the one that catches the real problem: agent workflows configured to run on a schedule keep running after the last day unless someone kills them (Scalekit).

Step 4: Decide what the logs discovered, with a named owner

Logs do not close incidents. Someone has to classify each hit and record a decision. A three-way classification keeps this fast:

FindingDecisionOwner
Agent read data within the role it was granted, no external callsClose, record the read range as evidenceSecurity lead
Agent read data outside the role, no evidence of exfiltrationEscalate to incident response, assess notification obligationSecurity lead plus legal
Agent made external calls or ran after the contract endedTreat as a potential incident, invoke the incident response planSecurity lead, per your IRP

CISA's guidance for small organizations is relevant to how you handle the third row: review and approve the incident response plan before you need it, and invoke it even when you suspect a false alarm, because near misses drive improvement (CISA Cyber Guidance for Small Businesses). An agent that called an unknown host after the contract ended is exactly the kind of near miss worth invoking the plan for, even if the data turns out to be benign.

This is also where the sign-off requirement earns its keep. SecureSlate's access review guidance is that the departure of a person is an access question, and the evidence is a named approver with a date, with removals logged by username, system, role removed, date, reason and ticket link (SecureSlate). Elba makes the same point for SaaS offboarding: track one account per application, keep a requested change separate from a source-verified result, and assign each source change and record who checked the result, when, and where the evidence is retained (Elba).

Step 5: Get 24-hour sign-off and close the loop

The sign-off is not a formality. It converts a set of actions into a record you can defend in an audit or a client review, and it forces a second pair of eyes onto the rotation list.

A sign-off record that survives scrutiny contains six fields per line item: asset, change made, who made it, who verified it, verification method, and evidence location. Leave unresolved items open rather than marking them done, and store evidence references rather than passwords, tokens or copied personal data (Elba). A verification re-scan that confirms each item is actually closed is the difference between a shut door you can point to and a findings list you are left to act on alone (MavenHandle).

The 24-hour target is a design constraint, not a deadline. It works because each step is bounded: revocation is a fixed list of identities, rotation is a counted set of secrets, and log review is a filtered query, not a reading exercise. If your log retention cannot answer the query within 24 hours, that is your investment priority, not a reason to extend the deadline.

Test the whole path before you need it

WorkOS's eighth minimum control is the one teams skip: make revocation instant and cascading, and test it before you need it (WorkOS). A quarterly drill takes about an hour and pays for itself the first time a contract ends at 4 p.m. on a Friday.

Run it like this: pick a low-risk internal agent identity, revoke it at the identity provider, and time how long until its tool calls fail. Then check whether its API keys still work, whether its scheduled jobs still fire, and whether its logs answered the four patterns above. Record the elapsed times. If revocation depends on someone remembering a local config file on a laptop, you have found the same gap Scalekit describes (Scalekit).

For teams that want the identity layer to do the cascading for them rather than tracking tokens by hand, putting every model behind one credentialed API is a structural fix: agent traffic gets a single key you can revoke, and model calls appear in one log. Quanta Inference covers text, image, video, audio and embedding models through one API key and is OpenAI-compatible with prepaid pricing in US dollars (https://quantaintelligence.ai/inference). If your team manages several agents and contractors at once, a shared credit pool with an API key per person and admin controls makes the revocation list short and observable (https://quantaintelligence.ai/for-teams).

FAQ

FAQ

How is offboarding a contractor with agent access different from a normal employee offboarding?

The difference is where the credentials live. Employee offboarding usually closes SSO and collects a laptop, but agent connections are frequently authenticated with service-specific API keys stored in a local configuration file, outside your identity provider (Scalekit). Contractors also often have no laptop return and no notice period, so the standard process has no window to catch them.

Do I have to rotate secrets the contractor never personally created?

Yes, if the agent could reach them. The agent acts with whatever credentials it was configured to hold, so the rotation scope is the agent's reachable credential set, not the contractor's personal account set. Treat every exposed secret as compromised regardless of who likely saw it (MavenHandle).

What exactly should I look for in the agent's action logs?

Four patterns: data reads outside the granted role, external calls to domains you do not own, configuration changes such as deploy keys or webhook targets, and any action that ran after the contract end date. Scheduled agent workflows are the most common cause of the last one (Scalekit).

Who should sign off, and how fast is realistic?

A named security lead, with the record showing who made each change, who verified it, and where the evidence sits, and the whole checklist closed within 24 hours. That target holds because each step is bounded: a fixed identity list, a counted secret set, and one filtered log query. Leave unresolved items open rather than closing them without evidence (Elba).

What if I cannot reconstruct what the agent did because logging was thin?

Record the gap as a finding and make both-identity logging a precondition for the next contractor engagement. The minimum standard is logging the agent identity, the user it acted for, and the authorization decision for every action (WorkOS). If you also cannot rule out external calls, invoke your incident response plan rather than waiting for certainty, since near misses are meant to drive improvement (CISA).

Sources

Sources

  1. When an Employee Leaves, Who Revokes Their AI Agent's ...
  2. What to Rotate When a Developer Leaves | MavenHandle
  3. Free Access Review Template (Excel)
  4. PDF CISA Cyber Essentials Starter Kit
  5. Employee offboarding checklist: SaaS access template | Elba
  6. The AI agent permissions checklist for SaaS apps (2026)
  7. How to rotate secrets without downtime
  8. WordPress AI Agent Security Checklist
  9. Cyber Guidance for Small Businesses - CISA
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles