Skip to content

Reference

API: Guardrails

Markdown version

MethodPathWhat it doesScope
GET/v1/guardrails/:scope/:idThe guardrails set on the organization, a workspace or a key (requests follow all three: the strictest wins)gateway:read
PUT/v1/guardrails/:scope/:idSet guardrails: model and provider allow/deny lists, data policy, EU-only, sensitive info and prompt injection. Agents may only tighten them.gateway:write
GET/v1/guardrails/effective/:keyIdWhat a key's requests actually follow: its organization's, workspace's and own guardrails mergedgateway:read

Examples

GET /v1/guardrails/$SCOPE/$ID

The guardrails set on the organization, a workspace or a key (requests follow all three: the strictest wins)

curl -s "https://manage.restolayer.com/v1/guardrails/$SCOPE/$ID" \
  -H "Authorization: Bearer $LG_API_KEY"
const res = await fetch(`https://manage.restolayer.com/v1/guardrails/${scope}/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();

PUT /v1/guardrails/$SCOPE/$ID

Set guardrails: model and provider allow/deny lists, data policy, EU-only, sensitive info and prompt injection. Agents may only tighten them.

curl -s -X PUT "https://manage.restolayer.com/v1/guardrails/$SCOPE/$ID" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://manage.restolayer.com/v1/guardrails/${scope}/${id}`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/guardrails/effective/$KEY_ID

What a key's requests actually follow: its organization's, workspace's and own guardrails merged

curl -s "https://manage.restolayer.com/v1/guardrails/effective/$KEY_ID" \
  -H "Authorization: Bearer $LG_API_KEY"
const res = await fetch(`https://manage.restolayer.com/v1/guardrails/effective/${keyId}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();

Request and response schemas: https://www.restolayer.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.