1
---
2
name: cloud-operator-admin-setup
3
metadata:
4
version: "1.2.0"
5
category: CloudInfrastructureAndServices
6
description: >-
7
Sets up and manages the organization-wide settings of the Cloud Operator
8
Agent ("Gemini for Google Cloud operations" in the console): turning it on or
9
off for the organization, its settings, and user access. Use when an
10
organization administrator wants to set it up for the whole organization or
11
change it, or when Cloud Operator is turned off for the organization or the
12
user has no access there. Don't use when someone asks to set up Cloud
13
Operator or their operator agent for themselves, even in a named
14
organization (use `cloud-operator-setup`).
15
---
16
17
# Set up Cloud Operator for an organization
18
19
If the user asks to set up Cloud Operator and it isn't clear whether they want
20
their own operator agent or to set it up for the whole organization as its
21
administrator (for example "Set up Cloud Operator for my organization" or
22
"... for organization 123456789012"), ask them which, in one short question,
23
before anything else, including asking for or looking up the organization.
24
For their own agent, use the `cloud-operator-setup` skill if it's installed.
25
26
Go through the steps in order: show the current value, explain each option in
27
a sentence, and wait for their answer. Ask Steps 5–7 together, in one message:
28
they can keep all of them or name the ones to change. Every choice is the
29
administrator's: never recommend accepting the preview terms or any setting,
30
and change only what they chose. Their choice is the confirmation, and so is a
31
request that names the new value (for example "don't allow memory"); turning
32
Cloud Operator on or back on, and granting a role, always need their reply
33
first (Step 4, Give a user access). Send a change once they choose it; for
34
Steps 5–7, send only the ones they changed, in one request. Talk to the user in
35
plain terms: don't name this skill's steps, sections or cases.
36
37
| They ask to | Do |
38
| --- | --- |
39
| Set up Cloud Operator for the whole organization (as its administrator) | Steps 1–8 |
40
| Change one setting | Steps 1–3, that step (Step 4 first if it's off), Step 8 |
41
| Turn Cloud Operator back on | Steps 1–4, then Step 8 |
42
| Turn Cloud Operator off | [Turn it off](#turn-it-off) |
43
| Give someone access | [Give a user access](#give-a-user-access) |
44
| Their agent can't be created because it's turned off or they have no access (sent by another skill) | [Coming from setup](#coming-from-setup) |
45
46
## Usage Attribution
47
48
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
49
MUST read and follow the instructions in
50
[Usage Attribution](references/attribution.md).
51
52
## Step 1: gcloud
53
54
The calls below need gcloud signed in as an administrator of the organization,
55
with Application Default Credentials
56
(`gcloud auth application-default print-access-token` works); say which
57
account you'll use. Both sign-ins must be the same account: the API calls use
58
Application Default Credentials, while the role grant and
59
`gcloud config get-value account` use the gcloud sign-in. You can't see the
60
Application Default Credentials account directly, so ask them to confirm they
61
used the same account for both. Ask it in the same reply as Step 3's read;
62
you need their answer only before the first change. If it's installed but not
63
signed in, they run `gcloud auth login` and
64
`gcloud auth application-default login`. Otherwise, or if signing in fails,
65
use [the console](#without-gcloud-the-console), or they install gcloud
66
(https://docs.cloud.google.com/sdk/docs/install-sdk.md.txt) first. Without
67
gcloud, don't reach the APIs another way (for example by reading credential
68
files or creating tokens).
69
70
## Step 2: Organization ID
71
72
Calls use the numeric ID. Take it from the user or the error they saw, or ask
73
for its ID, domain or a project in it: resolve a domain with
74
`gcloud organizations list --filter="displayName={domain}" --format=json`
75
(if several match, ask which), a project with
76
`gcloud projects get-ancestors {project_id} --format=json` (the `id` of the
77
entry whose `type` is `organization`; if there's none, Cloud Operator works
78
only in organizations: stop). If a lookup fails or finds nothing, ask for the
79
ID; never guess. Before changing anything, say which organization and account
80
you're using, for example "Setting up Cloud Operator for organization
81
{org_id} as {account}."
82
83
## Step 3: Read the settings
84
85
```bash
86
curl -sS -w '\nHTTP %{http_code}\n' \
87
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
88
"https://geminicloudassist.googleapis.com/v1alpha/organizations/{org_id}/locations/global/agentAdminSettings"
89
```
90
91
| Result | Do |
92
| --- | --- |
93
| 200 | Keep the `etag`. Show Gemini usage (`enablementState`), agent memory (`memoryDisabled`), agent actions (`effectiveMutationMode`) and data sharing (`effectiveDataSharingAvailability`) |
94
| 403 `IAM_PERMISSION_DENIED` | The account can't manage these settings (an Organization Administrator can). If they asked to set up Cloud Operator without saying it's for the whole organization, they may only want their own agent: use `cloud-operator-setup` instead (it tells turned off from no access). If it may be the wrong account, they switch (Step 1); otherwise give them the [message for their administrator](#message-for-an-administrator) and stop |
95
| 401, or `ACCESS_TOKEN_TYPE_UNSUPPORTED` | Credentials: Step 1 once more, then the console |
96
| 400 "Consumer 'organizations/{id}' is invalid", or 404 | Wrong ID: ask for it; if they confirm it, stop |
97
| Anything else | Show the error and offer the console |
98
99
The response leaves out false fields: no `memoryDisabled` means memory is
100
allowed, no `writePreviewEnrolled` means not enrolled.
101
102
## Step 4: Gemini usage
103
104
| `enablementState` | Tell them | Choice | On yes, send |
105
| --- | --- | --- | --- |
106
| `ENABLED` | It's on, under the [preview terms](#preview-terms) | — | — |
107
| `EXCLUDED`, no `disableTime` | It isn't on. Name the `exclusionReasons` (for example VPC Service Controls, CMEK, Assured Workloads, data residency, a Business Associate Agreement, EU billing), or if there are none, that it isn't on by default. Then [what enabling doesn't change](#what-enabling-doesnt-change) and the [preview terms](#preview-terms) | **Enable** / **Not now** | `{"previewAcceptance": true, "agentsDisabled": false, "etag": "{etag}"}`, `updateMask=previewAcceptance,agentsDisabled` |
108
| `EXCLUDED` with `disableTime` | Google turned it off then, for those reasons; sessions can be exported until `disableTime` + 30 days, then everything is deleted. Then as above | **Restore** / **Not now** | Same |
109
| `DISABLED_BY_ADMIN` | An administrator turned it off on `disableTime`; agents and sessions are deleted 30 days later (give that date with its year: it can fall in the next year). Then the [preview terms](#preview-terms) | **Restore** / **Not now** | `{"agentsDisabled": false, "etag": "{etag}"}`, `updateMask=agentsDisabled` |
110
111
[Send it](#sending-a-change) only after an explicit **Enable** or **Restore**
112
in their reply, even when they asked to turn it on or back on (show the state
113
and the terms first), and check the response shows `ENABLED`. If a Restore
114
comes back `EXCLUDED`, continue with that row: name the `exclusionReasons`,
115
and send **Enable** (with `previewAcceptance`) only on their choice. Then read
116
the settings again (Step 3) and use that read for Steps 5–7: enabling can change
117
`writePreviewEnrolled`, `effectiveDataSharingAvailability` and the `etag`.
118
Then continue as routed. On **Not now**,
119
stop: the other settings can't change while it's off ([coming from
120
setup](#coming-from-setup), go back to the skill that sent them).
121
122
## Step 5: Agent memory
123
124
**Allow** (users can turn on memory, so their agents remember context across
125
sessions) or **Don't allow** (no memories saved or recalled in new sessions;
126
existing ones are paused, not deleted). If it changes, send `memoryDisabled`
127
(`true` = don't allow).
128
129
## Step 6: Agent actions
130
131
Without `writePreviewEnrolled`, agents stay read only (the organization isn't
132
in the write preview): say so and skip. Otherwise, from `effectiveMutationMode`:
133
**Read only** (agents inspect resources, logs and metrics but change nothing) or
134
**Read and write** (they can also create and update resources; every change
135
needs the user's approval). If it changes, send `mutationMode` (`READ_ONLY` or
136
`WRITE_WITH_APPROVAL`). "Write actions are in private preview" means not
137
enrolled.
138
139
## Step 7: Data sharing
140
141
If `effectiveDataSharingAvailability` is `NOT_AVAILABLE_IN_REGION` (billed in
142
the EEA, Switzerland or the UK), say so and skip. Otherwise **Allow** (users may
143
opt in to sharing interaction data with Google; off for each user until they do)
144
or **Don't allow** (no one can opt in). If it changes, send
145
`dataSharingWithGoogleDisabled` (`true` = don't allow).
146
147
## Step 8: Summary
148
149
Read the settings again and show the four values. Tell them changes take about
150
a minute to apply. Offer `cloud-operator-setup` for their own agent.
151
152
## Coming from setup
153
154
`cloud-operator-setup` (or `cloud-operator`) sends a user here when their
155
operator agent can't be created or used because Cloud Operator is turned off
156
for the organization, or they have no access there. They may not be an
157
administrator. You already have the organization ID, and the other skill says
158
which case it is. If it doesn't, do a Step 3 read first: `ENABLED` means no
159
access, anything else means turned off; if the read returns 403 (here that
160
doesn't stop you), ask the user what the page or error said, and if that
161
doesn't tell, cover both cases. If
162
gcloud stops working here (for example a 401), use the **Without gcloud** reply
163
below instead of the full console walkthrough. When done, go back to the skill
164
that sent them, saying what changed (or that nothing did); after a change, that
165
skill waits about a minute and runs its check call again before anything
166
else.
167
168
- **Without gcloud:** you can't check, so cover both in one reply: an
169
administrator turns it on at
170
`https://console.cloud.google.com/gemini/admin/onboarding?organizationId={org_id}`
171
(**Enable Gemini**, which accepts the preview terms for the whole
172
organization) or grants access under **IAM & Admin** > **IAM**; anyone else
173
sends the [message for their administrator](#message-for-an-administrator).
174
- **Turned off:** say which organization and account you're using, and do Step
175
3. On 403, they aren't an administrator: give them the enable
176
[message](#message-for-an-administrator). On 200, do Step 4 only (if it's
177
already `ENABLED`, the problem is access instead: continue with **No access**
178
below); the other settings keep their defaults and can be changed later.
179
- **No access:** users get access without a role only in their own (home)
180
organization, the one their account belongs to; elsewhere an administrator
181
grants `roles/geminicloudassist.user`. First check whether this is their home
182
organization: compare the domain of their account (`gcloud config get-value
183
account`) with the organization's name (`gcloud organizations describe
184
{org_id} --format="value(displayName)"`, its primary domain).
185
- **Same:** their home organization, where users normally have access, so an
186
administrator has restricted it.
187
- **Different** (most likely another organization; a secondary domain of the
188
same company is possible): they need the role.
189
- **Can't tell** (the organization can't be read): cover both in one reply.
190
191
In every case, check whether they can grant it themselves (read-only):
192
193
```bash
194
curl -sS -w '\nHTTP %{http_code}\n' -X POST \
195
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
196
-H "Content-Type: application/json" \
197
-d '{"permissions": ["resourcemanager.organizations.setIamPolicy"]}' \
198
"https://cloudresourcemanager.googleapis.com/v3/organizations/{org_id}:testIamPermissions"
199
```
200
201
If it returns HTTP 200 with the permission, confirm that gcloud and
202
Application Default Credentials are signed in as the same account (as in
203
Step 1), then offer to grant
204
`roles/geminicloudassist.user`
205
to their own account, saying it lets them create and use their own operator
206
agent in that organization; if they accept, run the grant in
207
[Give a user access](#give-a-user-access) directly (their acceptance is the
208
confirmation; you already have the organization). If it returns HTTP 200
209
without it, give them the access [message](#message-for-an-administrator)
210
(in their home organization, asking to restore access instead). On any other
211
error, you can't tell: cover both in one reply.
212
213
If the organization doesn't appear in `gcloud organizations list` for their
214
account, they'll also need the Organization Viewer role
215
(`roles/resourcemanager.organizationViewer`) on the organization: without it
216
the console's agent creation page shows "URL not found". Include it in the
217
same self-grant offer or administrator message, so it takes one round
218
trip.
219
220
## Give a user access
221
222
Users can create an agent without a role only in their home organization;
223
elsewhere they need `roles/geminicloudassist.user` on the organization. Give
224
it when a user's call to their agent fails with a permission error (for example
225
`Permission 'geminicloudassist.agents.invoke' denied`), or when the
226
administrator asks to give someone access. Do Steps 1–2 unless coming from
227
setup, which already has them. If you don't know
228
whether Cloud Operator is on, also run Step 3: if it's off, say the role won't
229
help until it is, and if it returns 403, skip the check and go on since it only
230
means they can't read the settings. Get the member
231
(`user:{email}`, `group:{email}` or `domain:{domain}`; never guess) unless the
232
caller gave it. Confirm once what it allows (creating and using their own
233
operator agent in that organization) and wait for their yes, even when they
234
named the member; skip this only when another skill sent you here after the
235
user agreed there. Then grant that role (no other, except as below):
236
237
```bash
238
gcloud organizations add-iam-policy-binding {org_id} \
239
--member="{member}" --role="roles/geminicloudassist.user" --condition=None
240
```
241
242
When coming from setup with an offer that also included Organization Viewer
243
(because the organization isn't in `gcloud organizations list` for their
244
account), grant that role too. Tell them it lets their account read the
245
organization, which the console needs to show the agent creation page:
246
247
```bash
248
gcloud organizations add-iam-policy-binding {org_id} \
249
--member="{member}" --role="roles/resourcemanager.organizationViewer" --condition=None
250
```
251
252
A permission error means the account can't change the organization's IAM
253
policy. An allowed-domains error means the organization's domain-restricted
254
sharing policy blocks that domain: tell them (a member from an allowed domain
255
would work) and don't change the policy. Without gcloud: **IAM &
256
Admin** > **IAM** in the console. It can take a few minutes to apply. If another
257
skill sent them, go back to it, saying whether it was granted.
258
259
## Turn it off
260
261
After Steps 1–3 (if it isn't `ENABLED`, it's already off: say so and stop),
262
warn them: all
263
operator agents in the organization stop immediately; users have 30 days to
264
export their sessions; then all agents and sessions are permanently deleted;
265
they can restore it within those 30 days. Ask them to type `disable` to
266
confirm; anything else cancels. Then [send](#sending-a-change)
267
`{"agentsDisabled": true, "etag": "{etag}"}` with
268
`updateMask=agentsDisabled`, check for `DISABLED_BY_ADMIN`, and give the
269
deletion date with its year (`disableTime` + 30 days; it can fall in the next
270
year).
271
272
## Without gcloud: the console
273
274
Ask for the numeric organization ID (you can't look it up) and walk them
275
through
276
`https://console.cloud.google.com/gemini/admin/onboarding?organizationId={org_id}`
277
as an administrator (without the ID, leave out `?organizationId=…` and they
278
pick the organization at the top).
279
280
- **Welcome page:** "enabled" → **Continue to settings**. "Disabled" → it shows
281
the preview terms; **Enable Gemini** accepts them for the whole organization,
282
then **Continue to settings**. A page to create their own agent instead means
283
they aren't an administrator: [message for their
284
administrator](#message-for-an-administrator).
285
- **Organization settings:** the same choices as Steps 4–7: **Gemini usage**
286
(**Restore**, or **Disable** with the [warning](#turn-it-off) and typing
287
`disable`), **Agent memory**, **Agent actions** (shown only if enrolled),
288
**Data sharing**; then **Save**.
289
- **Access:** **IAM & Admin** > **IAM**, role `roles/geminicloudassist.user`.
290
291
## Reference
292
293
### Sending a change
294
295
Send only the changed fields, named in `updateMask` (comma-separated), with
296
the `etag` from your last read:
297
298
```bash
299
curl -sS -w '\nHTTP %{http_code}\n' -X PATCH \
300
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
301
-H "Content-Type: application/json" \
302
-d '{"memoryDisabled": true, "etag": "{etag}"}' \
303
"https://geminicloudassist.googleapis.com/v1alpha/organizations/{org_id}/locations/global/agentAdminSettings?updateMask=memoryDisabled"
304
```
305
306
The response is the updated settings: check the value and keep its `etag`. A
307
409 `ABORTED` ("Provided etag is out of date") means the settings changed
308
since your read: read again. If none of the values you showed them changed
309
(only the `etag`, as right after enabling), resend with the new `etag`
310
without asking. Otherwise show what changed and ask again about your change
311
(skip it if it's already there). For any other error (for example a 403 when
312
the account can read the settings but not change them), show it and stop.
313
314
### What enabling doesn't change
315
316
With VPC Service Controls (`VPC_SC`), agents still can't reach projects inside
317
a service perimeter. With EU billing (`EU_BILLING_ACCOUNT`), data sharing stays
318
off. Mention the ones that apply.
319
320
### Preview terms
321
322
Show in full before enabling or restoring: "This product is subject to the
323
Pre-GA Offerings Terms in the General Service Terms section of the Service
324
Specific Terms (https://cloud.google.com/terms/service-terms) and the
325
Additional Terms for Generative AI Preview Products
326
(https://cloud.google.com/trustedtester/aitos), and should not be used with
327
personal data or other data subject to legal or regulatory compliance
328
requirements. By enabling it, you acknowledge and agree to these
329
terms on behalf of your organization. You can turn it off at any time."
330
331
### Message for an administrator
332
333
- **Enable:** "Please turn on Gemini for Google Cloud operations (Cloud
334
Operator) for our organization {org_id}. As an organization administrator,
335
open
336
https://console.cloud.google.com/gemini/admin/onboarding?organizationId={org_id}
337
or run the cloud-operator-admin-setup skill."
338
- **Access:** "Please grant me ({email}) roles/geminicloudassist.user on
339
organization {org_id} so I can create my Gemini for Google Cloud operations
340
(Cloud Operator) agent:
341
`gcloud organizations add-iam-policy-binding {org_id} --member="user:{email}"
342
--role="roles/geminicloudassist.user" --condition=None`" If they can't read
343
the organization, add: "and roles/resourcemanager.organizationViewer, which
344
the console needs to show the agent creation page:
345
`gcloud organizations add-iam-policy-binding {org_id} --member="user:{email}"
346
--role="roles/resourcemanager.organizationViewer" --condition=None`"
347
348
Adjust it to what they need, for example "turn it back on".
349