Bind Vertex Endpoint Prediction to the Calling Principal
Vertex online prediction requires the aiplatform.endpoints.predict permission on the requested endpoint resource. A production design should give each workload a distinct principal, bind only the prediction permission at the narrowest documented IAM scope, pin the approved endpoint in gateway policy, and record the human or agent context behind the workload call.

A Vertex online prediction request names its target in the path: projects/PROJECT/locations/LOCATION/endpoints/ENDPOINT:predict. Google Cloud IAM evaluates the authenticated principal's aiplatform.endpoints.predict permission. That check establishes workload access to prediction. It still leaves an enterprise question for a shared application: which authenticated user or agent was allowed to invoke this endpoint with this data under the current route policy?
I would separate those decisions in the design review. Combining them produces a service-account log that says the workload was allowed and nothing about the caller behind it.
TL;DR
- Give each calling workload a dedicated Google Cloud principal and grant only the prediction permissions it needs.
- Pin the full Vertex endpoint resource in trusted gateway configuration and reject caller-supplied project, location, or endpoint overrides.
- Treat Google Cloud IAM as workload authorization, then apply identity-bound enterprise policy to the user or agent context carried by the application.
- Record both identities, the exact endpoint resource, policy version, request classification, and prediction outcome.
Vertex evaluates a principal against a resource
Google's current Vertex access-control documentation says access is granted by assigning IAM roles to principals. It gives a custom-role example containing aiplatform.endpoints.predict and describes assigning that role to a service account for prediction access without endpoint-control permissions.
The principal can be a service account used by an application, VM, or workload. Its access token authenticates the Google Cloud caller. Keep that principal unique to the workload and environment. Sharing one service account across a notebook, production API, batch worker, and agent runtime erases useful separation before the request reaches Vertex.
The custom role should contain the smallest reviewed permission set. Prediction usually needs aiplatform.endpoints.predict, with any additional permissions justified by the exact client and route. Basic roles are overly broad for this job. Google's access-control page warns that Owner, Editor, and Viewer include thousands of permissions across Google Cloud services.
The identity-aware AI gateway architecture describes where the workload identity meets enterprise caller context.
The prediction path must be server controlled
Google's prediction method REST reference defines POST https://{service-endpoint}/v1/{endpoint}:predict. For a deployed model, the endpoint path parameter uses projects/{project}/locations/{location}/endpoints/{endpoint}. The body includes required instances[], while parameters depends on the deployed model.
A gateway route should resolve an approved alias such as fraud-score-prod to the full service origin and endpoint resource. The client should never provide a raw Google host or endpoint path. Reject changes to project, location, endpoint ID, and credentials after policy evaluation.
The authenticated request blueprint is:
- Method:
POST - Origin: approved regional Vertex AI service endpoint
- Path:
/v1/projects/PROJECT/locations/LOCATION/endpoints/ENDPOINT:predict - Authentication: OAuth bearer token for the route's workload principal
- Media type:
application/json - Required body field:
instances[] - Trusted gateway fields: enterprise subject, agent ID, role, data class, route key, policy version
The Vertex token should be attached only after the gateway accepts the enterprise request. Client-supplied bearer tokens create a second authority path that can bypass route policy.
IAM scope and endpoint policy are separate controls
The access-control page distinguishes project-level and resource-level access. It also says individual resource policies are supported only for specific resource types, and its current supported-resources section lists Feature Store and Model Registry resources rather than Vertex endpoints. Treating an endpoint path as a documented IAM policy attachment point would claim a control Google does not list.
Bind the narrow custom role at the narrowest scope the current Google Cloud documentation and your account tooling support. For a standard Vertex endpoint design, assume project-level IAM authorizes the principal to use prediction resources covered by that grant. Then enforce the exact allowed endpoint resource in trusted gateway configuration. Verify the effective permission with an authenticated negative test instead of relying on a diagram label that says "endpoint IAM."
My blunt opinion is that a role named vertex-endpoint-prod proves nothing about endpoint scope. The policy scope and the runtime target allowlist are the evidence.
Google Cloud IAM can answer whether the workload principal may call prediction. Gateway policy should answer which endpoint this authenticated enterprise caller may select. The per-route AI policies guide explains that second decision.
Preserve the user or agent behind the service account
A service account often represents the application. The natural person or agent that initiated the request needs a separate trusted identity field. The application should authenticate its caller, normalize trusted claims, and pass a bounded identity context to the gateway. The gateway must discard client attempts to inject or replace those fields.
Useful context includes:
- Stable enterprise subject identifier
- Agent or workload delegation identifier
- Tenant and environment
- Approved role or group mapping
- Data classification
- Requested business operation
- Destination route alias
- Authentication event or token correlation reference
Keep the enterprise identity separate from the Google Cloud service account email. The first identifies who initiated the operation inside the enterprise. The second identifies the workload that called Vertex. A defensible audit record needs both identities.
On a white review screen, place the enterprise subject on the first line and the service account on the second. Show the complete endpoint resource beneath them in monospace text. If the screen has room for only one identity, the schema is too small.
Endpoint selection belongs in authorization policy
An endpoint ID is a security-relevant destination. Different endpoints can serve models trained on different datasets, expose separate cost profiles, or belong to distinct regulatory scopes. Route policy should bind the authenticated caller and operation to one or more approved endpoint resources.
Evaluate at least these fields before attaching the Vertex credential:
- Enterprise subject and mapped role
- Agent delegation context, when present
- Route alias and resolved endpoint resource
- Project and location
- Request data classification
- Requested operation
- Active policy version
Return a stable deny code for an unapproved endpoint override. Keep the full attempted resource in restricted evidence, but avoid reflecting internal project names to an untrusted client. A denied request should never reach the Vertex service endpoint.
The Vertex AI gateway patterns guide covers quota, region, and screening controls around this path. Principal binding gives those controls a caller and an accountable destination.
The audit record joins two authorization layers
For each prediction attempt, write one operation record that links enterprise authorization with Google Cloud execution evidence. Include the enterprise subject, agent context, workload principal, token audience or credential source, resolved endpoint, request digest, classification, policy version, local decision, Vertex status, and provider correlation fields available to the route.
Keep policy denial and provider permission denial distinct. A gateway denial means enterprise policy stopped the request before Vertex. A Vertex 403 means the request reached Google Cloud but the workload principal lacked effective access or another provider-side condition failed. That distinction shortens incident review.
The AI audit log schema provides a base event shape. Add an authorization_layers object or equivalent structured fields rather than squeezing both decisions into one allowed boolean.
Logs also need route integrity. Record the configured endpoint resource after alias resolution, then compare it with the resource actually called. A mismatch should create a high-priority event and stop retries until configuration ownership is clear.
Negative tests prove principal binding
Release tests should run with real workload identities in an approved test project. A static IAM policy review proves configuration intent. Authenticated positive and negative calls prove effective behavior.
Use an approved principal and approved endpoint as the baseline. Cover these additional fixtures:
- Approved principal with an unapproved endpoint override
- Principal missing
aiplatform.endpoints.predict - Token issued for the wrong audience or credential path
- Expired token
- Service account disabled after the route starts
- Endpoint alias changed without a policy-version update
- Valid workload principal paired with an unauthorized enterprise subject
- Authorized subject using a disallowed data class
- Direct Vertex route that bypasses the gateway
Assert that endpoint overrides and enterprise-policy denials produce zero Vertex calls. Confirm that provider permission failures stay distinguishable in logs. Rotate the workload credential or identity binding and rerun the matrix.
For the bypass case, use network and organization controls appropriate to the deployment. DeepInspect can enforce only traffic that is deliberately routed through its authenticated HTTP proxy. Cloud IAM, service perimeters, egress policy, and application credential custody remain necessary around the route.
DeepInspect
DeepInspect can enforce enterprise identity policy on authenticated user or agent HTTP traffic deliberately routed to a Vertex endpoint through its proxy. The application supplies trusted identity context. DeepInspect can bind that context to an approved endpoint resource, reject destination overrides before the Vertex credential is attached, and record the decision beside the Google Cloud workload principal.
Google Cloud IAM remains responsible for authorizing that workload principal to Vertex. The application creates and supplies trusted caller identity; DeepInspect evaluates it beside IAM's workload decision. Direct Vertex calls, local inference, STDIO traffic, stolen credentials, and any HTTP path that bypasses the proxy remain outside its enforcement boundary.
Book a technical deep dive at deepinspect.ai.
Frequently asked questions
- Which permission authorizes Vertex endpoint prediction?
Google documents
aiplatform.endpoints.predictfor calling an endpoint for predictions. Put it in a narrowly defined custom role with only the additional permissions required by the exact workload, then verify effective access with authenticated tests.- Does a Vertex service account identify the end user?
Usually it identifies the application or workload calling Google Cloud. Preserve the authenticated enterprise user or agent as separate trusted context and bind it to route policy before the service account credential is attached.
- Can IAM restrict a caller to one endpoint?
The current access-control page limits resource-level IAM policies to listed resource types, and its supported-resources section omits endpoints. Use the narrowest documented IAM scope available, then pin the exact endpoint resource in gateway policy and verify the result through negative tests.
- What should happen when Vertex returns permission denied?
Withhold the prediction result, classify the event as a provider authorization failure, and retain the workload principal plus resolved endpoint in the audit record. Avoid blind retries because an unchanged IAM denial requires policy or identity repair.