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"
}Actualizar las reglas de protección predeterminadas del clúster
Reemplace las directrices predeterminadas aplicadas a cada organización inscrita y actívelas o desactívelas para todo el clúster. Los administradores de la organización pueden añadir reglas encima del valor predeterminado del clúster, pero no pueden debilitarlo ni eliminarlo. Los modelos clasificadores deben estar activos en el registro de la organización del clúster; sus llamadas se ejecutan y se facturan como la organización del clúster, por lo que los inquilinos no necesitan acceso al modelo y sus presupuestos no se cargan.
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"
}Autorizaciones
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>.
Cuerpo
Interruptor de clúster. Cuando es falso, el valor predeterminado del clúster se aplica a ninguna organización.
Guardrails aplicados en cada organización inscrita. Los modelos clasificadores se resuelven en el registro de la organización del clúster y se facturan a ella.
Guardrails de palabras prohibidas
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Respuesta
Está bien
Interruptor de clúster. Cuando es falso, el valor predeterminado del clúster se aplica a ninguna organización.
Guardrails aplicados en cada organización inscrita
Guardrails de palabras prohibidas
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Verdadero mientras el clúster ejecuta el valor predeterminado integrado (detección de inyección de prompts y de filtración) porque ningún operador ha guardado uno
Verdadero cuando no se puede leer el valor predeterminado del clúster guardado: se aplican en su lugar las reglas integradas que se muestran aquí. Guarde una política para reemplazarlo; no vuelva a guardar estas reglas a menos que eso sea lo que desea.
Usuario que realizó el último cambio del valor predeterminado del clúster; nulo mientras se aplique el valor predeterminado integrado
Cuándo se cambió por última vez el valor predeterminado del clúster; nulo mientras se aplica el valor predeterminado integrado
¿Esta página le ayudó?