When an account appears compromised, the fastest reaction is often to delete it. That can stop some activity, but deletion can also remove identity records, group memberships, session metadata, ownership information, and other state that responders need to understand what happened. It may also make recovery harder if resources still depend on that identity.

A better incident-response mental model is to separate containment from destruction. Containment removes or sharply limits the account’s ability to cause new harm. Preservation keeps the relevant identity and evidence available long enough to investigate, recover, and make deliberate cleanup decisions.

This article explains how to quarantine a suspected compromised account, what state to preserve, how to decide which authority must end immediately, and why quarantine is only one part of incident response.

Separate the identity record from its authority

An account is not just a row that says who a user is. In a real system it may be connected to several forms of authority:

account
  |
  +-- active sessions
  +-- API credentials
  +-- group memberships
  +-- privileged roles
  +-- recovery methods
  +-- owned resources

Deleting the account treats all of those relationships as one problem. Incident response usually needs a more precise operation.

Suppose an administrator account starts performing changes that do not match normal activity. Responders want to stop further administrative actions immediately. They also want to know which roles the account held, which sessions existed, which resources it owned, and which actions were associated with it.

Those goals are compatible if the system can preserve the identity while removing its effective authority:

suspected account
      |
      +--> authentication blocked
      +--> sessions revoked
      +--> credentials revoked
      +--> privileged actions denied
      |
      +--> identity record retained
      +--> memberships recorded
      +--> ownership recorded
      +--> audit references retained

The core idea is simple: an identity can remain observable without remaining usable.

State the threat model

Account quarantine is intended to reduce damage after there is credible reason to suspect that an account or one of its authenticators is under unauthorized control.

The immediate threat is continued use of existing authority. An attacker may already have a valid session, API credential, recovery path, or other authenticator. Merely changing the visible account status is useful only if the systems that enforce access actually honor that status or receive an equivalent revocation signal.

Quarantine does not explain how the compromise happened. It does not remove malware from an endpoint, repair a vulnerable application, rotate unrelated shared credentials, or prove that every action attributed to the account was malicious. It also does not preserve evidence automatically; logging and retention must already be designed to survive the incident.

The control therefore has a narrow guarantee: under the system’s enforcement assumptions, it reduces the account’s ability to exercise authority while responders investigate and recover.

Make containment effective at every authentication path

A common failure is to add a field such as disabled = true and assume the incident is contained. That works only if every relevant path checks that state at the right time.

Consider a simplified application with password login and server-side sessions:

password -> login -> session -> protected request

Blocking future password logins closes the first path, but an attacker holding an already valid session may not need to log in again. The application must also make existing sessions unusable, either by revoking them directly or by making session validation reject sessions for the quarantined account.

The same reasoning applies to other authenticators. If the account has API keys, recovery codes, long-lived tokens, or delegated credentials, decide whether each one can still create or exercise authority after quarantine. A containment action that closes one door while leaving another valid is incomplete.

This does not mean every system needs one universal revocation mechanism. It means the incident procedure must map the account’s actual authentication paths and close the ones that matter.

Preserve state before changing relationships

Containment often requires changing security state quickly. Some of that state is also evidence.

For example, removing an account from all groups may reduce access, but the original memberships can help responders answer what the account could reach during the suspected compromise. Reassigning owned resources may be operationally necessary, but the previous ownership relationship may matter when reconstructing events.

Before destructive cleanup, preserve the security-relevant state in a location appropriate for incident records. Useful information commonly includes:

  • the stable account identifier;
  • authentication methods associated with the account;
  • active or recently active session identifiers and relevant metadata;
  • roles, groups, and explicit access grants;
  • service or API credentials attributable to the identity;
  • important resource ownership relationships;
  • timestamps for containment actions; and
  • references to relevant audit events.

Preservation does not mean copying secret values into an incident ticket. Store identifiers, metadata, and evidence according to their sensitivity. If a credential must be revoked, responders usually need to know which credential existed and when it was revoked, not expose the credential itself in additional systems.

The order matters:

identify relevant state
        |
        v
preserve needed evidence
        |
        v
revoke or change authority
        |
        v
verify containment

For an actively harmful account, do not delay urgent revocation merely to collect perfect evidence. The practical trade-off is to preserve what can be captured safely and quickly, then prioritize stopping further damage.

Prefer reversible containment when it meets the risk

A quarantine state is useful because it can be explicit and reversible. Instead of deleting the identity, mark it as unable to authenticate or exercise protected authority while keeping the record intact.

A conceptual policy might look like this:

if account.status == QUARANTINED:
    deny new authentication
    deny protected actions

This is teaching pseudocode, not a complete production policy. Real systems may need exceptions for tightly controlled recovery workflows or administrative investigation. Those exceptions should be explicit rather than accidental consequences of inconsistent checks.

Reversibility helps when an alert turns out to be benign or when the legitimate owner regains control. Responders can restore carefully selected access after resetting authenticators and validating the account rather than rebuilding an identity from incomplete records.

Reversible containment is not appropriate when retaining the identity itself violates a separate retention requirement or when a platform cannot reliably prevent a disabled identity from being used. In those cases, stronger cleanup may be necessary after the evidence needed for response has been preserved.

Treat shared authority as a separate containment problem

An account may know or control credentials that are not technically attached to it. Examples include a shared service secret, a deployment credential copied to several systems, or an administrative token used by a team.

Quarantining the account does not revoke those credentials because the authorization system may have no relationship between them and the account record.

This creates an important incident-response question: what authority could the compromised account obtain, not only what authority was directly assigned to it?

If the account could read a shared credential, responders may need to rotate that credential independently. If it could create new API keys or invite new administrators, they may need to review changes made during the suspected compromise. If it could alter recovery settings, those settings may need verification before access is restored.

This is defense in depth around quarantine. The account boundary is the starting point for containment, not necessarily the full blast radius.

Keep investigation access separate from the compromised identity

Responders sometimes need to inspect resources that belonged to the quarantined account. Re-enabling that account for convenience weakens containment and can make later evidence harder to interpret.

Prefer a separate, attributable administrative path for investigation. The responder’s access should use the responder’s own identity, appropriate authorization, and audit trail. If temporary elevated access is required, scope and expire it according to the sensitivity of the incident.

This separation gives investigators access to the evidence without restoring the suspected account’s authority. It also keeps later audit events distinguishable: actions by responders are recorded as responder actions rather than appearing to come from the compromised identity.

Verify containment instead of trusting the status flag

A quarantine procedure is not complete when an administrative screen says “disabled.” It is complete when the important authority paths no longer work as intended.

Verification should follow the account’s threat model. Confirm, for example, that an existing session can no longer perform a protected request, a revoked API credential is rejected, new authentication is blocked, and privileged roles cannot be exercised through a secondary interface.

Test the negative case as well: verify that evidence and ownership records required for investigation remain available to authorized responders. A containment mechanism that removes access successfully but also destroys the records needed to reconstruct the incident has solved only half of the problem.

Automated tests can cover stable invariants. If the application has a quarantine state, useful tests include:

quarantined account + old session -> denied
quarantined account + valid password -> no new session
quarantined account record -> still queryable by authorized responders

Production architectures differ, so the exact tests should match the authentication and authorization mechanisms actually in use.

Plan recovery before an incident

Quarantine is easier to use safely when recovery behavior is defined in advance. Otherwise responders may improvise under time pressure and restore more authority than intended.

A recovery process should decide what evidence is sufficient to return control to the legitimate owner and which security state must change first. Depending on the incident, that can include replacing compromised authenticators, revoking old sessions, reviewing newly created credentials, checking recovery methods, and validating privileged memberships.

Do not assume that removing the quarantine flag reverses every containment action. If sessions and API credentials were revoked, they should generally remain revoked; the legitimate user can establish new ones through the normal trusted process. Likewise, privileges removed because they were no longer justified should not reappear merely because the incident is closed.

This makes recovery deliberate rather than a rollback of every response action.

Know when quarantine is enough

For a low-privilege account with no shared credentials and reliable central session revocation, blocking authentication and invalidating sessions may provide sufficient immediate containment while investigation continues.

A privileged account justifies more defense in depth. Responders may need to review credentials it could create, secrets it could read, security settings it could change, and resources it could delegate. The higher the account’s authority, the less reasonable it is to assume that disabling the original identity contains every consequence of its compromise.

Quarantine also depends on enforcement reliability. If downstream systems continue accepting long-lived credentials without consulting current account state, those credentials require their own revocation mechanism. A central QUARANTINED flag cannot protect a system that never reads it.

Conclusion

When an account may be compromised, the first security goal is to stop its authority from causing more harm. Deleting the identity is not the same as containing that authority, and it can remove state that responders still need.

Design quarantine as an explicit security state: block new authentication, revoke or reject existing authority, preserve the identity and relevant evidence, investigate shared or delegated access, and verify that containment works across the real authentication paths.

The practical rule is to disable authority first and destroy state later, if destruction is still necessary. That separation gives incident responders a better chance to contain quickly without sacrificing the evidence and context required for a sound recovery.