Skip to content

Who holds the project keys? Identities and secrets for applications and agents

A glass identity core distributes distinct credentials to four services beside a protected secret against a dark navy background.

Series II: From infrastructure to agentic projects in production. Episode 04 of 20.

In the previous episode, we separated the networks of the fictional B2B portal for requests and documents. A firewall rule may allow the API to reach the database, but it doesn’t prove that the process requesting access is actually the authorized API. The main decision in this episode is to give each person, service, and automated process a distinct identity, and then to favor temporary credentials over shared, permanent keys where integration allows.

Identity is not the secret

A workload identity represents a running program, such as the API, a delivery job, or an agent. Here, workload means a unit of execution, not a human user. Authentication verifies the identity, while authorization decides what that identity can do. Just because a service has authenticated correctly doesn’t automatically grant it access to all data.

A secret is a value that must remain confidential, like a password, an API key, or a private key. A temporary token is a credential with limited validity. Expiration shortens the window in which a stolen copy can be used, but doesn’t prevent abuse while it’s valid, nor does it fix overly broad authorization.

Therefore, we don’t label all these elements as “keys”. First, we identify the actor, then the way they prove their identity, the permitted resource, and the length of access.

Four different actors in the portal

Hypothetical scenario: the portal has an API, a process for handling documents, a CI/CD pipeline for delivering new versions, and an integrated AI agent suggesting the classification of a request. The team also uses separate AI development agents for code and testing.

Human operators log in via individual accounts, ideally with multi-factor authentication and no shared admin accounts. The API and document process are assigned different service identities since their tasks differ. The CI/CD job uses an identity valid for the approved runtime and environment. The integrated agent calls controlled application functions—not the database using the API password. The development agent works in the test environment and repository, with no default path to production.

This separation reinforces the general rules on permissions, approvals, and audit. Here, our focus is on implementing identity in infrastructure and credential lifecycle management.

Where we store the secrets that remain necessary

Some systems don’t support federated identities or dynamic credentials. For those, a secret manager can store values encrypted, control who can read them, and log access. Choosing a product comes after taking inventory, not before. A .env file is handy for local use but isn’t a vault just because it’s excluded from Git. It can end up in a backup, a container image, a shared directory, or on a tool’s display.

Secrets must not appear in code, prompts, examples, tickets, or logs. If a development agent needs to run tests, we provide synthetic data and credentials for the test environment, injected at execution time only. We don’t ask the model to “remember” a key. If the integrated agent needs to use an external provider, its process reads the secret through a controlled mechanism; the secret isn’t included in the instructions sent to the model.

Academic research on public repositories has shown that key and secret leaks are not marginal incidents. Automated scanning can catch some errors, but doesn’t make accidental disclosure safe. A key found in history is considered compromised: we revoke or rotate it with the provider, investigate its use, and only then clean up copies where possible.

When OIDC and SPIFFE help

OpenID Connect, abbreviated OIDC, lets a trusted party verify claims about an identity. In GitHub Actions, for example, a job can receive an OIDC token, and a cloud provider can exchange it for a short-lived access credential. This way, the permanent cloud key no longer needs to be copied into the repository. However, trust policies still need to be narrowed by repository, environment, branch, and audience, according to the provider’s abilities. A token issued to any job is not an improvement if the cloud role is still overly broad.

SPIFFE is a set of standards for workload identity in dynamic, heterogeneous environments. A service can receive a verifiable identity document, called an SVID, used for authentication between services. SPIFFE isn’t a drop-in replacement for OIDC or all passwords. Also, its documentation assumes workloads are isolated well enough to prevent one from stealing another’s credentials—the mechanism for that isolation lies outside the standard. The segmentation from the previous episode remains important.

For a small business, the pragmatic rule is to start with the platform’s built-in mechanism. OIDC can eliminate permanent cloud keys from deployments. A workload identity provided by the orchestrator can separate the API from the document process. SPIFFE is worth considering if the project operates across platforms and is operationally complex enough. Rolling out more sophisticated identity infrastructure than the managed system may just shift risk, not remove it.

The registry that makes access verifiable

Before configuring, we fill out a simple registry. The table values are suggestions for the fictional scenario, not a certified configuration.

Identity

Resource and purpose

Credential

Duration / revocation

Owner

Production API

Database, application operations

Service identity or dedicated secret

Temporary or scheduled rotation

Application owner

Delivery job

Production environment, deploy only

OIDC and temporary cloud token

A single run; trust relationship revocation

DevOps

Integrated agent

Classification API and model service

Separate identity and controlled secret

Session or documented rotation

Product owner

Development agent

Repository and test environment

Limited technical account

Per task; revoke at completion

Technical lead

For each row, we check who approves access, where it appears in logs, which dependency issues it, and how we revoke it. We test both the allowed operation and another that should be denied. Rotation is tested before any incident: the service must adopt the new credential without leaving the old value active in an uncontrolled way. We keep a separate recovery procedure for cases where the secrets manager is unavailable, which is protected and accessible only to designated individuals.

The result is a registry of identities and secrets, with owner, purpose, duration, and revocation procedure. It highlights where permanent credentials still exist and provides a sequence for reducing them.

In the next episode, we’ll implement some of these rules as infrastructure as code, so that environments can be rebuilt and verified.

Sources

Manage your project's identities and secrets

Want to reduce permanent access and keys scattered across your projects? Talk to i8 about an identity registry and a migration plan.