Gemini CLIがリリースされて話題になっていますね。
Developers, builders and creators: Bring the power of Gemini 2.5 Pro directly into your terminal with Gemini CLI, our new open-source AI agent with unmatched usage limits. Available now in preview — at no charge. pic.twitter.com/D576uqjfJG
— Google (@Google) 2025年6月25日
リリースされたばかりで、Gemini CLIの良い利用方法はまだ掴みきれていないですが、
そもそも業務利用して使うために、利用規約、特にデータの取り扱いについて正しく理解しておくことは非常に重要だとおもいます。
本記事では、どのサービス経由でGemini CLIを使うかによって、適用される規約やデータポリシーがどう変わるのかを見てみたいと思います。
ご注意:本記事は、Gemini CLI Previewのリリース直後(2025年6月末時点)の情報に基づいています。プレビュー版のため、今後の更新により内容が最新の情報と異なる場合があります。
Gemini CLIの利用形態とデータポリシー
Gemini CLIは、認証方法によって適用される利用規約が異なります。
公式のドキュメント(Terms of Service & Privacy)では以下のように記載されています。
利用可能な形態
- Login with Google (Gemini Code Assist for individuals) → Googleが提供する個人向けサービス
- Gemini API Key (Using Gemini Developer API a: Unpaid Service, b: Paid Service) →Googleが提供するどちらかと言えば個人利用やPoC用途
- Login with Google (for Workspace or Licensed Code Assist users)
- Vertex AI (Using Vertex AI Gen API)→ Cloudのサービスで企業ユース ※適応される規約が異なってきます
データがモデル学習に利用されるケース
以下の方法で利用する場合、プロンプト、生成された回答、および関連コードがGoogleの製品改善(モデルのトレーニングを含む)のために収集・利用される可能性があります。業務利用の際はご注意ください。
- Gemini Code Assist for individuals
- 無料契約のGemini API
Auth method 1: Yes. When you use your personal Google account, the Gemini Code Assist Privacy Notice for Individuals applies. Under this notice, your prompts, answers, and related code are collected and may be used to improve Google's products, which includes model training.
Auth method 2a: Yes, When you use the Gemini API key Gemini API (Unpaid Service) terms apply. Under this notice , your prompts, answers, and related code are collected and may be used to improve Google's products, which includes model training.
データがモデル学習に利用されないケース
以下の方法で利用する場合、再学習されないと記載されており、問題ないと思われます。
Auth method 2b, 3 & 4: No. For these accounts, your data is governed by the Google Cloud or Gemini API (Paid Service) terms, which treat your inputs as confidential. Your code, prompts, and other inputs are not used to train models.
【Tips】知っておきたいサービスの違い Google と Google Cloudの違い
- Google: 一般ユーザー向けのWebサービス(検索、Gmailなど)を提供します。
- Google Cloud: 企業向けのクラウドサービス(GCP, Google Workspaceなど)を提供します。
提供元がどちらの会社かは、サービスのドキュメントのURLドメイン(google.comかcloud.google.comかなど)でおおよそ見当がつきます。
詳しい違いのイメージはこちらも参考にしてください。
zenn.dev
【Tips】知っておきたいサービスの違い Gemini API と Vertex AI Gen API
- Gemini API: Googleが提供する、主に個人開発者やライトユーザー向けのAPIです。
- Vertex AI: Googe Cloudが提供する、高度なセキュリティとガバナンスを備えたエンタープライズ向けのAIプラットフォームです。 企業向けで本番で利用する際は、VertexAI経由で利用するのが良いとされています。
オプトアウト
利用統計情報の収集も下記のドキュメントにあるように、収集されるものがあり、オプトアウトが可能になります。
収集されるのは主にサービス改善のための統計情報です。しかし、利用者側に直接的なメリットは特にないため、業務で利用する場合はオプトアウトしておくのが無難でしょう。
https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#usage-statistics
収集されるもの
Tool Calls: We log the names of the tools that are called, whether they succeed or fail, and how long they take to execute. We do not collect the arguments passed to the tools or any data returned by them.
API Requests: We log the Gemini model used for each request, the duration of the request, and whether it was successful. We do not collect the content of the prompts or responses.
Session Information: We collect information about the configuration of the CLI, such as the enabled tools and the approval mode.収集されないもの
Personally Identifiable Information (PII): We do not collect any personal information, such as your name, email address, or API keys.
Prompt and Response Content: We do not log the content of your prompts or the responses from the Gemini model.
File Content: We do not log the content of any files that are read or written by the CLI.
実際にセットアップしてみる
セットアップ自体は、ドキュメント通りに行えば簡単にできます。
Google Workspaceの場合
私はGoogle Workspaceのアカウントを持っていたので、こちらで試してみました。
Login With GoogleでGoogle Workspaceアカウントを設定すると、最初はこのようにエラーとなったので、環境設定に登録します
echo 'export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc source ~/.bashrc
これで動作しました。
Vertex AI (GCP) の場合
ドキュメントには以下のように設定するとあります。
- GCPプロジェクトの認証
gcloud auth application-default login
- 環境変数の設定
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION" # 例: us-central1 export GOOGLE_GENAI_USE_VERTEXAI=true
まとめ
Gemini CLIを安全かつ効果的に利用するためには、ご自身のユースケースに合わせて適切な利用形態を選択することが不可欠です。特に業務で利用する場合は、入力データがモデル学習に使われない企業向けサービス(Workspace, Vertex AIなど)がその候補になるかと思います
最後まで読んでいただき、ありがとうございました。
↓ のスターを押していただけると嬉しいです。励みになります。
執筆:@iida.michitaka7b3a3dd24e9c454b、レビュー:Ishizawa Kento (@kent)
(Shodoで執筆されました)