A request to a model is not one block of text. It carries a system prompt, the user’s message, earlier turns, tool definitions, tool arguments, and tool results — and each of those has a different author and a different risk. TrustGuard splits the payload by role and sends each part only to the detectors built for it. System and developer instructions are left unscored.
This page is the map. Use it to predict which detector will fire on which part of a turn, and to understand why a rule you expected to match did not.At a glance
Input is the request sent to the model or MCP server. Output is what comes back. The phase is the one you pick on the policy rule.- A tool result on an LLM call is Input, not Output. The model asks for a tool in one response; your agent runs it and sends the result back in the next request. That is where TrustGuard sees it. On MCP, the result is the server’s response, so it arrives on Output.
- No single detector covers everything. Prompt Guard never reads tool definitions or tool results, and Indirect Prompt Injection never reads what the user typed. An agent that calls tools needs both. See Agent & MCP security.
- Input selection differs by detector. Prompt Guard scores every
role:userturn and any assistant turn replayed in the request. Each segment is separate and the highest score wins. Toxicity Detection and Custom Moderation score only the latest user message on Input.
Detector by detector
Prompt Guard
Reads conversation turns that can carry a jailbreak:- Every user message (
role:user), including earlier turns and the text blocks of a multimodal message. Each turn is scored on its own and the highest score wins, so a benign latest message does not dilute an injection in an earlier one. - Assistant turns replayed in a later request on Input. Replayed assistant content is scored on its own, the same way as a user turn.
developer messages, Responses instructions, Anthropic
system, Gemini systemInstruction, and Bedrock system — are skipped because
scoring them produces false positives. Tool definitions and tool results belong
to Indirect Prompt Injection.
Toxicity Detection and Custom Moderation
Both read conversational text in either direction:- The latest user message on Input. Earlier user turns are not scored.
- Assistant text on Output.
Data Loss Prevention
Reads text where personal data and secrets actually leave or enter:- The user’s message on Input.
- Tool-call argument values on Input — the values your agent is about to send to a tool, such as an email address passed to a CRM lookup.
- Assistant text on Output.
Indirect Prompt Injection
Reads content that came from a tool rather than from anyone in the conversation:- Tool definitions on an LLM request — each tool’s description, and the descriptions of its parameters. An instruction hidden in a description is how a poisoned tool attacks before it is ever called.
- Tool results returned to the model. Structured results are walked recursively and every string is scored, error messages included.
- MCP
tools/listresults — tool descriptions, plus the titles, descriptions, and defaults inside each input schema. - MCP tool results on Output.
URL Analyzer and Document Analyzer
These two do not score the user’s message directly. They pull external content out of it and score that:- URL Analyzer finds URLs in the user’s message, fetches at most 10 unique
pages with SSRF protections, and scores the returned text. Repeated copies of
a link count once. Past that cap the rest stay unfetched, and the request is
a
url_limit_exceededfinding: blocked in Enforce, reported in Observe. See How many links it fetches. - Document Analyzer extracts the text of each attached file — running OCR on
scans and images — and scores that. If parsing the file fails or times out,
that is a
guard_content_uninspectablefinding: blocked in Enforce, reported in Observe. A blank document is allowed. If the extractor isn’t available (no capacity or not configured), the file is allowed. See When a file cannot be read.
What is never scanned
Provider field reference
When you send a full provider body toPOST /v1/evaluate
— or when a gateway sends it for you — TrustGuard extracts the parts above from
these fields. The system / instructions column is not scored by Prompt Guard.
tool_calls[].function.arguments (OpenAI Chat,
Cohere), input[type=function_call].arguments (OpenAI Responses), tool_use.input
(Anthropic), and functionCall.args (Gemini). Those are the values Data Loss
Prevention reads.
Example: one tool-using turn
An OpenAI Chat Completions agent is asked to summarise a web page. The first request carries a system prompt, the user’s message, and one tool:choices[0].message.content, which
Toxicity Detection, Custom Moderation, and Data Loss Prevention read on Output.
MCP traffic
On MCP, TrustGuard reads the JSON-RPC messages between the agent and the server.tools/list is what catches tool poisoning: a server that advertises a
tool with instructions in its description is flagged before any tool is called.
Only collectors that see the tool listing can do this — see
How it works for which ones.