服务商
Google Cloud
Agent 怎样通过 KeyKeeper 拿到 Google Cloud 的 key,在 console.cloud.google.com 该选什么,KeyKeeper 怎么验证。
| 模板 id | google-cloud(别名 gcp、google-service-account) |
|---|---|
| 字段 | google-application-credentials → GOOGLE_APPLICATION_CREDENTIALS · 凭据文件 |
| key 长什么样 | 创建时只显示一次 |
| 创建页面 | console.cloud.google.com |
| KeyKeeper 的验证 | 不验证 |
| 模板核实日期 | 2026-09-15 |
Agent 做什么
keykeeper providers show google-cloud
keykeeper save --provider google-cloud --from-file /路径/google-application-credentials.json --create --purpose "这个任务是做什么的"
keykeeper run -c google-cloud -- <你的命令>--provider google-cloud 会补上凭据 ID 和字段名。这些环境变量就是 Google Cloud 自家工具读的那个,不需要任何映射。
只有你能做的
Sign in to Google Cloud
Choose the project
Create or select a dedicated service account
Grant only the IAM roles the task needs
Create a JSON key only when workload identity or local user credentials cannot be used
复制 key,然后在 KeyKeeper 的窗口里确认保存。
该选什么
Prefer Application Default Credentials or workload identity. If a downloaded key is unavoidable, use a dedicated service account with resource-level, task-specific IAM roles — never Owner or Editor.
Agent 被告知的是同一件事。它替你打开页面、说明该选什么;它从不替你登录、过 2FA 或付费。
KeyKeeper 检查什么
- 写入前: 值必须像一把 Google Cloud 的 key(没有形状规则)。贴错了会在存入之前被拒绝,并告诉 Agent 原因——不含值。
- 保存后: Google Cloud 没有 KeyKeeper 可用的只读接口,第一次真实调用就是测试。
轮换与过期
User-managed service-account keys usually remain valid until revoked, but organization policy can impose expiry. Record a date only when the console or policy shows one. 在 console.cloud.google.com 轮换或撤销。