from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.guardrails.update_cluster_default_guardrails(enabled=True, guardrails=[
{
"mode": "prompt_injection",
"enabled": True,
"config": {
"threshold": 0.7,
},
},
{
"mode": "leakage",
"enabled": True,
"config": {
"threshold": 0.7,
},
},
{
"mode": "classifier",
"enabled": True,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy.",
},
},
])
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.guardrails.updateClusterDefaultGuardrails({
enabled: true,
guardrails: [
{
mode: "prompt_injection",
enabled: true,
config: {
threshold: 0.7,
},
},
{
mode: "leakage",
enabled: true,
config: {
threshold: 0.7,
},
},
{
mode: "classifier",
enabled: true,
config: {
model: "meetkai:custom-classifier",
prompt: "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
onError: "fail_closed",
rejectionMessage: "This request is not allowed by your organization's content policy.",
},
},
],
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
UpdateClusterDefaultGuardrailsRequest req = new UpdateClusterDefaultGuardrailsRequest() {
Enabled = true,
Guardrails = new List<GuardrailConfig>() {
GuardrailConfig.CreatePromptInjection(
new PromptInjectionGuardrail() {
Config = new PromptInjectionConfig() {},
}
),
GuardrailConfig.CreateLeakage(
new LeakageGuardrail() {
Config = new LeakageConfig() {},
}
),
GuardrailConfig.CreateClassifier(
new ClassifierGuardrail() {
Config = new ClassifierConfig() {
Model = "meetkai:custom-classifier",
Prompt = "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
},
}
),
},
};
var res = await sdk.Guardrails.UpdateClusterDefaultGuardrailsAsync(req);
// handle responsecurl --request PUT \
--url https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"enabled": true,
"guardrails": [
{
"mode": "prompt_injection",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "leakage",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "classifier",
"enabled": true,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy."
}
}
]
}
EOFconst options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
guardrails: [
{mode: 'prompt_injection', enabled: true, config: {threshold: 0.7}},
{mode: 'leakage', enabled: true, config: {threshold: 0.7}},
{
mode: 'classifier',
enabled: true,
config: {
model: 'meetkai:custom-classifier',
prompt: 'Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.',
on_error: 'fail_closed',
rejection_message: 'This request is not allowed by your organization\'s content policy.'
}
}
]
})
};
fetch('https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default', 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://apigw.mka1.com/api/v1/llm/guardrails/cluster-default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'guardrails' => [
[
'mode' => 'prompt_injection',
'enabled' => true,
'config' => [
'threshold' => 0.7
]
],
[
'mode' => 'leakage',
'enabled' => true,
'config' => [
'threshold' => 0.7
]
],
[
'mode' => 'classifier',
'enabled' => true,
'config' => [
'model' => 'meetkai:custom-classifier',
'prompt' => 'Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.',
'on_error' => 'fail_closed',
'rejection_message' => 'This request is not allowed by your organization\'s content policy.'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default"
payload := strings.NewReader("{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "guardrails_cluster_default",
"enabled": true,
"guardrails": [
{
"mode": "prompt_injection",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "leakage",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "classifier",
"enabled": true,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy."
}
}
],
"built_in": false,
"settings_unreadable": false,
"updated_by": "user-cluster-admin-1",
"updated_at": "2026-10-16T12:00:00.000Z"
}Update the cluster default guardrails
Replace the default guardrails enforced on every enrolled organization, and switch them on or off for the whole cluster. Organization admins can add rules on top of the cluster default but cannot weaken or remove it. Classifier models must be active in the cluster organization’s registry; their calls run and are metered as the cluster organization, so tenants need no access to the model and their budgets are not charged.
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.guardrails.update_cluster_default_guardrails(enabled=True, guardrails=[
{
"mode": "prompt_injection",
"enabled": True,
"config": {
"threshold": 0.7,
},
},
{
"mode": "leakage",
"enabled": True,
"config": {
"threshold": 0.7,
},
},
{
"mode": "classifier",
"enabled": True,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy.",
},
},
])
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.guardrails.updateClusterDefaultGuardrails({
enabled: true,
guardrails: [
{
mode: "prompt_injection",
enabled: true,
config: {
threshold: 0.7,
},
},
{
mode: "leakage",
enabled: true,
config: {
threshold: 0.7,
},
},
{
mode: "classifier",
enabled: true,
config: {
model: "meetkai:custom-classifier",
prompt: "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
onError: "fail_closed",
rejectionMessage: "This request is not allowed by your organization's content policy.",
},
},
],
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
UpdateClusterDefaultGuardrailsRequest req = new UpdateClusterDefaultGuardrailsRequest() {
Enabled = true,
Guardrails = new List<GuardrailConfig>() {
GuardrailConfig.CreatePromptInjection(
new PromptInjectionGuardrail() {
Config = new PromptInjectionConfig() {},
}
),
GuardrailConfig.CreateLeakage(
new LeakageGuardrail() {
Config = new LeakageConfig() {},
}
),
GuardrailConfig.CreateClassifier(
new ClassifierGuardrail() {
Config = new ClassifierConfig() {
Model = "meetkai:custom-classifier",
Prompt = "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
},
}
),
},
};
var res = await sdk.Guardrails.UpdateClusterDefaultGuardrailsAsync(req);
// handle responsecurl --request PUT \
--url https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"enabled": true,
"guardrails": [
{
"mode": "prompt_injection",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "leakage",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "classifier",
"enabled": true,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy."
}
}
]
}
EOFconst options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
guardrails: [
{mode: 'prompt_injection', enabled: true, config: {threshold: 0.7}},
{mode: 'leakage', enabled: true, config: {threshold: 0.7}},
{
mode: 'classifier',
enabled: true,
config: {
model: 'meetkai:custom-classifier',
prompt: 'Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.',
on_error: 'fail_closed',
rejection_message: 'This request is not allowed by your organization\'s content policy.'
}
}
]
})
};
fetch('https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default', 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://apigw.mka1.com/api/v1/llm/guardrails/cluster-default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'guardrails' => [
[
'mode' => 'prompt_injection',
'enabled' => true,
'config' => [
'threshold' => 0.7
]
],
[
'mode' => 'leakage',
'enabled' => true,
'config' => [
'threshold' => 0.7
]
],
[
'mode' => 'classifier',
'enabled' => true,
'config' => [
'model' => 'meetkai:custom-classifier',
'prompt' => 'Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.',
'on_error' => 'fail_closed',
'rejection_message' => 'This request is not allowed by your organization\'s content policy.'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default"
payload := strings.NewReader("{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/guardrails/cluster-default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"guardrails\": [\n {\n \"mode\": \"prompt_injection\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"leakage\",\n \"enabled\": true,\n \"config\": {\n \"threshold\": 0.7\n }\n },\n {\n \"mode\": \"classifier\",\n \"enabled\": true,\n \"config\": {\n \"model\": \"meetkai:custom-classifier\",\n \"prompt\": \"Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.\",\n \"on_error\": \"fail_closed\",\n \"rejection_message\": \"This request is not allowed by your organization's content policy.\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "guardrails_cluster_default",
"enabled": true,
"guardrails": [
{
"mode": "prompt_injection",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "leakage",
"enabled": true,
"config": {
"threshold": 0.7
}
},
{
"mode": "classifier",
"enabled": true,
"config": {
"model": "meetkai:custom-classifier",
"prompt": "Block content that expresses hate toward people based on a protected characteristic, threatens or glorifies violence, is sexually explicit or sexualizes minors, or encourages or instructs self-harm. Allow neutral educational, news, medical and support discussion of these topics.",
"on_error": "fail_closed",
"rejection_message": "This request is not allowed by your organization's content policy."
}
}
],
"built_in": false,
"settings_unreadable": false,
"updated_by": "user-cluster-admin-1",
"updated_at": "2026-10-16T12:00:00.000Z"
}Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Body
Cluster switch. When false, the cluster default applies to no organization.
Guardrails enforced on every enrolled organization. Classifier models are resolved in the cluster organization's registry and metered to it.
Banned words guardrail
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Response
OK
Cluster switch. When false, the cluster default applies to no organization.
Guardrails enforced on every enrolled organization
Banned words guardrail
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
True while the cluster runs the built-in default (prompt injection and leakage detection) because no operator has saved one
True when the saved cluster default cannot be read: the built-in rules shown here are enforced in its place. Save a policy to replace it; do not save these rules back unless that is intended
User who last changed the cluster default; null while the built-in default applies
When the cluster default was last changed; null while the built-in default applies
Was this page helpful?