Skip to main content
When you own the application, integrate TrustGuard directly around your model calls. This gives you full control over what to inspect and how to enforce, and works with any model provider. Create an API key on the collector first. Prefer the official SDKs over hand-rolled HTTP — they take the base URL and call /v1/guard for you:
LanguagePackage
Node / TypeScript@neuraltrust/trustguard-sdk
Pythonneuraltrust-trustguard
Gogithub.com/NeuralTrust/trustguard-sdk/go
The response carries a status (allow / report / transform / block); the SDKs expose is_blocked / isBlocked (true when status == "block") and the transformed_payload for masked content.

Python SDK

  1. pip install neuraltrust-trustguard
  2. Call client.guard() with direction="input" (prompt) or direction="output" (completion).
  3. Pass consumer_id and session_id for attribution.
  4. Block when is_blocked is true; forward transformed_payload when present.

Node.js SDK

  1. npm install @neuraltrust/trustguard-sdk
  2. Call client.guard() with direction "input" / "output".
  3. Pass consumerId and sessionId.
  4. Block when isBlocked is true; forward transformedPayload when 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 attachments argument (folded into payload.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.