Stop the agent and isolate every host it touched before changing credentials. Then suspend affected identities, revoke refresh tokens and sessions, invalidate cloud and source-control tokens, rotate every secret the agent could read, remove persistence, and verify in audit logs that old credentials fail. Finish by moving administrators to phishing-resistant FIDO2 authentication and testing account recovery.
Use this order: contain, revoke, rotate, verify
Credential rotation is not the first action. An unauthorized agent may still be running, hold an active session, or have created a second access path. Changing one API key while leaving a refresh token, browser cookie, OAuth grant, webhook, or scheduled task alive can let the agent return.
As an Amazon Associate I earn from qualifying purchases.
- Contain: disable the agent, isolate affected hosts or workloads, and suspend compromised identities.
- Preserve evidence: save prompts, tool-call records, configuration, environment-variable references, identity events, cloud logs, source-control logs, and endpoint records before cleanup changes them.
- Revoke access: invalidate identity-provider sessions and refresh tokens, temporary cloud sessions, API keys, source-control tokens, OAuth grants, and other delegated credentials.
- Rotate reachable secrets: replace every password, key, certificate, signing secret, database credential, CI/CD variable, webhook secret, and cloud credential the agent could read.
- Remove persistence: search for new users, access keys, grants, scheduled tasks, startup scripts, workflow edits, webhooks, and agent configuration changes.
- Verify: test that old credentials are rejected and replacements work only for approved principals, then harden administrator authentication.
AWS guidance for agent incidents recommends revoking affected agent identities and avoiding shared static keys. Treat the agent as a potentially compromised workload, not as a harmless automation process.
What “revoke access” actually includes
An agent can authenticate through several layers at once. Revoking only the credential visible in the agent’s configuration is incomplete.
#1 Best Overall
- POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
| Access layer | What to revoke or disable | Why it matters |
|---|---|---|
| Runtime | Agent process, container, virtual machine, job, or host network access | A running process can continue using already-issued tokens even after a new secret is generated. |
| Identity provider | User or service identity, refresh tokens, browser sessions, registered devices, and application grants | Refresh tokens can mint new access tokens; device registration and grants can provide an alternate route. |
| Cloud control plane | Temporary role sessions, access keys, service credentials, and delegated sessions | Cloud credentials may remain usable from another machine unless explicitly invalidated. |
| Source control | Personal-access tokens, OAuth-app tokens, GitHub-App tokens, and refresh tokens | Repository access can persist independently of the original workstation or agent process. |
| Application and data plane | API keys, database passwords, SSH keys, signing keys, webhook secrets, and CI/CD variables | These secrets often provide direct access without another identity-provider prompt. |
| Persistence | New users, OAuth grants, scheduled tasks, startup scripts, workflow changes, webhooks, and altered agent configuration | Persistence can recreate access after the visible credential is revoked. |
Step 1: Contain the agent and preserve evidence
Disable the unauthorized runtime
Stop the agent at the control point that launches it: suspend the job, disable the deployment, stop the service, or quarantine the workload. If you cannot trust the host, isolate it from networks rather than relying on a graceful shutdown. Preserve a copy of the workload configuration and image identifier before rebuilding it.
Suspend identities and connected devices
Suspend every user, service account, workload identity, and device that the agent used or could have used. Do not assume the account shown in the last tool call is the only affected identity; inspect logs for delegated users, role assumptions, service principals, and registered devices.
Capture evidence before cleanup
Record prompts and model outputs that triggered tool calls, tool-call arguments and results, agent configuration, environment-variable names and references, process and network details, identity-provider events, cloud audit records, source-control events, and endpoint telemetry. Keep the evidence read-only and record who collected it. This preserves the ability to determine which secrets were exposed and which persistence mechanisms were added.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Step 2: Revoke Microsoft Entra sessions and refresh tokens
For an identity managed in Microsoft Entra ID, disable the user or service identity, revoke its refresh tokens, disable registered devices when the device is untrusted, and revoke active sessions. Perform these actions for every affected identity rather than only the account that reported the incident.
Microsoft cautions that application-issued session cookies may require revocation by the application itself and can remain valid until they expire. Therefore, after the Entra action, use each affected application’s session-management control to invalidate its cookies, remember-me sessions, device sessions, and API sessions. If the application cannot revoke its own cookies, keep the account disabled and treat the remaining lifetime as an active exposure while you isolate the application and rotate its secrets.
Rank #2
- POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Check grants and consent
Review enterprise-application assignments, OAuth consent, service-principal credentials, and delegated permissions associated with the identity. Remove grants the agent created or used without approval. A revoked user session does not necessarily remove an OAuth authorization that can be used later to obtain a new session.
Step 3: Revoke cloud sessions and access keys
Temporary delegation sessions
AWS documents immediate revocation for temporary delegation sessions and records the action in CloudTrail. Revoke each affected delegated session, including sessions issued to a role assumed by the agent. Save the CloudTrail event showing the revocation and use it as the reference point for verification.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsInvalidate temporary role credentials
AWS IAM can invalidate temporary role credentials issued before a selected time, forcing reauthentication. Choose a cutoff that covers the suspected exposure, then inspect subsequent role-assumption events for unexpected principals. Do not treat expiration as a substitute for revocation when an active incident is still being contained.
Replace long-lived cloud keys
Disable and replace every cloud access key, service credential, or signing key the agent could read. AWS specifically advises against shared static keys for agent authentication. Issue separate credentials for each agent or workload, give them only the permissions required for their task, and store them in a managed secret system where available.
Step 4: Revoke source-control credentials
GitHub’s credential-revocation endpoint covers classic and fine-grained personal-access tokens, OAuth-app tokens, GitHub-App tokens, and refresh tokens. Revoke every token associated with the affected user, application, installation, or automation account, then replace only the tokens that are still required.
Rank #3
- POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
After revocation, inspect repository and organization audit events for newly created tokens, deploy keys, collaborators, team changes, workflow edits, and release or package settings. A replacement token should be issued to a distinct automation identity with the narrowest repository and operation scope that supports the job.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Step 5: Inventory and rotate every reachable secret
Build the inventory from what the agent could read, not only from what it actually used. Include secrets in environment variables, mounted files, configuration stores, build logs, command arguments, notebooks, deployment manifests, and connected services.
| Secret type | Required action | Replacement design |
|---|---|---|
| Passwords and passphrases | Reset them and invalidate existing sessions where the service supports it. | Unique value per person or workload; never reuse the old value. |
| API keys and service credentials | Revoke the old key, create a replacement, update consumers, then confirm the old key fails. | Short-lived or automatically rotated keys with narrowly scoped permissions. |
| SSH keys | Remove the compromised public key from authorized accounts and issue a new pair. | Separate key per operator, host, or automation workload. |
| Signing keys and certificates | Revoke or replace the key and assess whether previously signed artifacts must be reissued. | Hardware-backed or managed-key storage with restricted signing roles. |
| Database credentials | Rotate the account password or secret and terminate connections that still use the old credential. | Separate account per service, read-only where possible, with narrowly scoped schemas. |
| CI/CD variables | Replace variables in the pipeline’s secret store and review recent job output for disclosure. | Environment-specific credentials and short-lived job tokens. |
| Webhook secrets | Regenerate the secret and review webhook destinations and delivery history. | One secret per endpoint, with signature validation and minimal privileges. |
| Cloud access keys | Deactivate and delete exposed keys after replacement is deployed. | Workload identity or temporary credentials instead of shared static keys. |
Rotate in dependency order
Replace secrets in an order that prevents the new credential from being exposed by an old one: identity-provider and administrator credentials first, then secret-store access, cloud and source-control credentials, databases and internal services, and finally application integrations. Deploy each replacement through an approved channel and avoid pasting secrets into chat, tickets, prompts, or shell history.
Use distinct, least-privilege identities
Give each agent or workload its own identity. Scope permissions to the specific repositories, tables, queues, files, and operations it needs. Separate read and write roles, use short-lived credentials where supported, and make the default credential unusable outside the intended workload. This limits the blast radius and makes future revocation precise.
Step 6: Remove persistence and unauthorized changes
Search for persistence across every system the agent could reach:
Rank #4
- POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
- New local, cloud, directory, or source-control users.
- New access keys, role assignments, service-principal credentials, OAuth grants, and app installations.
- Scheduled tasks, cron entries, startup scripts, launch agents, and modified services.
- Changed CI/CD workflows, build definitions, deployment manifests, package settings, and release pipelines.
- New or altered webhooks, callback URLs, forwarding rules, and integration endpoints.
- Agent configuration changes, prompt-injection payloads, tool definitions, plugins, and environment-variable references.
Compare current configuration with a known-good version. Remove unauthorized objects only after recording their identifiers and timestamps. Rebuild an affected host or workload from a trusted image when its integrity cannot be established; do not rely on deleting one suspicious file.
Step 7: Verify that revocation worked
Review the right logs
Correlate identity-provider, cloud, source-control, application, and endpoint logs around the suspected exposure. Look for successful use after each revocation, new token issuance, role assumptions, device registrations, API calls from unexpected principals, and configuration changes made after containment.
Run a controlled rejection test
Where policy permits, attempt authentication with a revoked credential from an approved test context. The expected result is rejection, not merely a failed operation caused by a missing permission. Test the replacement credential separately and confirm that it succeeds only for its intended principal, service, repository, data set, and operation.
For AWS actions, retain the CloudTrail record of temporary-session revocation or role-credential invalidation. For application sessions, verify that both identity-provider sessions and application-issued cookies are no longer accepted. If an old credential still works, stop the rollout, disable it again, and trace which layer issued or cached it.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchControl comparison: choose the right revocation layer
| Control | Revocation scope | Session invalidation | Least-privilege support | Auditability | Blast radius | Recovery path | Distinct agent identity |
|---|---|---|---|---|---|---|---|
| Disable agent and isolate workload | One runtime, host, or workload | Stops new activity; existing remote sessions depend on network isolation | Depends on identity design | Endpoint and platform logs | Usually limited to the isolated workload | Rebuild or re-enable from a trusted configuration | Possible when each workload has its own identity |
| Disable Entra identity and revoke refresh tokens | All sessions and token issuance for the identity | Refresh tokens and sessions are revoked; application cookies may persist until app-side revocation or expiry | Application and directory scopes | Identity-provider audit records | Every application using that identity | Reset, review grants, then re-enable if trusted | Only if the agent uses a separate identity |
| Revoke AWS temporary delegation session | The affected delegated session | AWS documents immediate revocation | IAM policy and role scope | CloudTrail records the action | Resources reachable through that session | Issue a new approved session | Yes, when the role is dedicated to the agent |
| Invalidate AWS role credentials before a cutoff | Temporary credentials issued before the selected time | Forces reauthentication | IAM policy and role scope | CloudTrail and IAM records | All sessions covered by the role and cutoff | Assume the role again after review | Yes, with a dedicated role |
| Revoke GitHub tokens | Covered personal, OAuth-app, GitHub-App, and refresh tokens | Revocation behavior is provider-controlled; verify rejection directly | Token and repository scopes | Source-control audit records | Repositories and organizations reachable by each token | Issue a replacement to an approved automation identity | Yes, with a dedicated account or app |
| Rotate application and infrastructure secrets | Each individual secret and its consumers | New secret takes effect after dependent services are updated; old secret must be disabled | Service, data, and operation scopes | Secret-store, deployment, and application logs | Systems that share the secret | Deploy the replacement and roll back only through a trusted path | Yes, when secrets are not shared |
Administrator recovery with FIDO2
After containment and credential replacement, harden administrator access. Microsoft states: “FIDO2 security keys provide hardware-backed, phishing-resistant authentication that protects against credential theft and unauthorized access.” Enroll compatible FIDO2 security keys for administrators, keep a separate secure recovery method, and test recovery before closing the incident.
Best Value
- FIDO2 & Passkey Ready: Business-ready and FIDO2 L1 certified. This key is supported by major management suites and is ideal for both individual and enterprise deployment. Works seamlessly with Gmail, Facebook, GitHub, Dropbox, Coinbase, and more.
- Universal Connectivity (USB-A ): Features a built-in USB-A connector—simply unfold the key and plug it into your compatible PC or laptop for seamless authentication on the go.
- Dedicated Manager App: Use the Thetis Manager App for the initial hardware PIN setup. Setting the PIN on the device first ensures a smooth registration process. Once the PIN is configured, you can begin registering the key across your favorite FIDO2-compatible online services.
- Ultra-Durable & Portable: Featuring a rotating metal cover, this key is water, crush, and tamper-resistant. It fits easily on a keychain and requires no batteries or network connectivity.
- Check FIDO2 compatibility before purchase - Known limitations: ID Austria is not supported (requires FIDO2 Level 2). Windows Hello login only works with Windows Enterprise editions that support Entra ID, and NFC is NOT supported.
Do not make recovery depend on the same compromised device, mailbox, browser profile, or agent-controlled secret store. Record which administrators have working keys, which break-glass method is protected, and how the organization will revoke a lost key.
Common failure modes and corrections
Only changing the API key
Symptom: the agent reconnects with no new key visible in its configuration. Correction: revoke refresh tokens, sessions, OAuth grants, temporary cloud sessions, source-control tokens, and application cookies, then search for persistence.
Keeping the agent online during rotation
Symptom: newly issued credentials appear in logs or are immediately consumed. Correction: disable the runtime and isolate its host before deploying replacements.
Recommended Free Tools
Forgetting application-issued cookies
Symptom: a browser or integration remains authenticated after Entra sessions are revoked. Correction: use the application’s own session-revocation control and treat unrevoked cookies as active until expiry.
Rotating only the secret named in an alert
Symptom: unrelated systems show access from the same incident. Correction: inventory every secret readable by the agent, including mounted files, environment variables, CI/CD stores, databases, webhooks, SSH keys, and signing keys.
Reusing a shared replacement credential
Symptom: it is impossible to identify which workload used the credential or to revoke one agent without disrupting others. Correction: create a separate, least-privilege identity and short-lived credential for each agent or workload.
Deleting evidence before reviewing it
Symptom: the organization cannot determine what the agent accessed or whether persistence remains. Correction: preserve prompts, tool-call records, configuration, environment references, and logs before cleanup.
Free tools Windows power users keep installed
One-click scans. No signup required.
Incident-closure checklist
- The unauthorized agent is disabled and affected hosts or workloads are isolated.
- Compromised users, service accounts, devices, and workload identities are suspended or reviewed.
- Refresh tokens, identity-provider sessions, application cookies, OAuth grants, temporary cloud sessions, IAM credentials, API keys, and source-control tokens are revoked.
- Every reachable password, key, certificate, database credential, CI/CD variable, webhook secret, and cloud credential has been inventoried and replaced where necessary.
- New users, access keys, grants, scheduled tasks, startup scripts, workflows, webhooks, and configuration changes have been checked against a known-good state.
- Logs show no successful use of revoked credentials and no unexplained post-containment access.
- Replacement credentials are unique, short-lived where possible, least-privilege, and assigned to distinct agent or workload identities.
- Administrators have phishing-resistant FIDO2 authentication, a protected recovery method, and a tested recovery procedure.
AWS summarizes the purpose of session revocation plainly: “You can revoke access to maintain security and operational control.” Apply that principle across every identity, token, secret, session, and persistence mechanism the agent could reach.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

