Skip to main content
POST
Create Guard Rail Rules

Body

application/json

The request body resource

name
string
required

Unique name for the rule

Example:

"my-strict-rule"

attributes
string[]

Attributes associated with this guardrail rule

Example:
connection_ids
string[]

List of connection IDs that this guardrail applies to

Example:
description
string

The rule description

Example:

"description about this rule"

input
object

The input rule. Each rule entry accepts an optional "message" field that is shown to the user when that specific rule is hit.

output
object

The output rule. Each rule entry accepts an optional "message" field that is shown to the user when that specific rule is hit.

sidecar_spec
object

SidecarSpec is this rule in the SIDECAR's own vocabulary, which the gateway's fields above do not share: seven rule types, an operations scope on every one of them, and action: defer to hand the verdict to a Rego policy. It holds the guardrails block the listener receives: {"rules": [...]}.

A control plane field. A gateway has no sidecars and refuses it.

sidecar_targets
object[]

SidecarTargets names the sidecar LISTENERS that must enforce this rule, which is how a control plane distributes it to a fleet. A listener, not a sidecar: the listener carries the protocol, and the protocol decides which rule types it can run at all.

A POINTER because absent and empty are different instructions: absent leaves the bindings exactly as they are, and [] unbinds the rule from every sidecar. Without that distinction any write that did not mention the field -- a script fixing a typo, the gateway's own UI, an MCP call -- would silently unbind a rule from the whole fleet.

Response

Created

attributes
string[]

Attributes associated with this guardrail rule

Example:
connection_ids
string[]

List of connection IDs that this guardrail applies to

Example:
created_at
string
read-only

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

description
string

The rule description

Example:

"description about this rule"

id
string<uuid>
read-only

The resource identifier

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

input
object

The input rule. Each rule entry accepts an optional "message" field that is shown to the user when that specific rule is hit.

managed_by
string
read-only

Set to "hoop" when the rule is materialized and lifecycle-managed by a protection profile; managed rules are read-only through this API

Example:

"hoop"

name
string

Unique name for the rule

Example:

"my-strict-rule"

output
object

The output rule. Each rule entry accepts an optional "message" field that is shown to the user when that specific rule is hit.

sidecar_spec
object

SidecarSpec is this rule in the sidecar's own vocabulary; see the request type. Present only in a control plane.

sidecar_targets
object[]

The sidecar listeners this rule is bound to, and therefore distributed to

updated_at
string
read-only

The time the resource was updated

Example:

"2024-07-25T15:56:35.317601Z"