PATCH/v1/guardrails/{guardrail_id}

Update a guardrail

Send only the fields to change. rules replaces the whole list, so send every rule you want to keep. Changing timing without sending max_wait_ms resets it to that timing's default. The change applies to new requests within a minute. A platform guardrail answers 403 guardrail_read_only.

Authentication: Bearer API key in the Authorization header

Path parameters

  • guardrail_idstringrequired

    The guardrail id.

Request body

  • namestring

    A name for people.

  • modeenum

    observe counts matches and never blocks, delays or fails a request. enforce blocks matching requests. off stops checking.

    "observe""enforce""off"
  • timingenum

    parallel checks while the model generates and holds the response until the check passes. before_dispatch finishes the check before the request is sent to a model.

    "parallel""before_dispatch"
  • rulesarray<object>

    The guardrail matches when any rule matches.

    rules
    • tagstringrequired

      A tag id from GET /v1/tags.

    • thresholdnumber

      The rule matches when the tag's probability for any message in the request is at or above this value.

      Default: 0.5
  • modelsarray | null

    The only model slugs the guardrail covers, compared with the model that serves the request. null does not limit it.

  • exclude_modelsarray | null

    Model slugs the guardrail leaves out, so it covers every other model. null leaves none out. Set models or exclude_models, not both.

  • identity_idsarray | null

    The only identities the guardrail covers. null covers every identity. A request is covered when both its model and its identity are.

  • max_wait_msinteger

    The longest a request waits for the check, in milliseconds: 0 to 5,000 for parallel, 100 to 5,000 for before_dispatch.

  • on_errorenum

    What happens when the check does not finish in time, or the request carries content it cannot read. allow lets the request through. block refuses it: 503 gateway_unavailable when the check did not finish, 400 content_filter for content it cannot read.

    "allow""block"

Responses

  • 200

    The updated guardrail.

    Response
    • idstringrequired
    • namestringrequired

      A name for people.

    • managedbooleanrequired

      true on a platform guardrail, which is read-only and shows only its name, tags and models.

    • modeenum

      observe counts matches and never blocks, delays or fails a request. enforce blocks matching requests. off stops checking.

      "observe""enforce""off"
    • timingenum

      parallel checks while the model generates and holds the response until the check passes. before_dispatch finishes the check before the request is sent to a model.

      "parallel""before_dispatch"
    • rulesarray<object>required

      The guardrail matches when any rule matches.

      rules
      • tagstringrequired

        A tag id from GET /v1/tags.

      • thresholdnumber

        The rule matches when the tag's probability for any message in the request is at or above this value.

        Default: 0.5
    • modelsarray | nullrequired

      The only model slugs the guardrail covers, compared with the model that serves the request. null does not limit it.

    • exclude_modelsarray | null

      Model slugs the guardrail leaves out, so it covers every other model. null leaves none out. Set models or exclude_models, not both.

    • identity_idsarray | null

      The only identities the guardrail covers. null covers every identity. A request is covered when both its model and its identity are.

    • max_wait_msinteger

      The longest a request waits for the check, in milliseconds.

    • on_errorenum

      What happens when the check does not finish in time, or the request carries content it cannot read. allow lets the request through. block refuses it: 503 gateway_unavailable when the check did not finish, 400 content_filter for content it cannot read.

      "allow""block"
    • created_atstring
    • updated_atstring
  • 401

    Missing, unknown or revoked API key.

  • 403

    The key is not a provisioning key, or the resource is read-only (tag_read_only, guardrail_read_only).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

  • 404

    The resource does not exist or belongs to another organization. An organization without access gets this answer on every route.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

  • 422

    The body failed validation, or it names something that does not exist or cannot be used (unknown_tag, unknown_model, unknown_identity, model_not_allowed).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

Request

curl -X PATCH 'https://api.experientiallabs.ai/v1/guardrails/00000000-0000-4000-8000-000000000011' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "enforce"
}'

Response

{
  "id": "00000000-0000-4000-8000-000000000011",
  "name": "Keep confidential data off external models",
  "managed": false,
  "mode": "enforce",
  "timing": "before_dispatch",
  "rules": [
    {
      "tag": "internalConfidential",
      "threshold": 0.5
    }
  ],
  "models": null,
  "exclude_models": [
    "my-local-model"
  ],
  "identity_ids": null,
  "max_wait_ms": 2000,
  "on_error": "block",
  "created_at": "2026-11-20T00:00:00Z",
  "updated_at": "2026-11-21T00:00:00Z"
}

https://api.experientiallabs.ai/v1/guardrails/00000000-0000-4000-8000-000000000011