/v1/guard for you:
| Language | Package |
|---|---|
| Node / TypeScript | @neuraltrust/trustguard-sdk |
| Python | neuraltrust-trustguard |
| Go | github.com/NeuralTrust/trustguard-sdk/go |
status (allow / report / transform / block); the SDKs
expose is_blocked / isBlocked (true when status == "block") and the
transformed_payload for masked content.
Python SDK
pip install neuraltrust-trustguard- Call
client.guard()withdirection="input"(prompt) ordirection="output"(completion). - Pass
consumer_idandsession_idfor attribution. - Block when
is_blockedis true; forwardtransformed_payloadwhen present.
Node.js SDK
npm install @neuraltrust/trustguard-sdk- Call
client.guard()withdirection"input"/"output". - Pass
consumerIdandsessionId. - Block when
isBlockedis true; forwardtransformedPayloadwhen 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 via the
attachmentsargument (folded intopayload.attachments) to engage the document and URL analyzers — see the Guard API for the attachment + SSRF rules. - On a detector infrastructure error TrustGuard follows your deployment’s fail-open / fail-closed setting — decide whether to hold traffic on errors accordingly.