Guide · Agency operations

Keys by person, project and client

Shared .env files make it impossible to say who can use what. Give every person and every agent its own identity, grant keys by client project, and load them for one command at a time.

By Mitchell Keller6 min read

Key answer

  • Give each person and each agent or machine its own identity. Never share one login.
  • Grant keys per client project and environment, only where the work needs them.
  • Load keys into one command instead of writing them to a file an agent can read.
  • Access control decides who can use a key. It does not decide how much they can spend.
On this page

Shared .env files do not scale

Every new tool means another key, and the easy path is to paste it into a file and pass the file around. After a few clients you cannot say who has which key, rotating one means chasing every copy, and an agent working in that folder can read all of them.

I use Infisical to manage which people and projects can reach which keys. It is a secrets manager: keys live in one place, grouped by project and environment, and each person or machine gets access only to what it needs. Any secrets manager with per-project access and a command runner works for this method.

How access flows

Each person or agent has its own identity. That identity is allowed into specific client projects and environments, and nothing else. When work runs, the keys are loaded into that one command and disappear when it ends. Paid calls still pass through the campaign budget check, which is a separate control.

  1. Identityone per person or agent
  2. Project and environmentonly what the work needs
  3. One commandkeys loaded, then gone
  4. Budget checkseparate, on paid calls

Six steps on one page

  1. Inventory. List every service you hold a key for, which client it serves, and who owns it.
  2. One identity each. Every person gets their own login. Every agent or server gets its own machine identity. If two things share a login you cannot tell them apart later.
  3. Grant the minimum. Put keys in a project per client (or per internal system) and split by environment. Give each identity only the projects and environments its work needs.
  4. Load for one command. Run the work with keys injected for that command, for example infisical run -- <your command>, instead of writing them into a file.
  5. Revoke and rotate on change. When someone leaves a client or the team, remove their access the same day and rotate any key they could read.
  6. Make paid use attributable. You should be able to say who ran a paid job, for which client and which campaign.

A worked example

A made-up agency with one client, ACME, and two internal systems. The people, codes and dates are invented.

Access map (hypothetical)
RoleClient codeServiceEnvironmentAllowedOwnerReview
OwnerAllAllprod, devRead and change keysOwnerQuarterly
Campaign operatorACMESending, enrichmentprodRun campaignsOwner2027-01-15
Copy agent (machine)ACMEModel APIprodLoad key for one runCampaign operator2027-01-15
ContractorACMEEnrichmentdevTest lookups onlyCampaign operatorEnd of contract

The contractor never sees production keys, and the copy agent never sees the sending or enrichment keys. When the contract ends, one change removes the access and the enrichment key gets rotated.

Close the side doors

Controls only work if there is no easier path around them. Old .env files with direct provider keys let anyone skip the workflow, so find them and delete them once the keys live in one place. Check what a provider's own limits actually do: some stop spending, most only send an email.

Some tools only read keys from a .env file in their folder, and most secrets tools can write one for them. Treat any file like that as readable by every person and every agent with access to the folder, and write it only for the tools that need it.

Get the blank access map

Source notes

This guide describes how I manage key access across my own agency work. Infisical is a third-party product; check its current plans and features on its own site. The access map is invented. The Legion course covers the setup we run in more depth for members; nothing here depends on it.

Run your agency on agents you can check

Get one useful GTM email a week. Then join the community on Skool.

Get the newsletter

Bring the GTM job you need done. Build the run you can check.

Get one useful GTM email a week. Then join the community on Skool.