Get all Guardrails
curl --request GET \
--url https://api.trugen.ai/v1/ext/guardrail \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/guardrail"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trugen.ai/v1/ext/guardrail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trugen.ai/v1/ext/guardrail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/guardrail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/guardrail")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/guardrail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"key": "hate_speech_filter",
"name": "Hate Speech Filter",
"category": "Content Safety",
"prompt": "Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group.",
"response_message": "I'm sorry, but I can't help with that. Let's keep things respectful.",
"callback_url": "https://yourapp.com/webhooks/guardrail",
"created_at": "2026-08-14T11:38:46.479224Z",
"updated_at": "2026-08-14T11:38:46.479224Z"
}
]Guardrails
List All Guardrails
Fetches all guardrails in your workspace. Requires x-api-key authentication.
GET
/
ext
/
guardrail
Get all Guardrails
curl --request GET \
--url https://api.trugen.ai/v1/ext/guardrail \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/guardrail"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trugen.ai/v1/ext/guardrail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trugen.ai/v1/ext/guardrail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/guardrail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/guardrail")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/guardrail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"key": "hate_speech_filter",
"name": "Hate Speech Filter",
"category": "Content Safety",
"prompt": "Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group.",
"response_message": "I'm sorry, but I can't help with that. Let's keep things respectful.",
"callback_url": "https://yourapp.com/webhooks/guardrail",
"created_at": "2026-08-14T11:38:46.479224Z",
"updated_at": "2026-08-14T11:38:46.479224Z"
}
]Authorizations
Response
A list of guardrails
Example:
"dfbaa3c6-1e90-43df-869a-b023896a198c"
Permanent slug derived from name at creation time. Never regenerated, even if name changes later. This is the identifier the running agent uses as the tool name.
Example:
"hate_speech_filter"
Example:
"Hate Speech Filter"
Example:
"Content Safety"
Example:
"Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group."
Example:
"I'm sorry, but I can't help with that. Let's keep things respectful."
Example:
"https://yourapp.com/webhooks/guardrail"
Example:
"2026-08-14T11:38:46.479224Z"
Example:
"2026-08-14T11:38:46.479224Z"
Was this page helpful?