Guide

Reviewing Vibe Coding API Keys: Practical Examples and Setup

A vibe coding setup accumulates keys faster than anyone reviews them. Here is how to find them, score them, and set up something better.

Quick Answer

Reviewing your vibe coding API keys means doing three things on a schedule, not once: find every key your setup actually holds, decide whether each one is still scoped as narrowly as it should be, and move the ones that aren't into a vault instead of a .env file. In practice that means searching your project folders and shell profile for anything that looks like a key, checking each provider's own dashboard for keys you forgot existed, setting an expiration on the ones that support it (OpenAI and GitHub both do), and routing day-to-day use through a tool such as the OS keychain or 1Password's CLI so the plaintext value stops living in a file at all.

Why vibe coding produces so many keys to review

Vibe coding moves fast by design: you describe a feature, an agent wires up the API call, and a working key for that provider shows up in a .env file within minutes. Do that across a model provider, a GitHub token for the agent to push with, a deploy provider, and two or three SaaS APIs over a few months, and you have a dozen live credentials with no single list of what they are or where they ended up.

This is the real shape of 'key fatigue': not too few keys, but too many to track by memory, scattered across .env files, shell profiles, and whichever provider dashboard you last visited. A review is how you turn that into a list you can actually reason about.

  • A fast setup habit (ask the agent, get a working key) is also how keys sprawl uncounted.
  • Key fatigue is a tracking problem, not a quantity-of-security problem.
  • The fix is a list of every live key, not a vague sense that there are 'a lot.'

Step one: find every key, including the ones you forgot

Start local. Search your project folders and your home directory for .env files, anything named credentials or secrets, and any shell profile (.zshrc, .bashrc, .bash_profile) that exports a variable ending in _KEY, _TOKEN, or _SECRET. Grep is enough: `grep -rliE '(api[_-]?key|secret|token)' ~/.zshrc ~/.bash_profile ~/projects`.

Then check the dashboards directly, because a key can exist on a provider's side with no local trace once the .env file that used it gets deleted. OpenAI's platform lists every active key under your project settings, with its creation date and (if you set one) its expiration. Anthropic's Console does the same for personal and workspace keys issued under the Claude API, and admin keys specifically are easy to spot because they're prefixed sk-ant-admin rather than the ordinary sk-ant- prefix every other key uses. GitHub lists every personal access token, fine-grained and classic, under Settings → Developer settings.

  • Local search: grep .env files, home folder, and shell profiles for key-shaped variable names.
  • OpenAI: Platform → API keys lists every active key with creation date and expiry.
  • Anthropic: Console lists personal, workspace, and admin keys; admin keys are prefixed sk-ant-admin.
  • GitHub: Settings → Developer settings lists every token, fine-grained and classic, separately.

Step two: score what you found

For each key, ask three questions. Is it scoped to one job, or can it do more than the task that created it needs? Does it expire, and if so, when? And is anyone besides you the clear owner, so a problem has a first call instead of a guess?

A classic GitHub personal access token fails the first question by design: it grants access to every repository you can reach across every organization you belong to, which is almost always more than one agent's one task needs. A fine-grained token passes it, because it can be limited to named repositories and named permissions at read, write, or admin level. Run the same test on every provider: can this key do things the task that created it was never going to do?

  • Scope: does this key's reach match the one job it was created for?
  • Expiry: does it expire, and is that expiry actually set, not just available?
  • Ownership: if this leaks, who finds out first and rotates it?

Step three: set expiry and rotation up for real

OpenAI's own production guidance is explicit: set an expiration date when you create a project API key, and run a regular rotation process, creating the replacement, switching your applications over, and revoking the old key only once the new one is verified working. An organization admin can also enforce a maximum key lifetime across the whole org through API Key Governance, and restrict what kinds of keys can be created in the first place, down to service-account-only if that fits how your team works.

GitHub's fine-grained tokens default to a 30-day expiration, shorter than most people would pick themselves, and an organization can force an even tighter maximum that overrides an individual's choice. Treat that default as a feature, not an inconvenience: a token that expires in weeks is a token that stops being useful to whoever finds a copy of it in an old log six months from now.

Anthropic's setup supports the same instinct through its Admin API, which lets an org member with the right role manage workspaces, members, and API keys programmatically instead of by hand in the Console, which is what makes scheduled rotation realistic instead of a manual chore someone always puts off.

  • OpenAI: set key expiration at creation, rotate on a schedule, revoke the old key only after verifying the new one.
  • OpenAI admins: API Key Governance can force a max lifetime org-wide and restrict what key types get created.
  • GitHub fine-grained tokens: default 30-day expiry, which an organization can tighten further.
  • Anthropic: the Admin API lets you manage and rotate keys programmatically, not just by hand in the Console.

Step four: stop putting the plaintext value in a file at all

Once you know what you have, the actual setup change is where the value lives day to day. A password manager's CLI is a practical, working example, not a theoretical one: 1Password's `op run` command loads secrets from your vault and runs a command in a subprocess with those secrets available as environment variables only for that process's duration, never written to disk. Point it at a reference file instead of a real .env (`op run --env-file="./prod.env" -- npm start`), where the file holds secret references like `OPENAI_API_KEY="op://vault/item/field"` rather than the value itself, and the plaintext never exists as a file your agent, or anyone else, can simply open.

If you'd rather not add a password manager to the stack, the OS keychain does the same basic job with less setup: macOS's Keychain, accessed through `security` on the command line or an app built on top of it, stores a secret encrypted and hands it out to an authorized process without a plaintext copy sitting in your project directory.

Either way, pair this with a scanning net as backup, not as the plan. gitleaks, an open source tool, scans git history, working files, or piped input for credential-shaped strings and runs well as a pre-commit hook or a GitHub Action, catching a key that made it into a commit despite everything above.

  • `op run --env-file="./prod.env" -- npm start` injects real secrets into one process, never to disk.
  • macOS Keychain via `security` is a no-extra-tool alternative with the same core property.
  • gitleaks (pre-commit hook or CI job) is the backstop for whatever still slips through.

Where Forkbench fits in a vibe coding review

Forkbench is a desktop app for macOS that runs coding agents, the kind doing the actual vibe coding, in real terminals. Its Vault stores a key in your Keychain and lets a command use it by name, so a value like your OpenAI or Anthropic key is applied the moment a command starts rather than sitting in a .env file the agent reads to understand your project.

This covers the review habit above in one place: the key never has to appear in the agent's context, the conversation, or the transcript, which is where a key most often leaks during vibe coding, not from the provider's side. It does not cover everything. An unpinned Vault key is still readable by the program a command actually runs with it, so scoping the key narrowly on the provider's side (step two above) still matters even with a vault in front of it. Forkbench's folder lock, which confines a Thread to chosen directories using the macOS kernel sandbox, is a separate and opt-in control; it bounds the filesystem, not the network, so it does not stop a key from being used to reach out once a command has it.

  • Forkbench's Vault keeps a key out of the prompt, the command line, and the transcript.
  • An unpinned key is still readable by the program the command runs; scoping it on the provider's side still matters.
  • The folder lock is a separate, opt-in control over the filesystem, not the network.

Related: An agent read my API keys, what now, API key security in a Python multi-agent framework, Securing your vibe coding setup with a local vault, Download Forkbench for Mac

Frequently asked

  • How often should I review my vibe coding API keys?

    Treat it as a recurring task, not a one-off, roughly every time you add a new provider or every few months at minimum. Keys accumulate quietly, and a review only works if it catches the ones you forgot about.

  • What's an example of a properly scoped key for vibe coding?

    A GitHub fine-grained personal access token limited to one repository and to only the permissions (say, contents and pull requests) the task needs, with its default 30-day expiry left on rather than extended.

  • Can I set my API keys to expire automatically?

    Yes, for the major providers. OpenAI lets you set an expiration when you create a project key, and GitHub's fine-grained tokens default to 30 days. Set it at creation rather than leaving a key open-ended.

  • What should I do the moment I find a key with no expiry and no clear owner?

    Rotate it: create a scoped, expiring replacement, switch your setup to the new one, verify it works, then revoke the old key. Don't leave the old one active while you investigate who it belongs to.

  • Does Forkbench review or rotate my API keys for me?

    No. Forkbench's Vault keeps a key you give it out of the agent's prompt and transcript once you've stored it. Finding, scoping, and rotating keys across your providers is still a habit you do yourself, using each provider's own dashboard or admin API.

Keep reading