/v1/guard for you:
| Language | Package |
|---|---|
| Node / TypeScript | @neuraltrust/trustguard-sdk |
| Python | neuraltrust-trustguard |
| Go | github.com/NeuralTrust/trustguard-sdk/go |
Python SDK
pip install neuraltrust-trustguard- Call
client.guard()withdirection="input"(prompt) ordirection="output"(completion). - Pass
consumer_idandsession_idfor attribution. - Block when
is_flaggedis true; usetransformed_payloadwhen present (redaction).
Node.js SDK
npm install @neuraltrust/trustguard-sdk- Call
client.guard()withdirection"input"/"output". - Pass
consumerIdandsessionId. - Block when
isFlaggedis true; usetransformedPayloadwhen present.
REST API
Any language can call the guard endpoint directly (Go users: use the Go SDK instead of hand-rolling).Python middleware (FastAPI / Django / Flask)
Guard inbound user traffic in-process with a middleware in front of your AI routes.Node.js middleware (Express / Next.js)
Tips
- Inspect both sides:
direction:"input"before the model call,direction:"output"on the completion. - Send documents/links as
input.attachmentsto engage the document and URL analyzers — see the Guard API for the attachment + SSRF rules. - TrustGuard is fail-open by default, so an outage won’t break your app — you decide whether to hold traffic on errors.