POST /v1/evaluate is the runtime endpoint for TrustGuard collectors.
A collector sends one request against
its assigned policy.
How it works covers which actions each host can apply.
The Inference Hooks collector uses the specialized endpoint 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.
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
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 platform token or a guard token instead
of an API key must also send gateway_id 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 inpayload.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. - Fetched URL content is not retained, and decoded attachment content is discarded once the detectors that consume it have run.
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 returns401; an inactive or
expired key returns 403. Authentication failures are rejected before any
evaluation runs.
2. Resolve the policy
TrustGuard uses the request’sconsumer_id to look for a per-application 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, in saved order (position, thencreated_at). Each gate matches request attributes, such
as application, model, collector, protocol, direction, tool, session, or source,
and takes an action:
Disabled gates are ignored. The first matching Block, Skip, or Ask decides and
stops evaluation. Earlier Report findings are returned together with that
final Block, Skip, or Ask. Report logs and moves on. In report-only mode
(Observe), a downgraded Block or Ask is recorded as Report and continues
to later gates and the detectors. Skip still stops evaluation.
4. Run the detector rules
TrustGuard filters detector rules by the request’sdirection 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-levelstatus, from most to least
restrictive:
skip instead of a ranked status. No detector
runs, and any earlier Report gate findings come back with it.
In Observe, Block, Ask, and Transform actions are downgraded, so the status
never exceeds report. The exception is a Skip gate, which still returns skip.
Response
A successful evaluation returns200, including one whose status is block.
The finding object
Where Data Loss Prevention masked a value
Adata_loss_prevention finding locates every value it masked, without
repeating the value. evidence.masked counts the entity types found and
evidence.masked_spans counts the values masked. Each value is a
evidence.flagged item of kind masked_span:
Only the first 64 values are listed;
masked_spans still counts all of them.
A masked tool-call argument also keeps its tool_call_arguments item.
Status codes
Error responses carry
{ "error", "trace_id", "request_id" }.
Limits and quotas
Rate limiting
Exceeding either limit returns429 with standard headers, so a client can back off
without parsing the body:
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
When a detector cannot run, such as after an upstream outage, a timeout, or a misconfigured detector, the guard’s When a detector can’t run setting decides what happens. Set it in the guard’s settings in the console:
The setting applies to direct calls and to the Claude Code, Cursor and Copilot
Studio integrations. Calls made through the gateway follow the TrustGuard
policy’s own
If the guardrail cannot evaluate
field instead.
The response is HTTP
200 with either setting, even when no detector could run.
With Block, the detector appears as a finding:
signal.type guard_failed_open and no
outcome, so it does not change the status:
The last three signals block with either setting.
Only
guard_failed_closed carries failure_mode.
These are not detections. In Activity the request shows the detector as not
executed and the action that was applied. A structured Block decision from a
gate or detector rule applies as before.
Enforcing the verdict
TrustGuard is advisory. Your collector inspects thestatus and decides: