1
---
2
name: agent-platform-endpoint-management
3
metadata:
4
version: "1.0.3"
5
category: AiAndMachineLearning
6
description: >-
7
Manages Agent Platform serving endpoints. Use when you need to create, list,
8
describe, update, or delete serving endpoints for model deployment on Agent
9
Platform. Also use when troubleshooting endpoint permission, quota, or resource
10
busy errors. Don't use for deploying models to endpoints or for running
11
model evaluations.
12
---
13
14
# Agent Platform Endpoint Management
15
16
## Attribution
17
18
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST
19
read [Usage Attribution](references/attribution.md). For commands executed
20
directly in the terminal (never in generated scripts, Terraform, or user code),
21
prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` and append the
22
attribution suffix to `User-Agent` headers:
23
24
```text
25
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:agent-platform-endpoint-management)"
26
User-Agent: <existing_user_agent> agent-skills/1.0 (skill:agent-platform-endpoint-management)
27
```
28
29
## Overview
30
31
This skill provides procedural knowledge for managing Agent Platform Endpoints.
32
Endpoints are logical serving hosts that provide a stable URL for online
33
predictions. You must create an endpoint before you can deploy a model to it.
34
35
## Safety & Confirmation Tiers (CRITICAL)
36
37
Before executing any commands on behalf of the user, you MUST adhere to the
38
following safety tiers based on the action requested:
39
40
1. **Tier R: Read-only (`list`, `describe`, `get`)**
41
* No confirmation needed. Execute immediately to gather information.
42
2. **Tier M: Mutating & Reversible (`create`, `update`)**
43
* Requires **interactive confirmation** with 'Yes'/'No' options. The
44
confirmation prompt MUST contain the exact, literal command string with
45
all required flags (e.g. `--region=us-central1`, `--display-name="..."`)
46
— natural-language paraphrases are NOT sufficient.
47
* **Same-turn restriction**: NEVER execute the command in the same turn as
48
presenting the confirmation prompt. Stop and wait for the user's reply;
49
only execute after explicit 'Yes' / approval.
50
3. **Tier D: Destructive & Irreversible (`delete`)**
51
* Requires **explicit typed confirmation** (e.g. "I confirm" or "Yes,
52
delete it"). Ask for confirmation IMMEDIATELY — before any pre-flight
53
checks (don't `describe` first, don't check if the endpoint is empty
54
first).
55
* **Same-turn restriction**: NEVER execute in the same turn as asking for
56
typed confirmation. Wait for the user to reply in a new turn.
57
58
## Phase 0: Environment Setup
59
60
**CRITICAL**: Before running any commands, you MUST ensure the environment is
61
correctly initialized by following these steps:
62
63
1. **Google Cloud Authentication**: Authenticate with your Google Cloud
64
credentials and configure active Application Default Credentials (ADC) for
65
Agent Platform access:
66
67
```bash
68
gcloud auth login
69
gcloud auth application-default login
70
```
71
72
2. **Set Project**: Configure the active project for subsequent commands:
73
74
```bash
75
gcloud config set project $PROJECT_ID
76
```
77
78
3. **Region**: Always specify `--region=$LOCATION_ID` on each command below. Do
79
NOT use `global`. Ask the user to specify the region if not provided.
80
81
## 1. Listing Endpoints (Tier R)
82
83
Use this command to discover existing endpoints in a specific region and
84
retrieve their IDs. No confirmation is required.
85
86
```bash
87
gcloud ai endpoints list \
88
--region=$LOCATION_ID
89
```
90
91
*(Optional)* To bound the result, use `--limit=$LIMIT`; `--page-size=$PAGE_SIZE`
92
controls API chunking only and does NOT limit the total output. Use
93
`--page-token=$PAGE_TOKEN` to continue from a previous batch.
94
95
> [!IMPORTANT]
96
>
97
> Always specify the `--region`. Do NOT use 'global'. Ask the user to specify if
98
> not provided.
99
100
## 2. Describing an Endpoint (Tier R)
101
102
Retrieve the full metadata for a specific endpoint. No confirmation is required.
103
104
```bash
105
gcloud ai endpoints describe $ENDPOINT_ID \
106
--region=$LOCATION_ID
107
```
108
109
The models deployed on an endpoint are its `deployedModels` in this output. In
110
the Python SDK they are `endpoint.gca_resource.deployed_models`;
111
`aiplatform.Endpoint` has no `deployed_models` attribute.
112
113
## 3. Creating an Endpoint (Tier M)
114
115
Create a new endpoint resource. The parent resource is the location. **Action
116
requires an inline confirmation card before proceeding.**
117
118
```bash
119
gcloud ai endpoints create \
120
--region=$LOCATION_ID \
121
--display-name="my-endpoint"
122
```
123
124
The command has no `--asynchronous` flag: it waits for the operation and prints
125
the new endpoint's resource name, whose last segment is the endpoint ID.
126
127
> [!IMPORTANT]
128
>
129
> **You MUST seek interactive confirmation first.** Your confirmation prompt
130
> **MUST** show the literal command string. For example:
131
>
132
> ```bash
133
> gcloud ai endpoints create --region=$LOCATION_ID --display-name="my-endpoint"
134
> ```
135
>
136
> Or the exact flags. Do not execute this command in the same turn as proposing
137
> the confirmation.
138
139
## 4. Updating an Endpoint (Tier M)
140
141
Update endpoint metadata such as display name or labels. **Action requires an
142
inline confirmation card before proceeding.**
143
144
```bash
145
gcloud ai endpoints update $ENDPOINT_ID \
146
--region=$LOCATION_ID \
147
--display-name="new-display-name"
148
```
149
150
Check if the endpoint exists first by either listing or describing the endpoint.
151
152
> [!IMPORTANT]
153
>
154
> **You MUST seek interactive confirmation first.** Your confirmation prompt
155
> **MUST** show the literal command string. For example:
156
>
157
> ```bash
158
> gcloud ai endpoints update $ENDPOINT_ID --region=$LOCATION_ID --display-name="new-display-name"
159
> ```
160
>
161
> Or the exact flags. **CRITICAL:** You are strictly prohibited from executing
162
> this command in the same turn as asking for confirmation. When you ask for
163
> confirmation, you MUST stop immediately and wait for the user to reply.
164
165
## 5. Deleting an Endpoint (Tier D)
166
167
Permanently delete an endpoint resource. **Action requires explicit typed
168
confirmation before proceeding.**
169
170
```bash
171
gcloud ai endpoints delete $ENDPOINT_ID \
172
--region=$LOCATION_ID
173
```
174
175
> [!WARNING]
176
>
177
> All models must be **undeployed** from the endpoint before it can be deleted.
178
> Do not run `describe` until AFTER you have received typed confirmation to
179
> delete.
180
181
## 6. Traffic Splitting (Tier M)
182
183
You can manage traffic split between different models deployed on the same
184
endpoint during an update. **Action requires an inline confirmation card before
185
proceeding.**
186
187
```bash
188
# Example: Deploying a model with a specific traffic split is usually done
189
# via 'gcloud ai endpoints deploy-model'.
190
```
191
192
Refer to the `agent-platform-deploy` skill for instructions on deploying and
193
undeploying models.
194
195
## Troubleshooting
196
197
- **403 Permission Denied**: Ensure `roles/aiplatform.admin` or `roles/owner`
198
role is assigned.
199
- **Quota Exceeded**: Verify the region's endpoint quota in the Cloud Console.
200
- **Resource Busy**: If a deletion fails, check if models are still being
201
undeployed.
202