plugins:
- name: ai-custom-guardrail
config:
guarding_mode: BOTH
text_source: concatenate_all_content
params:
api_key: "<collector-api-key>"
request:
url: {TRUSTGUARD_URL}/v1/evaluate
headers:
Authorization: Bearer $(conf.params.api_key)
body:
protocol: llm
direction: input
payload:
input: "$(content)"
response:
block: "$(check_response.block)"
block_message: "$(check_response.block_message)"
functions:
check_response: |
return function(resp)
-- Transform body rewrite needs a downstream plugin; this mapping only
-- supports block / block_message.
return {
block = resp.status == "block",
block_message = "Blocked by TrustGuard"
}
end