
An AI workflow can be retired in a sprint review while its identity remains active for months. The agent may no longer appear in the orchestration platform, but a service principal, federated trust, API key, delegated OAuth grant, or cloud role can still exist in the systems that granted it authority. The operational change is visible to the product team; the residual access is often distributed across infrastructure and identity control planes.
This is a lifecycle problem. The right response is not to delete every principal that has been quiet for an arbitrary period. It is to establish ownership and purpose, detect changes in use, determine whether access still has a valid business need, and make narrowing or retirement a controlled, evidenced decision.
Begin with the relationship, not the account name
An agent identity may be represented by several linked objects: an application registration, a service principal, a cloud role, a Kubernetes service account, a secret, an OAuth grant, and downstream application permissions. Names are weak evidence of purpose. A principal called invoice-agent-prod may now serve a different workflow, while a generic integration identity may still be attached to the old one.
Inventory should capture the relationships that explain authority:
| Record | Question it answers |
|---|---|
| Principal and immutable identifier | Which identity is actually being reviewed? |
| Owning team and accountable owner | Who can validate its continuing purpose? |
| Agent, workflow, and environment | Which deployed execution path uses it? |
| Trust relationships and credential sources | Who or what can obtain or assume it? |
| Resource, action, and tenant scope | What can it do, and where? |
| Last observed use and evidence source | What activity has been measured, over what period? |
| Expiry, review date, and change reference | When must the decision be revisited? |
The inventory needs to connect the identity provider to runtime configuration and downstream authorization. A cloud role may appear unused while a gateway uses it on behalf of an agent; a workflow may use a credential through a broker, leaving no direct agent-to-cloud event. Mapping the execution path prevents a simplistic “no recent login means safe to delete” rule.
Detect residual access with more than one signal
Start from authoritative identity and permission inventories, then correlate them with workflow registries, deployment manifests, secret stores, API gateways, and audit events. Look for principals that no longer map to an active workflow; trust policies that still accept a retired workload; credentials without a named owner; broad permissions used only by a former task; and identities that have no recent activity despite a recorded dependency.
Cloud telemetry can help prioritize review. AWS IAM Access Analyzer, for example, can report inactive roles and unused service-level or action-level permissions over a configured observation window. Its documentation also describes limits: service-linked roles are excluded from unused-access analysis, and last-access evidence has specific coverage. Such findings are a review input, not proof that a permission is unnecessary. A seasonal workflow, emergency path, or infrequent reconciliation job can be quiet and still valid. AWS IAM Access Analyzer: unused access findings
Set the observation window to the business process. A weekly report and a quarterly close process do not have the same activity pattern. Where telemetry is incomplete, record that uncertainty and use owner confirmation, dependency analysis, and a controlled test before revocation. “No event found” should be interpreted as “not observed in this data and period,” not “cannot be used.”
Choose among retain, narrow, suspend, and retire
Every review should end with an explicit disposition. Retain when the workflow remains active and the current scope is justified. Narrow when the workflow continues but no longer needs its former resources, actions, environments, or duration. Suspend when a migration, incident, or ownership gap makes continued use uncertain and the business can tolerate a reversible pause. Retire when the workflow has ended and dependencies have been resolved.
Revocation should follow the actual identity chain. Remove the workflow binding, stop credential issuance or rotation, remove trust relationships, revoke grants, detach permissions, and invalidate credentials where supported. Deleting a directory object alone may not remove an API key copied into a secret store or a downstream permission that was granted independently. Conversely, deleting an identity that a shared service still assumes can interrupt unrelated workflows. Model both dependencies before execution.
For high-impact identities, use staged retirement: announce the proposed change, inspect dependency evidence, apply a reversible deny or disable control where feasible, monitor for failed legitimate calls, then remove the remaining grants. Define an escalation path and a bounded rollback. Rollback restores only the last approved scope; it should not recreate a broad legacy role because that is the fastest way to restore service.
A lifecycle trigger should follow the workflow
Traditional identity reviews often start from a calendar: every quarter, enumerate principals and ask whether they remain necessary. A calendar is useful as a backstop, but an agent identity should also be reviewed when its purpose changes. Relevant triggers include workflow retirement, a material change in task scope, a move between environments, a change in tool provider, a new data source, ownership transfer, and a change from human-assisted to unattended execution.
The trigger needs to cross organizational boundaries. A product owner may close a feature ticket without knowing that an integration team created an OAuth grant. An infrastructure team may decommission a deployment while a business system still trusts its service principal. Connect the workflow change record to identity and integration inventories so the review begins with the systems that can still grant authority.
Not every trigger means immediate revocation. A migration may run old and new paths in parallel; an agent may be temporarily paused; a service identity may be shared by a separately approved process. The trigger means that the old access decision has become a question again. Record the new purpose, transitional dependencies, and a deadline for resolving temporary overlap.
Trace the effective permission path
The principal’s attached policy is only one part of effective access. Resource policies, group membership, permission boundaries, organization-level controls, application grants, delegated tokens, and intermediary services can all affect the final decision. In some platforms a workload assumes a role; in others a broker receives a user token and calls a downstream API. A review that looks only at the agent’s manifest can miss authority introduced by the broker or resource owner.
For each important resource, document the chain from runtime to effect: which component requests a credential, which identity issues or exchanges it, what principal is recognized downstream, and which rule permits the operation. Confirm the chain with logs or a controlled request where possible. A diagram is useful only if it reflects deployed configuration, not an intended architecture that has drifted.
This tracing also identifies the right revocation point. Disabling a role may be the quickest control for cloud APIs, while revoking a refresh token or removing an application grant may be necessary for SaaS access. Short-lived credentials may expire naturally, but only if the runtime cannot refresh them and no parallel key remains active. Build the revocation plan from the actual credential path.
A review sequence for changing or retired workflows
Use a repeatable sequence that leaves room for engineering judgment:
- Confirm the lifecycle event. Identify the affected workflow, its last intended execution, any replacement, and the transition period.
- Enumerate identities and grants. Include cloud roles, service principals, workload identities, API credentials, delegated grants, and tool-level accounts.
- Map dependencies. Find callers, scheduled jobs, brokers, downstream services, and resources that still rely on each identity.
- Assess observed use. Compare logs and access-analysis signals against the workflow’s real cadence and known coverage gaps.
- Decide per permission. Retain, narrow, suspend, or retire, with a named owner and reason for each exception.
- Implement and verify. Revoke at the correct boundary, then test both expected denial and any replacement workflow.
Breaking the review down per grant is more precise than treating an identity as a single on/off switch. An agent may still need read access to a retained archive while no longer needing write access to a live system. Preserve the justified function and remove unrelated authority.
Avoid the common offboarding mistakes
Relying on a quiet period alone. Low-frequency jobs and disaster recovery paths can be legitimately dormant. Combine telemetry with business calendars and dependency evidence.
Deleting the visible agent object only. Credentials and permissions can outlive the orchestration object, especially when issued in separate identity or SaaS systems.
Leaving a shared identity in place. If the old and replacement workflow share a principal, future reviews cannot distinguish which process used it. Separate identities where feasible, or retain request-level attribution at the broker.
Treating an exception as permanent. Transitional access needs an owner, scope, expiry, and review date. An exception without an expiry quietly becomes the new baseline.
Testing only service availability. A decommissioning test should establish that the retired agent cannot obtain or exercise the removed capability, while confirming that unrelated workloads still function.
These errors are organizational as much as technical. Identity teams need a clear event from workflow owners; workflow owners need an accessible view of the grants they created. Automation can assemble evidence, but the business owner remains responsible for validating purpose.
Make the decision auditable across systems
An auditable review records the principal identifier, workflow version, owner, evidence sources and time range, permissions reviewed, disposition, approver, implementation change, and post-change observation. Where a permission is retained, record the reason and next review date. Where it is removed, capture the relevant identity and policy changes and verify the resulting effective access.
The record should distinguish the decision from the implementation. “Access removed” is not established by a ticket saying that a role was deleted. Evidence can include the approved change, identity-provider state, cloud policy state, secret revocation status, and a test showing that the retired workload can no longer obtain the protected capability. Retain only the telemetry needed for security and audit purposes, under the organization’s data-retention rules.
A control loop for the identity lifecycle
Treat workflow changes as identity events. A workflow owner should trigger an access review when an agent is decommissioned, materially repurposed, moved between environments, or moved to a different execution identity. Platform automation can then produce a candidate set of connected principals and grants. Owners validate business need; identity and security teams evaluate residual paths; an authorized change removes or narrows access; monitoring checks for unexpected dependencies.
The central question is not whether an agent still exists in a catalogue. It is whether every credential and authorization path associated with its former work still has a current, owned, bounded purpose. That question turns offboarding from a cleanup reminder into a verifiable security control.
Measure whether retirement is working
Useful operational measures include the proportion of agent identities with an accountable owner, the time between workflow retirement and access disposition, the number of overdue temporary grants, and the share of revocations verified at the downstream boundary. These measures indicate process coverage; they do not prove that every permission is appropriate. Pair them with sampled reviews of effective access and exceptions.
Track both false positives and missed dependencies. If a proposed revocation repeatedly breaks legitimate work, the inventory or dependency mapping may be incomplete. If retired identities remain active for long periods, lifecycle events may not be reaching identity owners. The objective is not to maximize deletion counts; it is to keep authority aligned with current purpose and to make departures from that alignment visible.



