const body = {
prioritized_rulesets: [
{
rules: [
{
metric: "pii",
operator: "contains",
target_value: "ssn",
},
],
action: {
type: "OVERRIDE",
choices: ["Sorry, I cannot answer that question."],
},
},
],
payload: {
output: "here is my SSN 123-45-6789",
},
project_name: "<string>",
stage_name: "<string>",
};
const options = {
method: "POST",
headers: {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
};
fetch("https://api.your.galileo.cluster.com/v1/protect/invoke", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));