# What happens when the agent is long gone, but its access key lives on?

DevFeed: [What happens when the agent is long gone, but its access key lives on?](<https://devfeed.tech/articles/what-happens-when-the-agent-is-long-gone-but-its-access-key-lives-on-104446.md>)

Original publisher: [Read original article](<https://thenewstack.io/governing-ai-agent-credentials/>)

Author: Zeen Rachidi

Published: 2026-10-28T14:00:00Z

Content type: article

Language: en

Sources: [The New Stack](<https://devfeed.tech/sources/the-new-stack.md>)

Topics: [Credential theft](<https://devfeed.tech/topics/credential-theft.md>), [least privilege](<https://devfeed.tech/topics/least-privilege.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [attack](<https://devfeed.tech/tags/attack.md>), [audit-logs](<https://devfeed.tech/tags/audit-logs.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-iam](<https://devfeed.tech/tags/aws-iam.md>), [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cloud-native](<https://devfeed.tech/tags/cloud-native.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [console](<https://devfeed.tech/tags/console.md>), [control](<https://devfeed.tech/tags/control.md>), [costs](<https://devfeed.tech/tags/costs.md>), [created](<https://devfeed.tech/tags/created.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [custom](<https://devfeed.tech/tags/custom.md>), [days](<https://devfeed.tech/tags/days.md>), [env-zero](<https://devfeed.tech/tags/env-zero.md>), [iam](<https://devfeed.tech/tags/iam.md>), [key](<https://devfeed.tech/tags/key.md>), [platform-engineering](<https://devfeed.tech/tags/platform-engineering.md>), [post-contributed](<https://devfeed.tech/tags/post-contributed.md>), [report](<https://devfeed.tech/tags/report.md>), [security](<https://devfeed.tech/tags/security.md>), [sponsor-env-zero](<https://devfeed.tech/tags/sponsor-env-zero.md>), [sponsored-post-contributed](<https://devfeed.tech/tags/sponsored-post-contributed.md>)

## AI overview

AWS IAM user access keys remain valid until someone disables or deletes them, so credentials can outlive the agents and projects that created them. The article shows how to query CloudQuery credential reports for active keys at least 90 days old and unused for at least 90 days, in ClickHouse or PostgreSQL. This is a review list, not proof a key is unnecessary: correlate results with audit logs and an accountable owner; root keys require a separate audit. For new credentials, an env zero OPA policy can deny selected long-lived key resources in Terraform and OpenTofu plans, including replacements, but it does not cover console or external-script creation, hardcoded secrets, or the deployment identity; unsupported plan formats are denied. OIDC federation can provide temporary AWS session credentials, though the role persists. TTLs trigger teardown rather than guarantee expiry: revocation depends on successful destruction of Terraform-managed credentials, and TTLs can be extended or delayed. For other keys, verify dependencies, deactivate and observe through the workload's schedule, obtain owner sign-off, then delete under change control. Entra ID exposes credential metadata and owners

## Source excerpt

Imagine: There's a line on the credential report that no one on the platform team can explain. An IAM user The post What happens when the agent is long gone, but its access key lives on? appeared first on The New Stack.