Back to Infrastructure
infrastructureL2 GuidedAgent Runtime & Sandboxing

Agent credentials scoped per project

Project-scoped agent credentials means that each project has its own dedicated set of credentials that agents use when working on that project, rather than agents inheriting the de

  • ·Dedicated development environments exist for agent execution (separate from developer's primary workspace)
  • ·Basic sandboxing via Docker or equivalent containers is implemented
  • ·Agent credentials are scoped per project (not a single org-wide key)
  • ·Container images for agent environments are versioned and reproducible
  • ·Credential rotation schedule exists for agent-scoped keys

Evidence

  • ·Docker or container configuration files for agent environments
  • ·Credential management configuration showing per-project scoping
  • ·Environment provisioning documentation or scripts

What It Is

Project-scoped agent credentials means that each project has its own dedicated set of credentials that agents use when working on that project, rather than agents inheriting the developer's personal credentials. Instead of the agent accessing GitHub with your personal token that has permissions across the entire organization, it uses a bot token scoped to the specific repository. Instead of accessing AWS with an IAM user that can read all S3 buckets, it uses a role that can only access the specific buckets the project needs.

This is the first implementation of least-privilege access for agents. It does not require containerization or cloud dev environments - project-scoped credentials can be implemented today in any environment by creating dedicated service account tokens and storing them separately from developer credentials. The mechanism is simple: create a credential, scope it to the minimum necessary permissions, store it in a project-specific .env.agent file or a secrets manager key, and configure the agent to use that credential rather than inheriting from the shell environment.

Project-scoped credentials provide two distinct benefits. The security benefit is containment: if an agent misbehaves or is compromised, the damage is limited to what the project credential can do. The audit benefit is attribution: when you look at audit logs for GitHub, AWS, or Jira, you can distinguish between actions taken by the developer and actions taken by the agent, because they use different credentials with different identities.

The practical challenge is credential management overhead. Creating and rotating scoped credentials for every project is more work than using personal credentials. This overhead is real but manageable with the right tooling. HashiCorp Vault's dynamic secrets (which generate short-lived, scoped credentials on demand) and GitHub Apps (which provide repository-scoped tokens without creating service accounts) are the tools that make project-scoped credentials operationally sustainable.

Why It Matters

  • Blast radius containment - a project-scoped credential that is compromised or misused can only affect resources within that project's scope, not the entire organization's infrastructure
  • Audit log attribution - operations performed by agent credentials appear in audit logs with a distinct identity, making it possible to reconstruct what an agent did independently of what the developer did
  • Compliance alignment - service accounts with documented scopes are the standard access model for compliance frameworks; project-scoped agent credentials fit naturally into SOC 2 and ISO 27001 access review processes
  • Rotation without developer disruption - project credentials can be rotated without touching the developer's personal credentials, simplifying the rotation process and enabling more frequent rotation
  • Enables multi-project agent workflows - when each project has distinct credentials, agents that work across project boundaries make explicit, auditable cross-project accesses rather than silently inheriting broad access

Getting Started

6 steps to get from here to the next level

Common Pitfalls

Mistakes teams actually make at this stage - and how to avoid them

How Different Roles See It

B
BobHead of Engineering

Bob's team uses personal developer tokens for all agent operations. A developer recently left the team, and Bob realized he had no way to know which systems might still have that developer's credentials stored in agent configurations. He asked three other developers to audit their agent setups and found credentials in .env files, shell profiles, and IDE settings - with no consistent pattern.

What Bob should do - role-specific action plan

S
SarahProductivity Lead

Sarah has been involved in a security audit and the auditors asked about AI agent access controls. She could not answer how agent credentials were scoped, what they had access to, or how they were rotated. The audit revealed that the team's AI tooling is a gap in their access management practices. Sarah needs to close that gap without creating so much overhead that developers stop using agents.

What Sarah should do - role-specific action plan

V
VictorStaff Engineer - AI Champion

Victor has built a credential management system for his own projects that he is proud of: each project has a .env.agent file with project-specific credentials, all stored in 1Password and rotated monthly. But it is a manual system that he manages himself. When he looks at the rest of the team, he sees ad-hoc personal credentials everywhere.

What Victor should do - role-specific action plan