Security
Keyfit decides which credentials claude, codex, opencode, copilot, gemini, aws, gh, vercel, supabase, wrangler, convex, gcloud and firebase get. This page says what it can see, what it keeps and where, what it sends and to whom, and what it does not protect against. To report a problem, see the end of this page; please don’t open a public issue.
In short
Section titled “In short”- What it is for: stopping a tool from using the wrong project’s account by accident. It is not a sandbox and not a secrets vault, and it does not protect you from code that already runs as you.
- No secret values in Keyfit’s files. Keys you paste into Keyfit go into the macOS Keychain.
- A key or token leaves your Mac only for its own service, over HTTPS, when Keyfit asks that service whose it is.
- One refresh token, for one question. The only refresh token Keyfit uses is that of a Gmail, Drive or Calendar MCP server the project claims, once the token saved in the server’s login has expired: it goes, with the server’s own OAuth client, to Google’s token endpoint, and the fresh token Google returns answers whose login it is, once, and is dropped. Nothing is written to the login. Without it, Gmail AutoAuth’s account, which its login doesn’t name, could be confirmed only in the hour after its sign-in, and a wrong account would pass after that.
- No telemetry, no update checks, no log files, no writes into your repositories.
- Keyfit’s output never shows a key or token.
What Keyfit can see
Section titled “What Keyfit can see”Keyfit runs as you, so it could read anything you can. This is what it actually reads:
| What | Why |
|---|---|
~/.config/keyfit/registry.toml and cache/checks.json |
your projects, and recent successful checks |
| The environment of the shell that starts the tool | to clean it up; an env:NAME reference reads the key from $NAME |
Keychain items named by keychain:service/account references |
the key, read with /usr/bin/security find-generic-password -w only when a launch or check needs it |
~/.aws/config, ~/.aws/credentials, ~/.aws/sso/cache, ~/.aws/login/cache |
the profile’s type and account hints, whether it has a static key, sign-in expiry times. Keyfit never uses or sends the AWS tokens in these files |
gh’s token for the mapped account (gh auth token --user LOGIN), for the GitHub account and the Copilot CLI account |
to hand it to the tool as GH_TOKEN (as COPILOT_GITHUB_TOKEN for Copilot CLI) and ask GitHub whose it is |
The Vercel login folder’s auth.json and config.json |
the token, to ask Vercel whose it is, and the selected team |
The supabase CLI’s login, on keyfit add supabase --cli and on a yes in keyfit init only |
whether it is signed in, from the attributes of the Keychain items Supabase CLI/supabase and Supabase CLI/access-token (no secret is read for that), or from ~/.supabase/access-token (or $SUPABASE_HOME/access-token); then, to copy it, the token. Newer CLIs store it through a native module, so macOS may ask you once to let security read it. It is never read at a launch |
wrangler’s config folder (~/.wrangler when it exists, else $XDG_CONFIG_HOME/.wrangler when that is set, else ~/Library/Preferences/.wrangler) |
the names of the files in config/ (which profiles exist; the files themselves, wrangler’s sign-ins, are never opened, only their modification time and size for the cache), and profiles/directory-bindings.json (which folder is bound to which profile) |
~/.convex/config.json, the convex CLI’s login, for an account that is that login (at every launch of claude, codex, opencode, copilot, gemini or convex in its project), on keyfit add convex --cli or --copy, and to see whether it is signed in during keyfit init |
the token, to hand it to the session and ask Convex which teams it sees. A plain file the CLI writes; reading it asks nothing |
gcloud’s folder (~/.config/gcloud, or $CLOUDSDK_CONFIG): configurations/config_NAME, active_config, and credentials.db read-only with SQLite |
the account, project and [auth] settings of the project’s configuration (also of the others, on keyfit add gcloud and keyfit init); which configuration is active (for a gcloud config set outside a mapped project); which accounts gcloud holds a sign-in for (SELECT account_id FROM credentials). The column holding the credential is never read; only the modification time and size of credentials.db go into the cache |
The firebase CLI’s configstore (~/.config/configstore/firebase-tools.json, or under $XDG_CONFIG_HOME), where it keeps its sign-ins, folder bindings (activeAccounts) and firebase use picks (activeProjects) |
which accounts the CLI is signed in to, which one each folder is bound to and which project it picks there. For the online check, the access token the CLI keeps for the project’s Google account (sent only to Google, below); the refresh token next to it is never used or sent. Only the subject and sign-in time of the account’s Google ID token go into the cache |
OpenCode’s database of the project’s account (~/.local/share/opencode/opencode.db, or the account’s opencode.db), read-only with SQLite |
the provider, label and ID of each sign-in (SELECT id, integration_id, label, active FROM credential). The column holding the credential is never read |
OpenCode’s opencode.json and opencode.jsonc in ~/.config/opencode (or $OPENCODE_CONFIG_DIR), the file $OPENCODE_CONFIG names, and $OPENCODE_CONFIG_CONTENT |
MCP server names and the variable each one reads, to hide other projects’ servers |
Gemini CLI’s folder of the project’s account (~/.gemini, or .gemini in the account’s GEMINI_CLI_HOME): oauth_creds.json, google_accounts.json, settings.json, .env and each extension’s gemini-extension.json, and the .env beside that .gemini folder (~/.env); also the system’s settings (/Library/Application Support/GeminiCli/settings.json and system-defaults.json, or the files $GEMINI_CLI_SYSTEM_SETTINGS_PATH and $GEMINI_CLI_SYSTEM_DEFAULTS_PATH name) |
from the sign-in, the email Google wrote into its id_token (else the account Gemini CLI noted in google_accounts.json), the credential type and the token’s expiry; the access token itself only for the online check, while it is valid. From the settings, the sign-in method (security.auth.selectedType), advanced.excludedEnvVars and MCP server names, the variable each one reads and mcp.allowed/mcp.excluded. From a .env, only the names it sets (a value is never kept or shown). The refresh token is never used or sent |
The login of each Google Workspace MCP server the project claims: a folder of <email>.json files (Google Workspace MCP), or one JSON file (Gmail AutoAuth’s credentials.json, the Calendar and Drive servers’ tokens.json, or the file you named with --login). Once a saved token has expired, also the server’s OAuth client file, where the server reads it: Gmail AutoAuth’s GMAIL_OAUTH_PATH, else ~/.gmail-mcp/gcp-oauth.keys.json; Google Calendar MCP’s GOOGLE_OAUTH_CREDENTIALS; Google Drive MCP’s GOOGLE_DRIVE_OAUTH_CREDENTIALS, else gcp-oauth.keys.json in its config folder (Google Workspace MCP’s login holds its own client, and so may a --login file). The variable counts only in your own configs and your shell, never in one the folder brings, and only a regular file of at most 64 KB is read. While Google Drive MCP is not signed in yet, whether the folder holds google-tokens.json or .gcp-saved-tokens.json (never their content) |
the email each sign-in names (the file’s name, cached_email, email or an id_token’s email claim) and its token’s expiry; the access token itself only for the online check, while it is valid. Once it has expired, the sign-in’s refresh token and the server’s OAuth client ID and secret, only for the renewal below. This is the one place Keyfit uses a refresh token, so that Google can name the account of a login that names none (Gmail AutoAuth). Also on keyfit add google-mcp and keyfit init for the servers they offer |
Copilot CLI’s mcp-config.json in ~/.copilot (or $COPILOT_HOME, or the folder copilot --config-dir names), and the JSON or file copilot --additional-mcp-config names |
MCP server names and the variable each one reads, to hide other projects’ servers. Copilot’s login and settings are never read |
~/.claude.json (or the account’s), Claude’s settings.json, the files claude --settings and --mcp-config name, ~/.codex/auth.json, ~/.codex/config.toml (or the account’s) and the profile file codex --profile NAME reads next to it (NAME.config.toml) |
MCP server lists (in ~/.claude.json also the local scope of the folder, its repository’s top and a worktree’s main checkout; in Codex’s files also which folders Codex trusts, [projects]), organization and account IDs, the login type, whether you set your own status line. For a Linear server, every variable it names and whether a Linear key is written into it, compared in memory with the project’s key and never kept or shown. For a Google Workspace server, also the command it runs, the login path, HOME, XDG_CONFIG_HOME and USER_GOOGLE_EMAIL its env sets, and which of the variables that would sign it in with a service account or a token of its own it sets (never their values; in every agent’s configuration Keyfit reads). Codex tokens are never used or sent |
In the project folder: .mcp.json, opencode.json and .opencode/opencode.json (also in the folders above it), .codex/config.toml (for Codex, in the folders from the repository’s top down to it, only when Codex trusts them), a worktree’s .git file and the entry its repository keeps for it (to find the main checkout), .github/mcp.json (for Copilot CLI, with .mcp.json, also in the folders above it up to the repository’s top), .gemini/settings.json (for Gemini CLI, in the folder only), .vercel/project.json and repo.json (or the older .now/project.json; also of a folder named with vercel --cwd, deploy or dev), supabase/.temp/project-ref, .temp/linked-project.json and supabase/.link.json (in the nearest folder upwards with supabase/config.toml), the wrangler.json, wrangler.jsonc or wrangler.toml wrangler would read, the package.json of the wrangler npx would run, the CONVEX_* variables of .env.local and .env (and of a file named with convex --env-file), parsed as the convex CLI’s dotenv parses them, whether there is a firebase.json (in the folder or above) and the .firebaserc next to it, the names set in the folder’s .env, .env.local and .env.* (and in a wrangler --cwd folder’s, or a file named with wrangler --env-file) in a project with a Cloudflare account, the names set in the .env Gemini CLI would load (the nearest .gemini/.env or .env from the folder up) in a project with a Gemini CLI account, the git config |
server names to hide, the Vercel team and Supabase project the folder is linked to, the Cloudflare account_id, wrangler’s version, the Convex deployment the folder points at, the Firebase folder and its project aliases, whether a .env file sets CLOUDFLARE_API_BASE_URL or one of wrangler’s sign-in endpoints, or a variable Keyfit removes for Gemini CLI (only the names are compared; a value is never kept or shown), the author email and origin host. Other lines of .env.local are read with the file but never kept or used |
.envrc of the repository, on keyfit init only |
use aws and export LINEAR_API_KEY=$VAR lines. It is read as text and never run |
PATH |
to find the real tool behind each shim |
Programs Keyfit runs, all read-only: git rev-parse, git config user.email and git remote get-url origin (and git --version for keyfit doctor); aws sts get-caller-identity; claude auth status --json; opencode auth list --standalone --format json (in an empty temporary folder that is also its configuration folder, with the project’s configuration, the model list and the update check off, so no MCP server or plugin starts; it opens the account’s database, as OpenCode does at a start); gh auth token and gh auth status; vercel whoami (only to let the CLI renew an expired token); wrangler whoami --json (wrangler renews an expired sign-in first, as every wrangler command does; it runs with your shell’s environment and the project’s Cloudflare account only, never the project’s other tokens, so a repository’s own node_modules/.bin/wrangler sees nothing your shell doesn’t give it); wrangler auth token --json --profile NAME on keyfit add cloudflare only, to list the accounts the profile reaches; gcloud auth print-access-token with the project’s configuration (gcloud renews an expired token first, as every gcloud command does; the token goes from its output to the two requests below and nowhere else); firebase --account EMAIL projects:list --json --non-interactive, only when the access token the firebase CLI keeps for the project’s account has expired (the CLI renews it first, as every firebase command does; it runs in an empty temporary folder, so a firebase-debug.log never lands in the project); /usr/bin/security. Apart from security, wrangler and firebase, each is the first one found on PATH (skipping Keyfit’s shims and Superset’s wrappers), and runs in the current folder, as the tool itself will. wrangler is the one npx wrangler would run there: the nearest node_modules/.bin/wrangler up to the repository’s top or your home folder (outside both, up to the nearest package.json), else the one on PATH; firebase likewise. So a registered project’s own wrangler runs at its check, as it would at its next deploy.
What Keyfit stores, and where
Section titled “What Keyfit stores, and where”Everything lives under ~/.config/keyfit (or $KEYFIT_CONFIG_DIR), apart from Keychain items and one optional line in a shell startup file.
| Path | Mode | Contents |
|---|---|---|
registry.toml |
600 | Projects, their folders and account labels: AWS profile names and 12-digit account IDs, Linear workspace slugs, where each key lives (env:NAME or keychain:service/account), GitHub logins, Vercel users and teams, Supabase organization slugs and names, wrangler profile names and Cloudflare account IDs and names, Google account emails, gcloud configuration names, Google Cloud project IDs (and gcloud’s folder when CLOUDSDK_CONFIG moved it), Firebase project IDs, the Gemini CLI folder of each Gemini account (and the Google Cloud project it gets, when you gave one), Convex team slugs and names (and token = "cli" for an account that is the convex CLI’s own login), Claude organizations, Codex plans (plus the email or account ID when you pin one), the GitHub login Copilot CLI runs as, the path of each OpenCode database and the providers signed in there, the names, types and login paths of Google Workspace MCP servers, MCP server name patterns, and the names of Keychain items Keyfit stored. Never a key, token or password |
cache/ and cache/checks.json |
700, 600 | Successful online checks: time, status and a short label such as account confirmed, under a SHA-256 of the project, the connection and a login fingerprint. For Linear and Vercel the fingerprint is the first 16 hex characters of a SHA-256 of the key or token; for GitHub (also Copilot CLI’s), of the token, plus the modification time of gh’s hosts.yml (never its content); for AWS, the modification time of the SSO or console sign-in’s cache file (other profiles have none); for Claude, the organization ID in the login’s .claude.json; for Supabase, of the token and the linked project; for Cloudflare, of the modification time and size of the profile’s sign-in file (never its content); for Google Cloud, of the modification time and size of gcloud’s credentials.db and of the configuration’s file; for Firebase, of the subject and sign-in time in the Google ID token the firebase CLI keeps for the account (no token); for Convex, of the token and the deployment the folder points at; for Gemini CLI, of the modification time and size of the folder’s oauth_creds.json, google_accounts.json and settings.json (and, for a key account, of the key); for Google Workspace MCP servers, of the name, modification time and size of each server’s login file (each .json in a Google Workspace MCP folder); for OpenCode, of the IDs, providers and labels of the database’s sign-ins and the names (never the values) of variables containing KEY or TOKEN; an OpenCode check also keeps the names of the shell variables it found, which the shim removes. Supabase projects named on a command line (--project-ref) and Convex deployments (--deployment-name) confirmed to belong to the project’s organization or team are kept the same way |
bin/ (the shims), shell.zsh, shell.sh |
755, 644 | Short sh scripts that run Keyfit’s Python (or, when it is gone, say so) and the PATH snippets. Paths in them are quoted so that no folder name runs as a command. Nothing secret |
claude/NAME/ |
700 | Only after keyfit add claude --new: a config folder for another Claude login, where Claude keeps that login’s history and transcripts, and its background supervisor its daemon.lock. Keyfit links your settings.json, keybindings.json, CLAUDE.md, skills, commands, agents and plugins from ~/.claude into it. Its .claude.json (600) marks the project’s folders as trusted only where your default Claude login already trusts them, so a new login never trusts more than the old one |
vercel/NAME/ |
700 | Only after keyfit add vercel --new: the Vercel CLI keeps that login’s auth.json here |
gemini/NAME/ |
700 | Only after keyfit add gemini --new or --key: Gemini CLI’s folder for that account (.gemini/ in it), where Gemini CLI keeps the Google sign-in and the sessions. Keyfit links your GEMINI.md, commands, skills, agents, policies and extensions from ~/.gemini into it, and for a key account writes settings.json (600) choosing the API-key method; nothing else |
opencode/NAME/ |
700 | Only after keyfit add opencode --new: OpenCode keeps that account’s database here, with its sign-ins and sessions |
macOS Keychain, service keyfit |
Keychain | Keys you pasted into keyfit add linear (linear-WORKSPACE), keyfit add supabase (supabase-NAME, also the copy --cli makes of the supabase CLI’s token), keyfit add convex (convex-NAME, also the copy --copy makes of the convex CLI’s token), keyfit add gemini --key (gemini-NAME) or keyfit secret set NAME. They are written through the stdin of security -i, never through its arguments |
| Your shell startup file | One line that loads shell.zsh or shell.sh, only with keyfit setup --rc |
NAME is letters, digits, ., _ and - (keyfit add refuses any other --name), so these folders always stay inside ~/.config/keyfit. ~/.config/keyfit itself gets your usual permissions (usually 755). The registry, the cache and Claude’s .claude.json are owner-only from the first byte. keyfit setup --remove --purge deletes the folder but never Keychain items; it lists their names so you can delete them in Keychain Access.
What Keyfit sends, and to whom
Section titled “What Keyfit sends, and to whom”Nothing in folders that aren’t registered. In a project, Keyfit only asks each service who you are:
| To | What | When |
|---|---|---|
api.linear.app (POST /graphql) |
the project’s Linear key and the query { organization { urlKey name } } |
a Linear check without a fresh cached success, keyfit status, keyfit add linear, keyfit init importing a key from .envrc. Only a value shaped like a Linear key is ever sent |
api.github.com/user |
gh’s token for the account | a GitHub or Copilot CLI check without a fresh cached success, keyfit status, keyfit add github, keyfit add copilot. A classic personal access token is never sent for Copilot CLI: it fails before |
api.vercel.com (/v2/user, /v2/teams/…) |
the login’s token from auth.json |
a Vercel check without a fresh cached success, keyfit status, keyfit add vercel, guided keyfit init |
api.supabase.com (GET /v1/organizations, GET /v1/projects/REF) |
the project’s Supabase token | a Supabase check without a fresh cached success (/v1/projects/REF only when the folder is linked), keyfit status, keyfit add supabase; /v1/projects/REF also when a supabase command names another project (--project-ref, link REF, …): any word of the command shaped like a project ref (20 lowercase letters) is asked about. Only a value shaped like a Supabase token is ever sent. Never a call that returns keys or database passwords |
AWS STS, through the real aws |
whatever aws sts get-caller-identity --profile P sends, always to AWS’s own STS: aws runs without AWS_ENDPOINT_URL… and with AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true, so neither a variable nor a profile’s endpoint_url sends it elsewhere |
an AWS check without a fresh cached success, keyfit status, keyfit add aws when the profile doesn’t name its account |
api.cloudflare.com (GET /client/v4/accounts) |
the token of the wrangler profile you pick | keyfit add cloudflare only, to list the accounts the profile reaches. The token comes from wrangler auth token and is held in memory for that one request |
Cloudflare, through the real wrangler |
whatever wrangler whoami sends (and, when the sign-in has expired, wrangler’s own renewal), always to Cloudflare’s own API and sign-in: wrangler runs with CLOUDFLARE_API_BASE_URL set to https://api.cloudflare.com/client/v4 and without inherited WRANGLER_AUTH_DOMAIN, WRANGLER_AUTH_URL, WRANGLER_TOKEN_URL, WRANGLER_REVOKE_URL and WRANGLER_CLIENT_ID, and a folder whose .env, .env.local or .env.<env> sets any of them, or XDG_CONFIG_HOME (where wrangler would keep its profiles), fails the check before wrangler starts (wrangler would load them into its environment) |
a Cloudflare check without a fresh cached success, keyfit status |
api.convex.dev (GET /api/teams, GET /api/deployment/NAME/team_and_project) |
the project’s Convex token | a Convex check without a fresh cached success (the deployment only when the folder points at a cloud deployment), keyfit status, keyfit add convex; the deployment also when a convex command names another one (--deployment-name, --env-file, …). These are the calls npx convex login status and the CLI’s deployment lookup make. A deploy key is never sent, and a value shaped like one is never sent as a token. Only a deployment name (like happy-animal-123) goes into the lookup’s address, so a deploy key put in CONVEX_DEPLOYMENT or --deployment-name is neither sent nor printed |
oauth2.googleapis.com/tokeninfo (POST, the token in the body) and cloudresourcemanager.googleapis.com (GET /v1/projects/ID) |
the token gcloud auth print-access-token prints for the project’s configuration |
a Google Cloud check without a fresh cached success, keyfit status, keyfit add gcloud. tokeninfo says whose the token is; the project lookup needs any role on the project. The token is held in memory for these two requests only |
oauth2.googleapis.com/tokeninfo (POST, the token in the body) |
the access token of the Gemini CLI sign-in in the project’s folder, only while it is still valid | a Gemini CLI check without a fresh cached success, keyfit status. An expired token is not renewed and nothing is sent (the local check decides) |
oauth2.googleapis.com/token (POST, everything in the body; the address is fixed, and a token_uri in a file is never followed) |
a claimed Google Workspace server’s refresh token and its OAuth client ID and secret, only once the access token saved in its login has expired: the request the server itself makes to renew it | a Google Workspace MCP check without a fresh cached success, keyfit status, keyfit add google-mcp. Google answers with a fresh access token, used once, in memory, for the request below, then dropped. Nothing is written to the login, and the refresh token, client secret and fresh token are never shown, logged or cached. A signed-out or revoked sign-in fails, with the server’s own sign-in as the fix |
oauth2.googleapis.com/tokeninfo (POST, the token in the body), gmail.googleapis.com (GET /gmail/v1/users/me/profile) or www.googleapis.com (GET /calendar/v3/calendars/primary), the token in the Authorization header |
the access token saved in a claimed Google Workspace server’s login while it is still valid, else the fresh one from the row above: tokeninfo for Google Workspace MCP, Google Drive MCP and other servers, Gmail’s profile for Gmail AutoAuth, the primary calendar for Google Calendar MCP (their tokens can’t ask tokeninfo for the email) | a Google Workspace MCP check without a fresh cached success, keyfit status, keyfit add google-mcp. Each answer names the account; nothing else is read. Without a refresh token, or an OAuth client to renew it with, an expired token is not sent at all (the local check decides) |
generativelanguage.googleapis.com (GET /v1beta/models?pageSize=1, the key in the x-goog-api-key header) |
the project’s Gemini API key | a check of a Gemini CLI key account without a fresh cached success, keyfit status, keyfit add gemini --key (before the key is stored). Only a value shaped like a Google API key (AIza…) is ever sent. It lists one model; nothing is generated |
Google, through the real gcloud |
whatever gcloud auth print-access-token sends to renew an expired token |
the same, when the access token gcloud keeps has expired |
oauth2.googleapis.com/tokeninfo (POST, the token in the body) and firebase.googleapis.com (GET /v1beta1/projects/ID) |
the access token the firebase CLI keeps for the project’s Google account | a Firebase check without a fresh cached success, keyfit status, keyfit add firebase. tokeninfo says whose the token is; the project lookup needs access to the Firebase project. When the CLI could not renew an expired token, tokeninfo also gets the expired one, only to tell an offline Mac from a revoked sign-in. The token is held in memory for these requests only |
Google, through the real firebase |
whatever firebase projects:list sends to renew an expired token and list the account’s projects |
the same, when the access token the CLI keeps has expired |
Anthropic, through the real claude |
whatever claude auth status sends |
a Claude check without a fresh cached success, keyfit status, keyfit add claude |
Nothing, through the real opencode |
opencode auth list asks no provider. Keyfit turns off its model list, update check and configuration, and it then needs no network (verified with OpenCode 2.0.25 and every outbound connection but localhost blocked) |
an OpenCode check without a fresh cached success, keyfit status |
Vercel, through the real vercel |
whatever vercel whoami sends to renew its token |
only when the stored Vercel token has expired |
PyPI or npm, through uv, pipx or npm |
whatever uv tool install claude-swap (or pipx install claude-swap) and npm install -g codex-multi-auth send to download them |
the first keyfit setup in a terminal, only for the one you answer yes to. Keyfit doesn’t vet these tools; once you add your logins to them, they keep copies of your Claude or ChatGPT logins |
Keyfit’s own requests use HTTPS with certificate and hostname checks (Python’s default; when Python has no CA certificates of its own, Keyfit uses the bundle macOS keeps at /etc/ssl/cert.pem). They never follow a redirect, because a redirect would carry the key to another address. Each has a 15 s timeout. Like other tools, they honor HTTPS_PROXY and SSL_CERT_FILE from your environment. Codex is checked offline, from auth.json, and OpenCode from its own database and opencode auth list.
The verification cache
Section titled “The verification cache”A successful online check is reused for 30 minutes. If a service can’t be reached (a connection error, a DNS failure or a timeout; for Vercel, Supabase, Convex, Gemini CLI, Google Cloud, Firebase and Google Workspace MCP servers also a rate limit or server error, which Linear and GitHub count as a failure), Keyfit retries once. If that also fails, it accepts a success from the last 24 hours for the same login and shows it as a warning, for every tool. A rejected key, an expired sign-in or a wrong account always fails, and removes the cached success: the next start checks online again. Only successes are cached (with the names of the shell keys OpenCode reported); a warning is checked again at every start. AWS profiles that aren’t SSO or console sign-ins (credential_process, static keys, roles) have no login fingerprint: a credential swapped behind the same profile name is noticed when the 30 minutes run out, or at once with keyfit status.
What Keyfit never does
Section titled “What Keyfit never does”- Print a key or token. Output names the variable or the Keychain item, and shows AWS account IDs as their last four digits (also in the errors it passes on from AWS).
KEYFIT_DRY_RUN=1lists the names of changed variables only. An internal error shows the exception’s type and place, not its message, since messages can quote the file that was read. A key typed where a name or reference belongs (--key lin_api_…,--profile,--login,--email,--workspace, or an argument the command doesn’t take) is refused without being repeated, and one written into the registry by hand is named, not shown. - Put a secret on a command line, where
pswould show it to every process. - Send a secret anywhere but its own service (the table above).
- Collect telemetry or keep logs. No analytics, update checks or crash reports.
- Write into your repositories, or change another tool’s logins or configuration. It never runs
gh auth login,gh auth switchorcopilot login. It runsaws login,aws sso login,claude auth login,codex login,opencode auth login --standalone,gemini --prompt-interactive /quit(Gemini CLI’s own sign-in dialog in the project’s Gemini CLI folder; it quits once you are signed in),vercel login,wrangler auth create NAME,wrangler login,npx convex login --force,gcloud auth login EMAIL,firebase login,firebase login:addorfirebase login --reauthonly when you answer yes toSign in now?, which it asks only when you start a tool yourself in a terminal (outside a session Keyfit started) and every failed check is fixed by such a sign-in; the sign-in then talks to you directly, and the checks run again before the tool starts. Otherwise it prints them as the fix. The other exceptions arevercel whoami,wrangler whoamiandfirebase projects:list, which renew an expired token, as anyvercel,wranglerorfirebasecommand would,firebase login:use EMAIL, which binds the folder you are in to the project’s Google account when you answer yes toBind this folder now?(it changes only the firebase CLI’s list of bound folders), andwrangler auth activate NAME DIR, which binds a folder to a wrangler profile (it changes only wrangler’s list of bound folders, no sign-in).keyfit add cloudflareruns it only when you answer yes toRun it now?, and a shim only when you answer yes toBind this folder now?, which it asks only when you start a tool yourself in a terminal, every failed check is fixed by a sign-in or by that binding, NAME is the project’s own profile and DIR is a folder of the project (never another project’s, never your home folder or a folder above it; in a Superset worktree, the folder that holds the repository’s worktrees when nothing in it belongs to another project). - Start a tool after a failed check, a mistake in the registry (
registry.toml has a mistake), an error inside Keyfit, a git that can’t answer inside a repository, or from a shim whose Keyfit installation is gone. The exceptions areKEYFIT_DISABLE=1, sign-in commands (they run with the project’s environment but without checks), folders that aren’t registered, the AWS profiles under[settings] shared_aws_profiles, and a network failure within 24 hours of a success, shown as a warning.
Where secrets end up
Section titled “Where secrets end up”claude and codex start with the project’s Linear key (as LINEAR_API_KEY, and in the project’s own env: variable), gh’s token for the project’s GitHub account (as GH_TOKEN; that is gh’s own login token, with all of its scopes), the project’s Supabase token (as SUPABASE_ACCESS_TOKEN, with SUPABASE_PROFILE=supabase, so a profile file in a folder cannot send it to another API host) and the project’s Convex token (as CONVEX_OVERRIDE_ACCESS_TOKEN, without CONVEX_PROVISION_HOST, which would send it to another API host). Inside a session Keyfit started, a gh call keeps the session’s GH_TOKEN instead of asking gh again only when the project’s check confirmed exactly that token in the last 30 minutes and gh’s sign-ins (the time of hosts.yml, never its content) haven’t changed since. claude and codex also get the project’s Cloudflare account as CLOUDFLARE_ACCOUNT_ID (an ID, not a secret), and lose inherited CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY and CLOUDFLARE_EMAIL (and their CF_ names), which would beat wrangler’s sign-in for the folder. They get CLOUDFLARE_API_BASE_URL set to Cloudflare’s own API, which beats a folder’s .env, and lose inherited WRANGLER_AUTH_DOMAIN, WRANGLER_AUTH_URL, WRANGLER_TOKEN_URL, WRANGLER_REVOKE_URL and WRANGLER_CLIENT_ID, which would send the profile’s sign-in elsewhere. opencode, copilot and gemini get the same as claude and codex. In a project with a Copilot CLI account, all five also get gh’s token for that account as COPILOT_GITHUB_TOKEN (Copilot CLI takes it before GH_TOKEN, GITHUB_TOKEN, its own login and gh’s; inside a session Keyfit started it is kept on the same terms as GH_TOKEN), and lose inherited COPILOT_GITHUB_TOKEN, the Copilot coding agent’s GITHUB_COPILOT_…_TOKEN variables, COPILOT_GH_HOST and GH_HOST (another GitHub host) and the COPILOT_PROVIDER_… variables (a model provider and its key instead of the GitHub account), which only Copilot reads; COPILOT_PROVIDERS_CONFIG is set to a file that never exists (/var/empty/providers.json), so no providers.json (yours is in ~/.copilot) names a provider either. In a project with an OpenCode account, all five also get OPENCODE_DB (the account’s database), and opencode starts without inherited ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, GOOGLE_API_KEY, GITHUB_TOKEN and OPENCODE_API_KEY, which OpenCode would take as sign-ins next to the database’s, and without every other key or token OpenCode’s own report (opencode auth list, run by the check) named as coming from your shell: OPENROUTER_API_KEY, GROQ_API_KEY, AWS_BEARER_TOKEN_BEDROCK, CLOUDFLARE_API_TOKEN, GITLAB_TOKEN and whatever other provider OpenCode knows. Otherwise OpenCode would offer those providers in the project’s sessions, billed to your own keys. Only names containing KEY or TOKEN count, so the CLOUDFLARE_ACCOUNT_ID Keyfit sets for the project’s Cloudflare account stays; the commands OpenCode runs lose the removed keys too. The check names them in a warning (“from your shell, not the project’s account”); their names are kept with the cached check, so a start within the next 30 minutes removes the same ones, and a new key-like variable makes the next start check again. claude, codex and copilot keep them all; gemini keeps them too, apart from the Google keys its own account removes (GEMINI_API_KEY, GOOGLE_API_KEY). In a project with an AWS account, every tool loses AWS_BEARER_TOKEN_BEDROCK (and any AWS_BEARER_TOKEN_…), which the AWS CLI takes before the profile. OpenCode’s report does not list the AWS settings Amazon Bedrock also starts from (AWS_PROFILE, AWS_ACCESS_KEY_ID): in a project with an AWS account they are the project’s, in one without they stay as in your shell. An OpenCode session runs on a private server (--standalone), so the commands it runs have this environment and no other start’s. OpenCode’s shared background server is never started with a project’s environment: its own commands (mcp, serve, service and the like) run with yours, unchanged, from your terminal, and inside a session Keyfit started (where the environment holds a project’s accounts) they get --standalone where they take it and are refused otherwise; so is an opencode in a folder outside every project, started from such a session. In a project with a Gemini CLI account, all five get GEMINI_CLI_HOME (the account’s Gemini CLI folder; none for your own ~/.gemini) and, for a key account, the key as GEMINI_API_KEY; gemini itself starts without inherited GEMINI_API_KEY (unless it is the account’s), GOOGLE_API_KEY, GOOGLE_CLOUD_PROJECT (set to the account’s, when it has one), GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA, GOOGLE_GEMINI_BASE_URL, CODE_ASSIST_ENDPOINT, GEMINI_FORCE_ENCRYPTED_FILE_STORAGE and the other variables that would make it use another key, sign-in method, endpoint or credential store (the other agents’ sessions keep them). Gemini CLI loads a .env file for every variable that isn’t set, so one it would load that sets any of them fails the check. Only the project’s own .env setting its app’s key, credentials, Google Cloud project or location, or GOOGLE_GENAI_USE_VERTEXAI/GOOGLE_GENAI_USE_GCA, gets a warning instead; an endpoint, GEMINI_CLI_HOME or the credential store fails there too. In a project with a Google Cloud account, all five and gcloud get the project’s gcloud configuration as CLOUDSDK_ACTIVE_CONFIG_NAME, CLOUDSDK_CORE_ACCOUNT and CLOUDSDK_CORE_PROJECT (names, not secrets; gcloud keeps the sign-in), and lose inherited CLOUDSDK_… variables that pick another configuration, account, project, credentials or endpoint (CLOUDSDK_CONFIG, CLOUDSDK_AUTH_ACCESS_TOKEN_FILE, CLOUDSDK_API_ENDPOINT_OVERRIDES_… and the like; gcloud’s Python, proxy and prompt settings stay) and GOOGLE_APPLICATION_CREDENTIALS, a credentials file the client libraries take before any login. In a project with a Firebase account, all five and firebase lose inherited FIREBASE_TOKEN and GOOGLE_APPLICATION_CREDENTIALS, which would act instead of the firebase CLI’s sign-in, and FIREBASE_…_URL, FIREBASE_CLIENT_ID and FIREBASE_CLIENT_SECRET, which would send the sign-in’s refresh token or its requests elsewhere than to Google; nothing is set, as the folder’s binding picks the sign-in. In a project with Google Workspace MCP servers, all five lose inherited GMAIL_CREDENTIALS_PATH, WORKSPACE_MCP_CREDENTIALS_DIR, GOOGLE_MCP_CREDENTIALS_DIR, GOOGLE_CALENDAR_MCP_TOKEN_PATH, GOOGLE_DRIVE_MCP_TOKEN_PATH and USER_GOOGLE_EMAIL (paths and an email, not secrets), so each server reads the login its own definition names, the one Keyfit checked; nothing is set, and the servers read their tokens themselves. aws, gh, vercel, supabase, wrangler, convex, gcloud and firebase get only their own account. Every vercel request carries the login’s token, so with a project’s Vercel login vercel --api URL is refused unless URL is Vercel’s own API. Everything the tool starts inherits its environment: MCP servers, hooks, the commands an agent runs, and the install scripts of the packages it installs. Keyfit removes other projects’ variables only for the kinds of account the project maps, with seven exceptions: a Supabase or Convex token Keyfit gave another project’s session (marked by KEYFIT_SUPABASE or KEYFIT_CONVEX) is removed in a project without such an account, and so are the CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_BASE_URL Keyfit set (marked by KEYFIT_CLOUDFLARE) in a project without a Cloudflare account, the OPENCODE_DB it set (marked by KEYFIT_OPENCODE) in a project without an OpenCode account, the COPILOT_GITHUB_TOKEN it set (marked by KEYFIT_COPILOT_LOGIN) in a project without a Copilot CLI account, the gcloud configuration, account and project it set (marked by KEYFIT_GCLOUD) in a project without a Google Cloud account, and the GEMINI_CLI_HOME and GEMINI_API_KEY it set (marked by KEYFIT_GEMINI and KEYFIT_GEMINI_KEY) in a project without a Gemini CLI account. In a project with a Convex account, inherited CONVEX_DEPLOYMENT, CONVEX_DEPLOY_KEY and CONVEX_DEPLOYMENT_TOKEN that the folder’s own .env.local or .env disagree with are removed too: they would outrank the folder’s files. In a registered project, every tool also gets KEYFIT_PROJECT (the project’s name, which keeps the commands of an agent’s session on its project), KEYFIT_SUMMARY (the project and its accounts’ labels, for Claude’s status line) and, next to what each account sets, the markers above and KEYFIT_GITHUB_LOGIN and KEYFIT_LINEAR_WORKSPACE (an account’s name, login or workspace, or 1; never a key or token); opencode, when Keyfit switches servers off in OPENCODE_CONFIG_CONTENT, also gets KEYFIT_OPENCODE_CONFIG, a copy of your own OPENCODE_CONFIG_CONTENT, so a session started inside it starts from yours. In folders that aren’t registered, the tool gets your environment unchanged, apart from KEYFIT_SHIM_DEPTH, a counter that stops shims from calling each other in a loop.
What Keyfit does not protect against
Section titled “What Keyfit does not protect against”- Code that already runs as you. It can read the same files and environment, call the real binaries by full path, set
KEYFIT_DISABLE=1, edit the registry or remove the shims. It can also read the Keychain items Keyfit stored, without a prompt, through/usr/bin/security; that is how Keyfit reads them without asking at every launch. The Keychain protects them at rest and from other users, not from your own processes. - An agent that goes around the thirteen commands: one that reads
~/.aws,~/.config/gcloud, the firebase CLI’s configstore, gh’s or Vercel’s stored logins or the Keychain directly, or runs a tool by its full path. Keyfit only decides whatclaude,codex,opencode,copilot,gemini,aws,gh,vercel,supabase,wrangler,convex,gcloudandfirebaseget when they are started through PATH. Other programs (vc,npx supabase,npx wrangler,npx convex,npx firebase-tools,npx @github/copilot,npx @google/gemini-cli,bq,gsutil, terraform, npm, IDE extensions, desktop apps) don’t go through Keyfit; inside a Claude, Codex, OpenCode, Copilot CLI or Gemini CLI session,npx supabase,npx convexandnpx @github/copilotdo get the project’s token,npx @google/gemini-clithe project’s Gemini CLI folder (but not the cleaned-up variables or the MCP allowlist) andnpx wranglerthe project’s account, but none of the shim’s refusals (--project-refof another organization,--deployment-nameof another team,--profile,--admin-key). An agent thatcds into another Convex folder and runsnpx convexthere still acts with its own project’s token, on the deployment that folder’s.env.localnames. wrangler itself also loadsCLOUDFLARE_API_TOKENfrom the folder’s.env, which beats the profile; the pinned account still holds. A.envthat sets wrangler’s sign-in endpoints is checked only where a tool starts (and in awrangler --cwdfolder or--env-file): an agent’snpx wranglerin another folder with such a file uses them, with the API host still pinned.bqandgsutilin a session use the project’s gcloud configuration through its variables, without the shim’s refusals.npx firebase-toolsuses the sign-in its folder is bound to: checked where the session started, not in another Firebase folder the agent moves to, and outside every Firebase folder the CLI’s default login. - What a tool does with the right account. An agent with the project’s AWS profile can do whatever that profile allows. Give each project’s profile only the permissions it needs.
- Configuration a repository brings with it, once you trust it. After you trust a folder in Claude, its
.claude/settings.jsonapplies to the agent’s commands, and itsenvcan setKEYFIT_DISABLE,KEYFIT_PROJECTorAWS_PROFILE. An.envrcyoudirenv allowcan do the same. Keyfit can’t tell those from your own settings. A project.mcp.jsonserver you approve gets the session’s environment, or any variable it names, such as${LINEAR_API_KEY}or${GH_TOKEN}.keyfit initimports the repository’s.envrclines, so register only repositories you trust and read theimported …lines it prints. KEYFIT_DISABLE=1beyond the one command. It is inherited: an agent started with it runs its ownaws,gh,vercel,supabase,wrangler,convex,gcloudandfirebasewithout Keyfit too.- A background supervisor or server that already runs. Claude Code’s background-session supervisor and Codex’s shared server keep the environment of the start that launched them and give it to every session they run, in any folder. Keyfit keeps a project’s environment out of them: Claude sessions in a project start with background sessions off, Codex sessions without the shared server, and the commands that start or use them are refused in a project and inside a session. The exception is a project whose Claude login has a config folder of its own: Claude runs one supervisor per config folder, so that folder’s supervisor serves only that project, and background sessions run there. Before they do, Keyfit reads the pid and start time in the folder’s
daemon.lockand, while that process runs, theKEYFIT_PROJECTin its environment (withps -E, which shows the whole environment to Keyfit; nothing else of it is kept or printed); a supervisor with another project’s environment, or with none, is refused. A session that agent view starts in another folder (a repository one level below, with@repo) runs with this project’s accounts, even when that folder belongs to another project. One started before this version, or withKEYFIT_DISABLE=1inside a session, keeps that project’s accounts until it stops: stop it in a terminal outside every project withclaude daemon stop --any(CLAUDE_CONFIG_DIR=… claude daemon stop --anyfor a login of its own) orcodex app-server daemon stop. Background sessions you start outside every project run with that terminal’s environment, also in a project’s folders, without its accounts or checks. - What is on PATH. Keyfit runs the first
aws,claude,codex,opencode,copilot,gemini(forSign in now?),gh,vercel,supabase,wrangler,convex,gcloud,firebase,npx(forSign in now?on a Convex login),uv,pipxandnpm(to install claude-swap or codex-multi-auth on a yes inkeyfit setup) andgiton PATH after its shims and Superset’s wrappers, as your shell would (for its Cloudflare and Firebase checks, the project’s ownnode_modules/.bin/wranglerorfirebasefirst, asnpxwould). A compromised binary or a malicious folder early on PATH wins. That includes relative entries such as.or./node_modules/.bin, which point into whatever folder you are in. - MCP servers Keyfit doesn’t see. It hides servers by name from
~/.claude.json(user and local scope), the current folder’s.mcp.json,~/.codex/config.toml(with the profile file and the project config Codex trusts), OpenCode’s configuration files, Copilot CLI’s and Gemini CLI’s (see above). A config file an agent loads that Keyfit can’t parse stops that agent. A Linear server is recognised bymcp.linear.appin its address or command, or by aLINEAR_…variable or a Linear key in itsenv; one that gets its key some other way (a wrapper script, a file) counts as any other server. Servers of installed Copilot CLI plugins are not hidden; its built-in GitHub server runs as the project’s account. OpenCode servers that come with a provider’s well-known configuration (an organization’s sign-in) are not hidden. Servers from plugins and claude.ai connectors are not hidden, and Keyfit doesn’t vet any server. claude.ai’s Gmail, Google Drive and Google Calendar connectors belong to the Claude account: Keyfit can’t see which Google account they are signed in to, only pick the Claude account per project. Google’s own remote Workspace servers (gmailmcp.googleapis.comand the like) keep their sign-in inside each agent, where Keyfit doesn’t look; in a project with Google Workspace servers they are hidden, and one given to a project withkeyfit add mcpis not checked. Codex can’t hide a server whose name has a dot or=, so if such a server must be hidden,codexdoesn’t start until you rename it. - Accounts you didn’t map, and identities it can’t confirm online. Unmapped accounts are neither checked nor cleaned up: in a project without a Supabase or Convex account,
supabaseandconvexrun with the CLI’s own login, as before Keyfit. A Supabase token is checked by organization, not by person; a folder linked to a preview branch is not checked (a warning says so); and--db-urlconnects to a database with its password, without the account. A Convex login is checked by team, not by Convex project; project deploy keys, local and self-hosted deployments are not checked. Codex is checked from its localauth.jsononly, and Claude from whatclaude auth statusreports. Copilot CLI is checked by GitHub login: whether that account has a Copilot plan is not checked (Copilot CLI says so when it starts). OpenCode is checked by provider: its sign-ins carry the provider’s name, not the person’s, so a sign-in to another person’s account of the same provider in the project’s database is not noticed, and no provider is asked whether a sign-in still works. Cloudflare is checked by account: which wrangler profile a folder uses is read from wrangler’s bindings file, as wrangler reads it, and wrangler 4.106 or newer is needed (older ones ignore profiles). Google Cloud is checked by the account and project of the gcloud configuration: a configuration that impersonates a service account, renews its sign-in elsewhere than at Google or overrides an API endpoint fails its check, and application default credentials (gcloud auth application-default login, one login per Mac, used by the client libraries and Terraform) are not checked. In a project without a Google Cloud account,gcloudruns with its active configuration, as before Keyfit. Firebase is checked by the account the firebase CLI uses in the project’s Firebase folder and the project it picks there (outside every Firebase folder, by the project the.firebasercthere picks); the email of a sign-in is the one the CLI recorded from Google’s ID token, and tokeninfo confirms the token belongs to it. Application default credentials are not checked, and in a project without a Firebase accountfirebaseruns with its own sign-ins, as before Keyfit. Gemini CLI is checked by the Google account its sign-in names; Google confirms it only while the sign-in’s token is valid (renewing it would take Gemini CLI’s own OAuth client), so after that the local check decides until Gemini CLI renews it. A Gemini API key is checked by whether the Gemini API accepts it, not whose it is, and a sign-in changed inside a running session (/auth) is checked at the next start. In a project without a Gemini CLI account,geminiruns with your own~/.gemini, as before Keyfit. A Google Workspace MCP server is checked by the emails its login names and by what Google says (the service-account and token variables that would sign it in instead are removed from the session, and a definition that sets one stops the agent), asked with the saved token or, once that has expired, with one renewed from the sign-in’s refresh token and the server’s own OAuth client. So Gmail AutoAuth, whose login names no account, is confirmed at every check. Without a refresh token or an OAuth client where the server reads it (Google Calendar MCP’s must be named withGOOGLE_OAUTH_CREDENTIALS: a client file inside its package is not looked for), the local check decides once the saved token has expired, and a login that names no account is a warning (the server is still the only Gmail server the project sees, reading the project’s login). Servers Keyfit doesn’t recognise by their package are hidden from other projects only once a project claims them by name, and their login is checked only as far as its file says.
How to audit it
Section titled “How to audit it”KEYFIT_DRY_RUN=1 claudein a project runs the checks and prints the real binary, the arguments Keyfit adds (including the--settingsJSON with the hidden MCP servers) and the names of the variables it changes, without starting the tool. Commands that would run without checks are printed with the reason and don’t start either:supabase,wrangler,convex,gcloudorfirebasein a project without an account of their kind, and, in any folder, OpenCode’s own commands (opencode serve,opencode mcp, …) and AWS profiles under[settings] shared_aws_profiles. Three things still start: sign-in commands, every other command in a folder that isn’t registered, and anything run withKEYFIT_DISABLE=1.keyfit which -vshows which project a folder belongs to, and why.keyfit statusruns every check online.cat ~/.config/keyfit/registry.toml,cat ~/.config/keyfit/cache/checks.jsonandcat ~/.config/keyfit/bin/claudeshow plain files with nothing secret in them.keyfit secret list, or Keychain Access (search for “keyfit”), shows the items Keyfit stored.- The code uses Python’s standard library only. A launch goes through
keyfit/shim.py(the launch),resolve.py(which project),environment.pyandadapters/(injecting and checking),mcp.py(hiding MCP servers),secrets.py(Keychain andenv:references),http.py(TLS) andcache.py.
Reporting a problem
Section titled “Reporting a problem”Please don’t report a vulnerability in a public issue, pull request or discussion. Report it privately instead:
- on GitHub, with private vulnerability reporting: the repository’s Security tab, then Report a vulnerability (https://github.com/getkeyfit/keyfit/security/advisories/new), or
- by email to contact@flamur-maliqi.de.
SECURITY.md says what to include and what counts. Never send real keys or tokens, not even expired ones.