---
title: "PATCH /v1/projects/{projectsId}/locations/{locationsId}/semanticGovernancePolicies/{semanticGovernancePoliciesId}"
method: PATCH
path: "/v1/projects/{projectsId}/locations/{locationsId}/semanticGovernancePolicies/{semanticGovernancePoliciesId}"
tags: ["projects"]
---

# PATCH /v1/projects/{projectsId}/locations/{locationsId}/semanticGovernancePolicies/{semanticGovernancePoliciesId}

`PATCH /v1/projects/{projectsId}/locations/{locationsId}/semanticGovernancePolicies/{semanticGovernancePoliciesId}`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/semanticGovernancePolicies/{semanticGovernancePoliciesId}`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Updates a SemanticGovernancePolicy.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `semanticGovernancePoliciesId` string, required

## Query parameters

- `updateMask` string, google-fieldmask

## Request body

- GoogleCloudAiplatformV1SemanticGovernancePolicy: Represents a governance policy applied to a specific Agent and optionally a specific Tool within that Agent.
  - `agent` string: Required. The name of the agent in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/agents/{agent}`
  - `agentIdentity` string: Output only. Represents the principal of the agent, used by the Policy Decision Point (PDP) for governance checks. For more information, see https://docs.cloud.google.com/agent-builder/agent-engine/agent-identity Format: `principal://TRUST_DOMAIN/NAMESPACE/AGENT_NAME` Example: `principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/AGENT_ENGINE_ID`
  - `agentResponseCustomization` GoogleCloudAiplatformV1AgentResponseCustomization: Customizes the agent's response to the end user when a `SemanticGovernancePolicy` is evaluated (for example, with a custom message shown on denial).
    - `denialMessage` string: Optional. Custom message shown to the end user when the policy check results in a denial. Use this to explain the rationale to the user. Max 1000 characters.
  - `createTime` string, google-datetime: Output only. Timestamp when this SemanticGovernancePolicy was created.
  - `description` string: Optional. The description of the SemanticGovernancePolicy.
  - `displayName` string: Optional. The user-defined name of the SemanticGovernancePolicy.
  - `dryRun` boolean: Optional. If true, this policy is evaluated and its result is reported, but the policy is not enforced: a violation does not block the agent's action. Use this to validate a policy against real traffic before turning enforcement on. Defaults to `false`, meaning the policy is enforced. This setting applies only to this policy. If the SemanticGovernancePolicyEngine for the project is itself in dry run, every policy behaves as dry run regardless of this field.
  - `etag` string: Optional. Used to perform consistent read-modify-write transactions. If provided, the request will only succeed if the etag matches the current value. Otherwise, an ABORTED error will be returned.
  - `mcpTools` GoogleCloudAiplatformV1SemanticGovernancePolicyMcpTool[]: Optional. The McpTools that are affected by this policy.
    - `mcpServer` string: Required. The resource name of the McpServer in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`
    - `tools` string[]: Required. The resource names of the tools used by the Agent that is affected by this policy. Currently, exactly one tool must be specified.
  - `name` string: Identifier. Resource name of the SemanticGovernancePolicy.
  - `naturalLanguageConstraint` string: Required. The natural language constraint of the SemanticGovernancePolicy.
  - `updateTime` string, google-datetime: Output only. Timestamp when this SemanticGovernancePolicy was last updated.

## Response `200`

Successful response

- GoogleLongrunningOperation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` GoogleRpcStatus: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

[API](https://skmtc.dev/google/apis/aiplatform.md) - [All operations](https://skmtc.dev/google/apis/aiplatform/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/aiplatform/revisions/3aca3b348f0c?raw)
