A team of forty developers is standardising on Gemini CLI 0.62.0 - which sign-in should they use, and how do you stop anyone using a different one?
answer
- four ways in, four sets of terms
- individual tier versus a licence
- GOOGLE_CLOUD_PROJECT for org accounts
- system settings outrank user settings
- security.auth.enforcedType
basics
~10 sFor company code, use corporate Google accounts on a Code Assist Standard or Enterprise licence with GOOGLE_CLOUD_PROJECT set, or Vertex AI under the company project; enforce it with security.auth.enforcedType in the system settings file.
solid answer
~50 sGemini CLI offers four routes: **Sign in with Google**, which for an individual account means Gemini Code Assist for individuals (or an AI Pro or Ultra subscription); the same sign-in on a company, school or Workspace account or a Code Assist licence, which needs `GOOGLE_CLOUD_PROJECT`; a `GEMINI_API_KEY` from AI Studio; or **Vertex AI**. The choice is not cosmetic: each route carries its own terms of service, privacy notice and quota, and the Standard and Enterprise editions fall under Google Cloud's terms. A team working on company code usually picks the licence or Vertex AI, which bill and govern through the company's project, over forty personal free-tier accounts. Enforce it centrally: put `security.auth.enforcedType` in the system `settings.json`, which overrides user and project settings; mismatched users are prompted to switch and headless runs exit with an error. CI uses an API key or a Vertex service account.
code
json · 7 lines{
"security": {
"auth": {
"enforcedType": "oauth-personal"
}
}
}go deeper
Know the four ways to authenticate Gemini CLI: Google sign-in, a Code Assist licence with a Cloud project, a Gemini API key, and Vertex AI.
Explain which routes need GOOGLE_CLOUD_PROJECT, why headless runs use an API key or Vertex AI, and where settings files sit in precedence.
Roll out enforcement: security.auth.enforcedType in the system settings file, the proxy header for corporate domains, and separate credentials for CI.
Weigh terms, billing, quota and revocation across the routes, and justify licences or Vertex AI over forty personal free-tier accounts for company code.
## The four routes Gemini CLI is open source, but every request goes to a Google service, and **which service is decided by how you authenticate**. | Route | What it is | Needs a Google Cloud project? | Terms that apply | |---|---|---|---| | Sign in with Google, individual account | Gemini Code Assist for individuals, or a Google AI Pro or Ultra subscription | No, in most cases | Google Terms of Service plus the individual privacy notice (Google One terms for Pro and Ultra) | | Sign in with Google, organisation account or Code Assist licence | Code Assist Standard or Enterprise, a Workspace account, or a Developer Program licence | Yes: `GOOGLE_CLOUD_PROJECT` (or `GOOGLE_CLOUD_PROJECT_ID`) | Google Cloud Platform terms and the Cloud privacy notice for Standard and Enterprise | | Gemini API key | `GEMINI_API_KEY` from AI Studio | No | Gemini API terms, different for unpaid and paid use | | Vertex AI | ADC through `gcloud`, a service-account JSON key, or a Google Cloud API key | Yes: `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` | Google Cloud Platform service terms | One subtlety from the terms page: if a Google account is also associated with an active Code Assist Standard or Enterprise subscription, the Standard or Enterprise terms apply to all of that account's Code Assist use. Quotas follow the route too; the quotas page lists, for example, 1,000 requests per user per day for the individual Code Assist tier and more for the paid editions. ## Choosing for a team This is a judgment call rather than a lookup, and it turns on a few questions: - **Whose terms govern the company's code?** Forty developers signing in with personal accounts each accept individual terms for code that belongs to the employer. A Standard or Enterprise licence, or Vertex AI, puts usage under the company's Google Cloud agreement and project. - **How is it billed and capped?** A per-seat licence gives predictable cost and a per-user daily quota; Vertex AI is pay-as-you-go against a project, with spend visible and controllable there; API keys are per-key and easy to scatter. - **Who can revoke access?** Corporate accounts and service accounts are switched off when someone leaves; an API key in a personal `.env` lives until somebody remembers to rotate it. - **Where do the variables live?** A `.gemini/.env` in the project or home directory is loaded automatically (the first one found searching up from the working directory, then `~/.gemini/.env`), which is a better home for `GOOGLE_CLOUD_PROJECT` than a shell profile; secrets still belong in a secret store, not a committed file. - **What does CI use?** Browser sign-in is impossible on a runner. The authentication page points headless runs at an API key or Vertex AI, and for Vertex a service-account key referenced by `GOOGLE_APPLICATION_CREDENTIALS`. A common result: corporate accounts with a Code Assist licence (or Vertex AI) for people, and one Vertex service account or one tightly scoped key for pipelines. ## Making the choice stick Gemini CLI reads settings from four files, in increasing precedence: system defaults, the user's `~/.gemini/settings.json`, the project's `.gemini/settings.json`, and the **system settings** file, which overrides all the others. Its location is `/etc/gemini-cli/settings.json` on Linux, `/Library/Application Support/GeminiCli/settings.json` on macOS and `C:\ProgramData\gemini-cli\settings.json` on Windows (or `GEMINI_CLI_SYSTEM_SETTINGS_PATH`). Put the required method there: 1. Set `security.auth.enforcedType` (the enterprise page's example is `"oauth-personal"`, the Google sign-in). 2. A developer configured for a different method is prompted to re-authenticate with the enforced one. 3. A non-interactive run whose method does not match exits with an error, so a stray `GEMINI_API_KEY` in a pipeline fails loudly. Enforcing Google sign-in does not by itself keep people off personal Gmail accounts. The enterprise page describes a network-level control for that: a proxy that adds the `X-GoogApps-Allowed-Domains` header to Google sign-in requests so that only your Workspace domains can log in. It is configured on the proxy, not in Gemini CLI. ## Pitfalls - Exporting API keys or service-account key paths in a shell profile, where every process launched from that shell can read them. - Committing a key to a project `.gemini/.env`; an untrusted clone ignores it, but the repository history keeps it. - Putting `enforcedType` in a project `settings.json`, where any developer's choice or an untrusted folder sidesteps it.
- What do developers on Workspace accounts or a Code Assist licence need beyond choosing Sign in with Google?A Google Cloud project. Organisation accounts and Code Assist licences need `GOOGLE_CLOUD_PROJECT` (or `GOOGLE_CLOUD_PROJECT_ID`) pointing at a project with the Gemini for Cloud API enabled and the right IAM access. Set it in each environment, for example in `~/.gemini/.env`, rather than per terminal session.
- How would you authenticate the team's CI jobs once enforcedType requires Google sign-in on laptops?A runner has no browser and no cached sign-in, so it uses a Vertex AI service account through `GOOGLE_APPLICATION_CREDENTIALS` with project and location set, or one scoped `GEMINI_API_KEY` from the CI secret store, exposed only to the step that runs the CLI.
- All four sign-in methods are covered by the same terms and privacy notice.
- Workspace accounts work without setting a Google Cloud project.
- enforcedType in a project .gemini/settings.json binds every developer.
- Enforcing Google sign-in also blocks personal Gmail accounts.
- CI can reuse a developer's cached browser sign-in.
- One shared API key in a committed .env is the simplest team setup.
Assumes Gemini CLI 0.62.0: security.auth.enforcedType, the four settings files and the authentication routes are as documented for that release; quotas are as the quotas page stated on the fetch date.