Skip to main content
POST /v1/evaluate is the standard runtime endpoint for TrustGuard collectors. A collector calls it to evaluate one request against its assigned policy. See How it works for policy actions and collector coverage. Claude Enterprise uses the specialized endpoint documented in its integration guide.

Base URL

Every path on this page is relative to your deployment’s TrustGuard base URL, written {TRUSTGUARD_BASE_URL} throughout these guides:
The authoritative value is in the console: open the collector and read the Connection tab, which renders the setup snippet with your base URL already substituted.
Use the public TrustGuard origin, not an in-cluster service address. Self-hosted deployments run TrustGuard behind an internal admin address that is not reachable from gateways, SDKs, or edge workers, and is not the value to put in a collector snippet. If the console shows a placeholder instead of a URL, it could not resolve a customer-facing host — ask your operator for the data-plane endpoint rather than guessing.
If you are the operator, note that the deployment environment variable named TRUSTGUARD_URL is the internal admin address, and is deliberately not what {TRUSTGUARD_BASE_URL} means in these guides. The customer-facing origin comes from TRUSTGUARD_PUBLIC_URL on SaaS, or from the guard data-plane endpoint you expose for a hybrid deployment. Putting TRUSTGUARD_URL into a collector snippet is a common misconfiguration — the request simply never arrives.

Authentication

The collector is resolved from the API key, so you do not send a collector ID in the body. (When TrustGuard runs behind TrustGate, the gateway authenticates and calls this endpoint for you.)

Request

Unknown top‑level fields are rejected with 400 (strict decoding). Do not send input, metadata, collector_id, or detector_id at the top level.
direction chooses which policy Detectors phase runs (Input vs Output). If you only ever send input (or omit the field), Output-phase rules never evaluate. Details and SDK examples: Python SDK.
Callers that authenticate with a service token instead of an API key must also send exactly one of gateway_id or collector_key to select the collector. With a collector API key (the common case, and the focus of this page) the collector comes from the key.

Attachments and SSRF

Each attachment in payload.attachments provides either base64 data or a url:
  • URL fetches use HTTPS and enforce timeout, size, and redirect limits.
  • A strict SSRF guard resolves DNS before dialing and rejects loopback, private, link‑local, multicast, CGNAT (100.64/10), 0.0.0.0/8, and cloud‑metadata (169.254.169.254) targets.
  • Attachment bytes are not persisted.

Evaluation pipeline

Each numbered step below is one box in that diagram.

1. Authenticate and resolve the collector

TrustGuard verifies the API key, checks that it is active and not expired, and resolves its collector. A missing or invalid key returns 401; an inactive or expired key returns 403. Authentication failures are rejected before any evaluation runs.

2. Resolve the policy

TrustGuard uses the request’s consumer_id to look for a per-consumer policy. If none matches, it uses the collector’s default policy. If the collector has no matching policy, the request is unguarded: TrustGuard returns status: "allow" with no findings. The policy’s enforcement mode also applies to this evaluation. In Observe, actions are recorded without enforcement.

3. Run gates

Gates run before detectors. Each gate matches request attributes, such as consumer, model, collector, protocol, direction, tool, session, or source, and takes an action: Block, Skip, and Ask end the gate chain. Report continues. In Observe mode, Block and Ask verdicts are downgraded to a non-blocking record.

4. Run the detector rules

TrustGuard filters detector rules by the request’s direction and each rule’s optional conditions. These are the same Input and Output phases configured on the policy. Each rule’s Monitor (report), Block, or Transform action sets outcome.action on its findings. A Block rule also stops the remaining detector chain. File attachments are decoded once and shared with detectors that consume them, currently doc_analyzer. The url_analyzer detector finds URLs in the body or messages, not in attachments. Remote attachment URLs are fetched server-side under the SSRF protections described above.

5. Reduce to a status

TrustGuard reduces the findings to one top-level status, from most to least restrictive:
In Observe, Block, Ask, and Transform actions are downgraded, so the status never exceeds report.

Response

A successful evaluation returns 200, including one whose status is block.

The finding object

Status codes

Error responses carry { "error", "trace_id", "request_id" }.

Limits and quotas

Rate limiting

Exceeding either limit returns 429 with standard headers, so a client can back off without parsing the body:
Honour Retry-After rather than retrying immediately. X-RateLimit-Reason distinguishes a short burst from an exhausted monthly quota — the first clears on its own, the second needs a plan change. Your plan’s numbers are in the console; they are not fixed across plans, so treat the headers as the source of truth at runtime.
Per-request latency depends on which detectors a policy runs and on your deployment. There are no published latency figures yet — measure against your own policy before you set a client timeout, and see Failure behavior for what happens when TrustGuard is slow or unavailable.

Failure behavior

Detector infrastructure errors, such as an upstream outage or timeout, follow the deployment’s fail-open or fail-closed setting:
  • Fail-open: TrustGuard drops the failed detector’s result and evaluation continues.
  • Fail-closed: TrustGuard returns 500, so the caller can decide whether to hold traffic.
A structured Block decision from a gate or detector rule still applies regardless of this setting. The default is configured per deployment; confirm it with your NeuralTrust administrator or support contact.

Enforcing the verdict

TrustGuard is advisory. Your collector inspects the status and decides:
When TrustGuard runs behind TrustGate, the gateway performs this enforcement for you.