/v1/guard and
enforces the verdict for every model call with no application changes.
Every gateway integration starts the same way: create an API key on the collector’s
Auth tab, then wire the gateway to call the guard endpoint and block when
is_flagged is true.
TrustGate (recommended)
TrustGate is NeuralTrust’s own AI gateway and the first-class collector — findings appear as first-class spans in TrustGate traces, across LLM, MCP, and A2A traffic.- Create an API key on the collector’s Auth tab.
- Open your TrustGate gateway configuration.
- Enable the TrustGuard policy on the routes you want to protect and paste the API key into its settings.
- Send a test request — it appears in TrustGuard’s Activity page within seconds.
Portkey
Portkey calls TrustGuard through a Bring-Your-Own-Guardrails webhook check on requests and responses.- Create an API key (Auth tab).
- In Portkey, create a Guardrail with a Webhook check pointing at the guard endpoint.
- Add it to
input_guardrails/output_guardrailsin your Portkey Config withdeny: trueto enforce. - Portkey expects a
{ verdict }response — mapverdict = !is_flaggedwith a thin adapter if your plan doesn’t support response mapping. Map Portkey request metadata (user, trace id) toconsumer_idandsession_id.
LiteLLM
Add TrustGuard as a LiteLLM custom guardrail that calls the guard endpoint on every request.- Create an API key (Auth tab).
- Create
trustguard_guardrail.py: aCustomGuardrailsubclass that calls TrustGuard via the Python SDK (pip install neuraltrust-trustguard) and raises whenis_flaggedis true. Setconsumer_idfrom the LiteLLM user/key alias andsession_idfromlitellm_session_id. - Reference the class from your proxy
config.yaml. - Restart your LiteLLM proxy.
Kong
Use Kong’sai-custom-guardrail plugin (requires AI Proxy) to send prompts and
completions to the guard endpoint.
- Create an API key (Auth tab).
- Configure the AI Proxy (or AI Proxy Advanced) plugin on your route.
- Add the
ai-custom-guardrailplugin pointing at the guard endpoint. Includeconsumer_id(Kong’sX-Consumer-ID) andsession_idin the body template. - Apply the config — requests are blocked when TrustGuard returns
is_flagged: true.
Apigee
Call the guard endpoint from a Shared Flow and raise a fault when content is flagged.- Create an API key (Auth tab).
- Create a Shared Flow with an AssignMessage policy that builds the request body
(
{ protocol, direction, input, consumer_id, session_id }) — use the client_id / developer app asconsumer_id. - Add a ServiceCallout policy that POSTs it to the guard endpoint with the
Authorization: Bearerheader. - Add a RaiseFault policy (403) conditioned on
is_flagged = true. - Attach the Shared Flow to your proxies with a FlowCallout.
Azure APIM
Call the guard endpoint with asend-request policy and block flagged requests before
they reach your backend.
- Create an API key (Auth tab).
- Open your API in the Azure portal.
- Add a
send-requestpolicy in the inbound section posting the prompt to the guard endpoint. - Return 403 when the response has
is_flagged: true; repeat in outbound for completions.