---
url: https://bishop.agentdeployment.co/reference/credentials.md
description: Every credential Bishop reads, and where it reads them from.
---

# Credentials

Credentials live in `.env` in Bishop's own directory, or in the environment, and never in `.bishop/config.json`. Setup writes each interface's to `.env` and gitignores it. An exported variable wins over the same one in `.env`. On a host, keep `.env` at mode `0600`, owned by the user Bishop runs as. In a [container](/deploying/container), pass them as environment variables.

Credentials alone don't start an interface: it also needs a block in [the config](/reference/config), like `"slack": {}`. That way a token inherited from the environment can't start an interface nobody chose.

| Variable | For |
|---|---|
| `BISHOP_SLACK_BOT_TOKEN`, `BISHOP_SLACK_APP_TOKEN` | Slack. The `xoxb-` and `xapp-` tokens, written by `bishop slack setup`. |
| `BISHOP_GMAIL_CLIENT_ID`, `BISHOP_GMAIL_CLIENT_SECRET`, `BISHOP_GMAIL_REFRESH_TOKEN` | Gmail over OAuth. You set the first two, and `bishop gmail setup` writes the third. |
| `BISHOP_GMAIL_USER`, `BISHOP_GMAIL_SERVICE_ACCOUNT` | Gmail over domain-wide delegation, instead of the OAuth three. The service account is a path to its JSON key, or the JSON itself. |
| `BISHOP_TEAMS_CLIENT_ID`, `BISHOP_TEAMS_CLIENT_SECRET`, `BISHOP_TEAMS_TENANT_ID` | Microsoft Teams, written by `bishop teams setup`. |
| `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` | The `claude` harness. Without either, it uses whatever login `claude` has on the machine. |
| `CODEX_API_KEY` | The `codex` harness. Without it, it uses `codex login`. The harness doesn't read `OPENAI_API_KEY`. |
| `TYPESAFE_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` or `GOOGLE_API_KEY`, `OPENROUTER_API_KEY` | The [decision model](/reference/config#decisions), whichever `decisions.model.provider` names. Startup fails if it's missing. Use the standard name for one key Bishop and the agent share. |
| `BISHOP_TYPESAFE_API_KEY`, `BISHOP_OPENAI_API_KEY`, `BISHOP_GEMINI_API_KEY`, `BISHOP_OPENROUTER_API_KEY` | A decision model key of Bishop's own, which never reaches the agent. It wins over the standard name when both are set, and the startup log's `keyVariable` says which one Bishop used. Gemini has no `BISHOP_GOOGLE_API_KEY`. |
| `CODEX_HOME` | Where the `codex` harness keeps its state, if not `~/.codex`, for threads that share one. |
| `GH_TOKEN` | The agent's GitHub credential, written by [`bishop github setup`](/running/github). |
| `BISHOP_LOG_LEVEL` | The log level, `info` by default. The one setting of Bishop's own that isn't in the config file. |

A harness credential in the environment, rather than a `claude` or `codex` login, also gives each new thread a harness home of its own, so threads can't read each other's transcripts under the [sandbox](/running/sandbox#what-the-agent-can-reach).

Variables starting `BISHOP_` in Bishop's environment are never passed to the agent. Bishop sets [its own `BISHOP_` variables](/reference/agent-environment) in the agent's environment. Anything else in `.env` reaches the agent's environment unless `agent.env` withholds it, which is how `GH_TOKEN` gets there. See [What each level runs with](/running/access#what-each-level-runs-with). Bishop reads `.env` at startup, so a change needs a restart.

Setup commands that open a browser are meant to run on a laptop. Copy the lines they write to the server's `.env`.
