Join our Newsletter — 33% off our NHI Course

Why do devices sometimes stay visible in asset inventory after an agent is uninstalled?

A device can remain visible because inventory systems often keep a historical record for a short period after the agent stops reporting. That lag helps preserve auditability and troubleshooting context. If the agent is truly removed, the record should disappear on its own after the platform’s retention window expires, rather than being force deleted early.

Why This Matters for Security Teams

Devices that remain visible after an agent is uninstalled are usually not a sign of failure by themselves. Inventory platforms often preserve the last known state for a retention window so teams can validate offboarding, investigate gaps, and avoid losing audit context. The risk is when operators assume that “still visible” means “still active,” or when a stale record is mistaken for a live one. NHI Management Group’s Ultimate Guide to NHIs — 2025 Outlook and Predictions notes that only 5.7% of organisations have full visibility into their service accounts, which is why cleanup logic, not manual deletion, matters.

For security teams, the real issue is distinguishing historical inventory from active telemetry. A device record may persist because the platform is waiting for a timeout, a final sync, or a retention policy to expire. That behaviour supports auditability, but it can also obscure whether an uninstall succeeded, whether the endpoint is merely offline, or whether the agent was removed while credentials or registrations remain elsewhere. Guidance from the NIST AI Risk Management Framework and related identity controls reinforces the need for clear ownership, lifecycle tracking, and defined state transitions. In practice, many security teams encounter “ghost” inventory entries only after a cleanup ticket, license audit, or incident review has already exposed the mismatch.

How It Works in Practice

Most inventory systems separate observed status from authoritative lifecycle state. When an agent is uninstalled, the endpoint may stop reporting immediately, but the asset record often remains until the platform can confirm inactivity across several check-ins or a configured retention period. That delay is intentional: it preserves evidence, supports troubleshooting, and prevents accidental loss of records if the endpoint is temporarily unreachable rather than truly removed.

Operationally, teams should verify three things: whether the agent uninstall completed, whether the device is still sending heartbeat or enrollment signals, and whether the inventory platform has a retention or decommission policy. A well-run offboarding process usually includes:

  • Agent removal confirmation on the endpoint itself.
  • Revocation of associated secrets, tokens, or enrollment credentials.
  • Expiration-based cleanup of the inventory record after the final report window closes.
  • Exception handling for offline, powered-off, or redeployed devices.

This distinction matters in environments with EDR, MDM, CMDB, or asset-management integrations, because each system may apply different timing rules. The failure mode is usually cross-system drift: one console shows the device as retired, another still shows it as active, and a third retains the record because it never received the decommission event. That is one reason NHI lifecycle discipline is emphasized in the Ultimate Guide to NHIs and why identity-centric governance shows up so prominently in the OWASP Agentic AI Top 10 and CSA MAESTRO agentic AI threat modeling framework, even when the immediate issue is just inventory hygiene. These controls tend to break down when device state is inferred from a single telemetry source in disconnected, intermittently online, or heavily integrated environments because the platform cannot reliably distinguish uninstall from outage.

Common Variations and Edge Cases

Tighter cleanup rules often improve clarity but increase operational risk, requiring organisations to balance faster record removal against the need for audit trails and recovery. Some platforms purge records quickly, while others preserve them for days or weeks to support forensics. There is no universal standard for this yet, so best practice is to document the expected retention window and make it visible to operations, audit, and endpoint teams.

Edge cases are common. A device may appear stale because it was renamed, reimaged, or moved between management domains. A “removed” agent may also leave behind enrollment artifacts, certificates, or cached registrations that cause the asset to reappear when the endpoint reconnects. In those cases, the inventory entry is not merely historical; it reflects a partial offboarding that still needs cleanup.

Where possible, align the inventory lifecycle to a clear decommission workflow: uninstall, revoke, confirm absence of heartbeat, then let the platform age out the record. The broader pattern is consistent with NIST guidance on risk-based control design and the practical lessons documented in NHIMG research on agent and identity compromise, including the Moltbook AI agent keys breach and CoPhish OAuth Token Theft via Copilot Studio. The exception is air-gapped or intermittently connected fleets, where delayed reconciliation is normal and “visibility” may lag actual endpoint state by design.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Covers lifecycle and revocation gaps when device records outlive agent removal.
OWASP Agentic AI Top 10 A2 Agent lifecycle drift can leave stale identity state after tool or agent removal.
CSA MAESTRO MAESTRO emphasises lifecycle and trust-state management for autonomous systems.
NIST AI RMF AI RMF supports governance over stale or misleading system state in AI-linked assets.
NIST CSF 2.0 PR.AC-1 Identity and access lifecycle controls apply when device records persist after removal.

Define authoritative state transitions for agents and enforce them across platforms.