projects

POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/guardrails

Changed on

Creates a new guardrail in the given app.

Request

  • Base URL
    https://ces.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/ces
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/ces
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform

Path parameters

projectsId, string required
locationsId, string required
appsId, string required

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

guardrailId, string

Optional. The ID to use for the guardrail, which will become the final component of the guardrail's resource name. If not provided, a unique ID will be automatically assigned for the guardrail.

Request body

Guardrail required

Guardrail contains a list of checks and balances to keep the agents safe and secure.

action, TriggerAction

Action that is taken when a certain precondition is met.

codeCallback, GuardrailCodeCallback

Guardrail that blocks the conversation based on the code callbacks provided.

contentFilter, GuardrailContentFilter

Guardrail that bans certain content from being used in the conversation.

createTime, string google-datetime

Output only. Timestamp when the guardrail was created.

description, string

Optional. Description of the guardrail.

displayName, string

Required. Display name of the guardrail.

enabled, boolean

Optional. Whether the guardrail is enabled.

etag, string

Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.

llmPolicy, GuardrailLlmPolicy

Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.

llmPromptSecurity, GuardrailLlmPromptSecurity

Guardrail that blocks the conversation if the input is considered unsafe based on the LLM classification.

modelSafety, GuardrailModelSafety

Model safety settings overrides. When this is set, it will override the default settings and trigger the guardrail if the response is considered unsafe.

name, string

Identifier. The unique identifier of the guardrail. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

supervisor, GuardrailSupervisor

Guardrail that runs supervisor intervention.

updateTime, string google-datetime

Output only. Timestamp when the guardrail was last updated.

Response

Successful response

Guardrail required

Guardrail contains a list of checks and balances to keep the agents safe and secure.

action, TriggerAction

Action that is taken when a certain precondition is met.

codeCallback, GuardrailCodeCallback

Guardrail that blocks the conversation based on the code callbacks provided.

contentFilter, GuardrailContentFilter

Guardrail that bans certain content from being used in the conversation.

createTime, string google-datetime

Output only. Timestamp when the guardrail was created.

description, string

Optional. Description of the guardrail.

displayName, string

Required. Display name of the guardrail.

enabled, boolean

Optional. Whether the guardrail is enabled.

etag, string

Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.

llmPolicy, GuardrailLlmPolicy

Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.

llmPromptSecurity, GuardrailLlmPromptSecurity

Guardrail that blocks the conversation if the input is considered unsafe based on the LLM classification.

modelSafety, GuardrailModelSafety

Model safety settings overrides. When this is set, it will override the default settings and trigger the guardrail if the response is considered unsafe.

name, string

Identifier. The unique identifier of the guardrail. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

supervisor, GuardrailSupervisor

Guardrail that runs supervisor intervention.

updateTime, string google-datetime

Output only. Timestamp when the guardrail was last updated.

Changes

    • info

      the security scope https://www.googleapis.com/auth/ces was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/ces was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2

    1 more change in this revision