Scan messages for security threats without proxying to an LLM.
This is the primary endpoint for auto-instrumentation and framework
callback integrations. It runs the same policy engine, ML ensemble,
preset configuration, custom rules, and entitlements checks as the
proxy pipeline.
Use direction="input" before sending messages to the LLM and
direction="output" after receiving a response.
Returns a decision of allow, block, or redact along with
detailed threat information and optional redacted messages.
PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.
Headers
X-End-User
string | null
Your end user's id. Attributes the event to them on the End Users page, and with context.session_id names one session.
x-api-key
string | null
Body
application/json
Request body for the guard endpoint.
messages
GuardMessage · object[]
required
Messages to scan (OpenAI-style message array). When their text is more than one scan can read, the newest messages that fit are scanned and every older one is listed in unscanned as over_size_budget; only a newest message too large on its own is refused with 413.
Required array length: 1 - 512 elements
Show child attributes
direction
string
default:input
Scan direction: 'input' (pre-LLM) or 'output' (post-LLM)
Pattern: ^(input|output)$
model
string | null
Model being used (for logging)
context
GuardContext · object | null
Optional framework context
Show child attributes
retrieved_context
ContextDoc · object[] | null
RAG-retrieved documents to scan for knowledge poisoning. Each document is scanned individually; the first poisoned one blocks the request, and its position and source are returned in the event metadata so you know which document to drop. Scanning stops at that point, so a request with several poisoned documents reports the first. Optional; backwards-compatible.
Maximum array length: 32
Show child attributes
media
MediaPartSchema · object[] | null
Media attachments to scan for steganographic payloads, adversarial patches, and font injection. Optional.
Maximum array length: 8
Show child attributes
images
string[] | null
Image URLs or data: URIs to scan, as LiteLLM's PromptGuard guardrail sends them. Scanned like an image_url block on a message.
Maximum array length: 8
override
GuardOverride · object | null
A Shadow AI Device reporting an Override: the person sent a prompt the Device coached (a block that rested on one detector) anyway, with a reason. Sent with every message empty and nothing else to scan; any content is refused with 422. Recorded as an event with the decision override, its threat type and the reason, alerted on like a block and delivered to the SIEM, and not metered. The answer is allow: nothing was scanned.
Show child attributes
agreement
boolean | null
Count how many independent detectors agree on a block. With true, a confident finding is put to the rest of the detectors for a second opinion and detectors_agreeing counts them, at the cost of the ML layer's latency on every such block. With false, the scan stops at its first detection and asks no second opinion, so detectors_agreeing counts only the detectors that had found the threat when the scan decided. The decision, threat type and deciding rule are the same either way. Left out (or null), agreement is counted, and the response carries Deprecation and Sunset headers: from 2027-02-11 leaving it out means false. A Shadow AI Device's credential always counts.
device_findings
DeviceFinding · object[] | null
What the calling Device's own masker caught before sending, as {category, count} pairs, never the values. category is one of the threat types this API returns (e.g. api_key_leak, pii_leak) and appears at most once; count is a positive integer. Any other key is rejected with 422. Recorded on this request's event, attributed to the Device, and shown in the fleet views; it does not change the decision. A block an injection model decided on a request whose findings include a secret is reported as that secret (threat_typesecret_key_leak or api_key_leak), with the model's verdict kept as a finding that did not decide. Optional; clients that omit it are unaffected.
Maximum array length: 37
Show child attributes
Response
Successful Response
Response from the guard endpoint.
decision
string
required
Policy decision: 'allow', 'block', or 'redact'
event_id
string
required
Unique event identifier for tracking
confidence
number
required
Confidence score of the decision
latency_ms
number
required
Processing time in milliseconds
dashboard_url
string | null
The dashboard page of the event this decision recorded, in its project: the page the proxy names in x-promptguard-dashboard-url. Null when no event was recorded (a pgshadow doctor probe is answered but not recorded), so there is no page to open.
weighted_score
number | null
Aggregate decision-driving score (severity * confidence, clamped to [0, 1]) when a severity-carrying detector decided the verdict; null otherwise. Raw confidence stays in the confidence field.
threat_type
string | null
Primary threat type detected
reason
string | null
Why the decision was reached, in the words the event records: the reason the dashboard shows for it (unless the project keeps no content, when the event keeps only the threat type). Free text, and it may quote what was found. A client that tells a person why a request was stopped names this and threat_type, not a finding of its own, so the person and the dashboard give one explanation. Null on an allow that found nothing, and on any response from an Engine older than this field.
redacted_messages
GuardMessage · object[] | null
Redacted messages (only present when decision='redact'). Always the TEXT projection: a message sent as content blocks comes back as a string. Attachments are never rewritten, we do not re-encode a PDF with the secret removed, and returning one that looked redacted would be worse than returning none. A message listed in unscanned as over_size_budget was not read, so it comes back as its text, unredacted.
Show child attributes
threats
ThreatDetail · object[]
Detailed threat breakdown
Show child attributes
flagged
boolean
default:false
True when a finding flagged: allowed, reported, not enforced. The flagged findings are in threats with flagged: true, each with its threat type and rule. decision stays allow for a flag that decided, so a client that does not read this field lets the traffic through as before; on a block or redact it says a flag was also found. The event is stored with the decision flag.
detectors_agreeing
integer
default:0
On a block, how many independent detectors found the threat that decided it: 1 when one detector's verdict alone decided, 2 or more when others agreed. Counted by detector, not rule. 0 on anything but a block. A Shadow AI Device coaches rather than blocks a block resting on one detector (basisdetectors and 1 here): the person may send it anyway, with a reason.
basis
enum<string> | null
On a block, what it rests on: secret (a credential), organisation_rule (a policy, rule or pattern the organisation wrote), or detectors (the built-in detectors, as many as detectors_agreeing says). Null on anything but a block.
Available options:
secret,
organisation_rule,
detectors
unscanned
UnscannedAttachment · object[]
Parts that reached us and were not read: they produced nothing to scan, or the scan budget was spent first. An allow with a non-empty unscanned is NOT 'this content is clean', it is 'the text was clean and these parts were never read'. Reasons: url_only (we do not fetch caller-supplied URLs, that would be an SSRF primitive), file_id_unsupported, encrypted, no_text_extracted (a scanned/rasterised document), too_large, undecodable, unsupported_type, extractor_unavailable, unsupported_block, unsupported_tool_call (a tool call in none of the shapes we can read: index is its position among the request's tool calls), over_size_budget (a message older than the newest ones that filled the scan budget: index is its position in messages; it was not read on this call, and was the newest turn of an earlier one).
Show child attributes
unavailable
UnavailableCheck · object[]
Unavailable checks: detectors this scan would have run but the deployment cannot, because their backing service (an ML inference endpoint, an LLM judge, a bundled model) is not configured. An allow with a non-empty unavailable is NOT 'every check passed', these detectors never looked. A detector that ran and found nothing is not listed, and neither is one the project's plan or guardrail settings leave out.
Show child attributes
skipped
SkippedMatch · object[]
Matches deliberately not redacted, one entry per match, in the order found; an empty list when there were none. The text of a skipped match is left as it was. Reported for the text the scan's PII pass read; empty when the Project's guardrails run none.
How many Requests this call counted as toward the monthly allowance: 1 for a scan, whatever its length. 0 for a call that is not a scan: a findings-only report, a doctor probe or an Override.
billed_tokens
integer
default:0
The tokens of content this call scanned, counted with the cl100k_base tokenizer whatever model the content is for: each scanned text is encoded on its own and the counts are added. What is scanned is the messages read with their tool calls, retrieved context and Tool definitions; for a Shadow AI Device, the Current turn, the Instructions and the Tool definitions not already checked, never an Earlier turn. Reported, not yet charged for. 0 for a call that is not a scan.
detection_level
string
default:deep
The Detection level this call ran at: always deep, every detector including the LLM judges. Every plan runs the full engine and is billed at one list price, per call and per Billed token.
Allowed value: "deep"
entitlement
GuardEntitlement · object | null
What this account is entitled to, at the instant this scan was answered. Null when the engine cannot say, an account with no subscription row, an admin key that bypasses the counter, or a row it could not read. Null is 'unknown', NOT 'unentitled': a client that reads it as a limit has invented a refusal the engine never made.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PromptGuard","description":"AI security firewall. Protect LLM applications from prompt injection, data leaks, jailbreaks, and PII exposure.","colors":{"primary":"#3B82F6","light":"#60A5FA","dark":"#1D4ED8"},"logo":{"light":"https://mintcdn.com/promptguard/sBVZPqZYn263LC-L/logo/light.svg?fit=max\u0026auto=format\u0026n=sBVZPqZYn263LC-L\u0026q=85\u0026s=8bf0b3b1f4e6fcd571bd4fefce2cda92","dark":"https://mintcdn.com/promptguard/sBVZPqZYn263LC-L/logo/dark.svg?fit=max\u0026auto=format\u0026n=sBVZPqZYn263LC-L\u0026q=85\u0026s=5448b21f857c43e1208ae10e3d2b09e7","href":"https://promptguard.co"},"favicon":{"light":"https://mintcdn.com/promptguard/spb60-yqv9beaOFS/favicon.ico?fit=max\u0026auto=format\u0026n=spb60-yqv9beaOFS\u0026q=85\u0026s=ccf87036090bd89bb275dd47d8e66cac","dark":"https://mintcdn.com/promptguard/spb60-yqv9beaOFS/favicon.ico?fit=max\u0026auto=format\u0026n=spb60-yqv9beaOFS\u0026q=85\u0026s=ccf87036090bd89bb275dd47d8e66cac"},"api":{"playground":{"display":"interactive"},"mdx":{"server":"https://api.promptguard.co"}},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://promptguard.co/download","label":"Download"},{"href":"https://promptguard.co/contact","label":"Support"}],"primary":{"type":"button","label":"Get API Key","href":"https://app.promptguard.co/register?next=/dashboard/api-keys"}},"footer":{"socials":{"twitter":"https://x.com/PromptGuardco","linkedin":"https://www.linkedin.com/company/promptguardco","youtube":"https://www.youtube.com/@promptguardhq","github":"https://github.com/promptguardhq"},"links":[{"items":[{"label":"Dashboard","href":"https://app.promptguard.co"},{"label":"Download Desktop Agent","href":"https://promptguard.co/download"},{"label":"Pricing","href":"https://promptguard.co/pricing"},{"label":"Changelog","href":"/changelog"}]},{"items":[{"label":"Quick Start","href":"/quickstart"},{"label":"API Reference","href":"/api-reference/introduction"},{"label":"Python SDK","href":"/guides/python-sdk"},{"label":"Node.js SDK","href":"/guides/node-sdk"},{"label":"CLI","href":"/tools/cli"},{"label":"MCP Server","href":"/tools/mcp"},{"label":"VS Code Extension","href":"/tools/vscode"},{"label":"Video Tutorials","href":"/video-tutorials"}]},{"items":[{"label":"Blog","href":"https://promptguard.co/blog"},{"label":"Support","href":"https://promptguard.co/contact"},{"label":"Terms","href":"https://promptguard.co/terms"},{"label":"Privacy","href":"https://promptguard.co/privacy"}]},{"items":[{"label":"llms.txt","href":"https://docs.promptguard.co/llms.txt"},{"label":"llms-full.txt","href":"https://docs.promptguard.co/llms-full.txt"}]}]},"search":{},"seo":{"metatags":{"og:type":"website","og:site_name":"PromptGuard Docs"},"indexing":"navigable"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"system","latex":true},"contextual":{"options":["copy","chatgpt","claude","perplexity","add-mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"rectangle-terminal","href":"https://app.promptguard.co"},{"anchor":"Blog","icon":"newspaper","href":"https://promptguard.co/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"promptguard","hasAudioNarration":false,"actualSubdomain":"promptguard","customDomains":["docs.promptguard.co"],"gitSource":{"type":"github","owner":"promptguardhq","repo":"promptguard","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":"","_id":"6ae67b21a8f9aedbcd15e200"},"entitlements":{},"buildId":"6afc03920f5b3ebb6d39feef","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"Documentation","count":116},{"language":"default","tag":"API Reference","count":73},{"language":"default","tag":"Integrations","count":22},{"language":"default","tag":"Shadow AI","count":14},{"language":"default","tag":"LLM Providers","count":13},{"language":"default","tag":"Core Concepts","count":13},{"language":"default","tag":"Platform","count":12},{"language":"default","tag":"Resources","count":11},{"language":"default","tag":"Gateway","count":9},{"language":"default","tag":"Going to Production","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#banner{background:linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 50%, #3b82f6 100%)}#banner a{color:#93c5fd;text-decoration:underline;text-underline-offset:2px}#banner a:hover{color:#bfdbfe}"}]}
{"page":{"pagePath":"api-reference/guard/guard-content","slug":"/api-reference/guard/guard-content","pageMetadata":{"title":"Guard Content","description":"Scan messages for security threats without proxying to an LLM.\n\nThis is the primary endpoint for auto-instrumentation and framework\ncallback integrations. It runs the same policy engine, ML ensemble,\npreset configuration, custom rules, and entitlements checks as the\nproxy pipeline.\n\nUse ``direction=\"input\"`` before sending messages to the LLM and\n``direction=\"output\"`` after receiving a response.\n\nReturns a decision of ``allow``, ``block``, or ``redact`` along with\ndetailed threat information and optional redacted messages.\n\nGuide: [Guard API](https://docs.promptguard.co/api-reference/guard)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/guard","href":"/api-reference/guard/guard-content","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Scan messages for security threats without proxying to an LLM.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"This is the primary endpoint for auto-instrumentation and framework\\ncallback integrations. It runs the same policy engine, ML ensemble,\\npreset configuration, custom rules, and entitlements checks as the\\nproxy pipeline.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Use \", _jsx(_components.code, {\n children: \"direction=\\\"input\\\"\"\n }), \" before sending messages to the LLM and\\n\", _jsx(_components.code, {\n children: \"direction=\\\"output\\\"\"\n }), \" after receiving a response.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Returns a decision of \", _jsx(_components.code, {\n children: \"allow\"\n }), \", \", _jsx(_components.code, {\n children: \"block\"\n }), \", or \", _jsx(_components.code, {\n children: \"redact\"\n }), \" along with\\ndetailed threat information and optional redacted messages.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Guide: \", _jsx(_components.a, {\n href: \"https://docs.promptguard.co/api-reference/guard\",\n children: \"Guard API\"\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Guard Content","description":"Scan messages for security threats without proxying to an LLM.\n\nThis is the primary endpoint for auto-instrumentation and framework\ncallback integrations. It runs the same policy engine, ML ensemble,\npreset configuration, custom rules, and entitlements checks as the\nproxy pipeline.\n\nUse ``direction=\"input\"`` before sending messages to the LLM and\n``direction=\"output\"`` after receiving a response.\n\nReturns a decision of ``allow``, ``block``, or ``redact`` along with\ndetailed threat information and optional redacted messages.\n\nGuide: [Guard API](https://docs.promptguard.co/api-reference/guard)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/guard","href":"/api-reference/guard/guard-content","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["guard"],"summary":"Guard Content","description":"Scan messages for security threats without proxying to an LLM.\n\nThis is the primary endpoint for auto-instrumentation and framework\ncallback integrations. It runs the same policy engine, ML ensemble,\npreset configuration, custom rules, and entitlements checks as the\nproxy pipeline.\n\nUse ``direction=\"input\"`` before sending messages to the LLM and\n``direction=\"output\"`` after receiving a response.\n\nReturns a decision of ``allow``, ``block``, or ``redact`` along with\ndetailed threat information and optional redacted messages.\n\nGuide: [Guard API](https://docs.promptguard.co/api-reference/guard)","operationId":"guard_content_api_v1_guard_post","parameters":["af7a0b56-e91f-47f3-a0d3-b633748263b6","51aa10e3-360e-44cf-aac8-b8d3111447b6"],"requestBody":"02748c6a-1e34-44a8-9140-50dcf6e686bd","responses":{"200":"e56889c3-9564-49e9-8871-9a8903f29f1a","401":"ebd23233-e673-42d5-aa51-a8f2caea1d06","403":"4e403bcf-c4fb-4bf2-8ca4-a570cce94b6d","422":"40e4a695-d30d-49b4-b6e2-38ff539d61c2","429":"4357569d-dacb-4f51-9cd0-4c13f28dc64b"},"externalDocs":{"description":"Guide: Guard API","url":"https://docs.promptguard.co/api-reference/guard"},"method":"post","type":"path","servers":["3322fcfd-2e1e-450b-9829-61a049baba57"],"security":["d145d575-d9cd-4ad3-8d50-136df2fe469d"],"path":"/api/v1/guard","baseUrlOptions":["https://api.promptguard.co"],"title":"Guard Content","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"af7a0b56-e91f-47f3-a0d3-b633748263b6":{"name":"X-End-User","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"X-End-User","description":"Your end user's id. Attributes the event to them on the End Users page, and with context.session_id names one session.","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"X-End-User","description":"Your end user's id. Attributes the event to them on the End Users page, and with context.session_id names one session.","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"},"description":"Your end user's id. Attributes the event to them on the End Users page, and with context.session_id names one session."},"51aa10e3-360e-44cf-aac8-b8d3111447b6":{"name":"x-api-key","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"X-Api-Key","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"X-Api-Key","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"messages":{"items":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: system, user, assistant, tool. On an input scan a tool (or function) message is also scanned as a tool's result, and an instruction planted in it blocks as prompt_injection.","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Content","description":"Message text, or an OpenAI/Anthropic content-block array. Attachments carried in blocks are extracted and scanned like any other text; blocks we cannot read are listed in `unscanned`.","default":"","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"title":"Content","description":"Message text, or an OpenAI/Anthropic content-block array. Attachments carried in blocks are extracted and scanned like any other text; blocks we cannot read are listed in `unscanned`.","default":"","uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"Content · object[]"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | Content · object[]"},"tool_calls":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.0.items.[INDEX]","typeLabel":"any"},"title":"Tool Calls","description":"The tool calls this message made, as a conversation carries them, in any shape `context.tool_calls` reads. Their names and arguments are scanned like `context.tool_calls`, as part of this message's turn; a call we cannot read is listed in `unscanned`. On a Device's request an Earlier turn's calls are not rescanned for what blocks, and personal data or a credential in their arguments is redacted again: the decision is `redact`, and the call is the caller's to mask, because `redacted_messages` carries text only.","uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.0","typeLabel":"any[]"},{"type":"null","title":"Tool Calls","description":"The tool calls this message made, as a conversation carries them, in any shape `context.tool_calls` reads. Their names and arguments are scanned like `context.tool_calls`, as part of this message's turn; a call we cannot read is listed in `unscanned`. On a Device's request an Earlier turn's calls are not rescanned for what blocks, and personal data or a credential in their arguments is redacted again: the decision is `redact`, and the call is the caller's to mask, because `redacted_messages` carries text only.","uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"any[] | null"}},"type":"object","required":["role"],"title":"GuardMessage","description":"A single message in the conversation.\n\n``content`` takes either a plain string or a provider-shaped content-block\narray, OpenAI's ``text``/``image_url``/``input_audio``/``file`` and\nAnthropic's ``text``/``image``/``document`` are all understood, because\nthose are the two shapes our own proxy already receives.\n\nBlocks are accepted as loose dicts rather than a closed union on purpose.\nBoth providers add block types faster than we can model them, and a strict\nschema would 422 a request we could otherwise have scanned the text of.\nAnything unrecognised is *reported* in the response's ``unscanned`` rather\nthan dropped, see ``shared.security.content_parts``.","uniqueKey":"messages.items.[INDEX]","typeLabel":"GuardMessage · object"},"type":"array","maxItems":512,"minItems":1,"title":"Messages","description":"Messages to scan (OpenAI-style message array). When their text is more than one scan can read, the newest messages that fit are scanned and every older one is listed in `unscanned` as `over_size_budget`; only a newest message too large on its own is refused with 413.","isRequired":true,"uniqueKey":"messages","typeLabel":"GuardMessage · object[]"},"direction":{"type":"string","pattern":"^(input|output)$","title":"Direction","description":"Scan direction: 'input' (pre-LLM) or 'output' (post-LLM)","default":"input","uniqueKey":"direction","typeLabel":"string"},"model":{"oneOf":[{"type":"string","title":"Model","description":"Model being used (for logging)","uniqueKey":"model.oneOf.0","typeLabel":"string"},{"type":"null","title":"Model","description":"Model being used (for logging)","uniqueKey":"model.oneOf.1","typeLabel":"null"}],"uniqueKey":"model","typeLabel":"string | null"},"context":{"oneOf":[{"type":"object","title":"GuardContext","description":"Optional framework context","properties":{"framework":{"oneOf":[{"type":"string","title":"Framework","description":"Framework name, e.g. 'langchain', 'crewai'","uniqueKey":"context.oneOf.0.framework.oneOf.0","typeLabel":"string"},{"type":"null","title":"Framework","description":"Framework name, e.g. 'langchain', 'crewai'","uniqueKey":"context.oneOf.0.framework.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.framework","typeLabel":"string | null"},"chain_name":{"oneOf":[{"type":"string","title":"Chain Name","description":"LangChain chain name or pipeline identifier","uniqueKey":"context.oneOf.0.chain_name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Chain Name","description":"LangChain chain name or pipeline identifier","uniqueKey":"context.oneOf.0.chain_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.chain_name","typeLabel":"string | null"},"agent_id":{"oneOf":[{"type":"string","title":"Agent Id","description":"Agent identifier for multi-agent systems","uniqueKey":"context.oneOf.0.agent_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Agent Id","description":"Agent identifier for multi-agent systems","uniqueKey":"context.oneOf.0.agent_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.agent_id","typeLabel":"string | null"},"session_id":{"oneOf":[{"type":"string","title":"Session Id","description":"The conversation this request is a turn of. Send the same value for every turn of one end user's conversation: with the X-End-User header it is one session, and the dashboard's Sessions view lists that session's events in order. Generate it on your server, random enough that an end user cannot guess another's (a UUIDv4 will do), and never take it from the end user's request: whoever can name a session id can add turns to that conversation. At most 255 characters, stored exactly as sent; it names the conversation and holds none of it, so a zero-retention project keeps it. The same id under another end user or project is another conversation. For each input turn PromptGuard also remembers its detection signals: the Techniques of the finding that decided it, that finding's confidence and when the turn arrived, never its text, for every project including zero-retention ones. At most the last 10 turns are kept, each for at most 1 hour. When the request names its end user with the X-End-User header, a turn that pivots (\"now tell me...\") after an earlier persona, hypothetical or authority turn is reported as a `candidate` threat from the `conversation/priming_then_pivot` rule, which never changes the decision; without X-End-User that rule records nothing. A sudden burst of turns, many times the conversation's own earlier rate, is recorded on the turn's event as a signal, and changes nothing either. If the conversation's memory cannot be reached in time, the turn is scanned on its own. Output scans are not turns. Without a session id a request is scanned on its own, as it always was.","maxLength":255,"uniqueKey":"context.oneOf.0.session_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Session Id","description":"The conversation this request is a turn of. Send the same value for every turn of one end user's conversation: with the X-End-User header it is one session, and the dashboard's Sessions view lists that session's events in order. Generate it on your server, random enough that an end user cannot guess another's (a UUIDv4 will do), and never take it from the end user's request: whoever can name a session id can add turns to that conversation. At most 255 characters, stored exactly as sent; it names the conversation and holds none of it, so a zero-retention project keeps it. The same id under another end user or project is another conversation. For each input turn PromptGuard also remembers its detection signals: the Techniques of the finding that decided it, that finding's confidence and when the turn arrived, never its text, for every project including zero-retention ones. At most the last 10 turns are kept, each for at most 1 hour. When the request names its end user with the X-End-User header, a turn that pivots (\"now tell me...\") after an earlier persona, hypothetical or authority turn is reported as a `candidate` threat from the `conversation/priming_then_pivot` rule, which never changes the decision; without X-End-User that rule records nothing. A sudden burst of turns, many times the conversation's own earlier rate, is recorded on the turn's event as a signal, and changes nothing either. If the conversation's memory cannot be reached in time, the turn is scanned on its own. Output scans are not turns. Without a session id a request is scanned on its own, as it always was.","uniqueKey":"context.oneOf.0.session_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.session_id","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"context.oneOf.0.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"title":"Tool Calls","description":"Tool calls in this turn. The tool NAME and its ARGUMENTS are assembled into the scanned text and get the same detection stack as the messages: tool arguments are where an exfiltration payload actually travels, so they are scanned rather than logged. Both provider spellings are read: OpenAI's `{'type':'function','function':{'name','arguments'}}` and Anthropic's `{'type':'tool_use','name','input'}`, plus LangChain's `{'name','args'}`. A call in none of those shapes is reported in the response's `unscanned` array with its position; it is never quietly skipped. These calls carry no position in the conversation, so they are always scanned as the newest turn's. Send a conversation's calls on the messages that made them (`messages[].tool_calls`) to have each read as part of its own turn.","maxItems":64,"uniqueKey":"context.oneOf.0.tool_calls.oneOf.0","typeLabel":"Tool Calls · object[]"},{"type":"null","title":"Tool Calls","description":"Tool calls in this turn. The tool NAME and its ARGUMENTS are assembled into the scanned text and get the same detection stack as the messages: tool arguments are where an exfiltration payload actually travels, so they are scanned rather than logged. Both provider spellings are read: OpenAI's `{'type':'function','function':{'name','arguments'}}` and Anthropic's `{'type':'tool_use','name','input'}`, plus LangChain's `{'name','args'}`. A call in none of those shapes is reported in the response's `unscanned` array with its position; it is never quietly skipped. These calls carry no position in the conversation, so they are always scanned as the newest turn's. Send a conversation's calls on the messages that made them (`messages[].tool_calls`) to have each read as part of its own turn.","uniqueKey":"context.oneOf.0.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.tool_calls","typeLabel":"Tool Calls · object[] | null"},"tool_definitions":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"context.oneOf.0.tool_definitions.oneOf.0.items.[INDEX]","typeLabel":"object"},"title":"Tool Definitions","description":"The tools the AI app offers the model on this request: each one's name, description and input schema. Each is scanned as a tool manifest -- the scan `POST /api/v1/mcp/manifest-scan` runs, for poisoned descriptions and parameter docs and smuggled Unicode -- and a poisoned one blocks, naming the tool, with the finding's `segment` `tool_definition`. An unchanged definition is not scanned again on the next request. Read in MCP's `{'name','description','inputSchema'}`, Anthropic's `input_schema` and OpenAI's `{'type':'function','function':{'name','description','parameters'}}`; a definition in none of them is listed in `unscanned` with its position.","maxItems":256,"uniqueKey":"context.oneOf.0.tool_definitions.oneOf.0","typeLabel":"Tool Definitions · object[]"},{"type":"null","title":"Tool Definitions","description":"The tools the AI app offers the model on this request: each one's name, description and input schema. Each is scanned as a tool manifest -- the scan `POST /api/v1/mcp/manifest-scan` runs, for poisoned descriptions and parameter docs and smuggled Unicode -- and a poisoned one blocks, naming the tool, with the finding's `segment` `tool_definition`. An unchanged definition is not scanned again on the next request. Read in MCP's `{'name','description','inputSchema'}`, Anthropic's `input_schema` and OpenAI's `{'type':'function','function':{'name','description','parameters'}}`; a definition in none of them is listed in `unscanned` with its position.","uniqueKey":"context.oneOf.0.tool_definitions.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.tool_definitions","typeLabel":"Tool Definitions · object[] | null"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Arbitrary framework-specific metadata (not scanned)","additionalProperties":true,"uniqueKey":"context.oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Arbitrary framework-specific metadata (not scanned)","uniqueKey":"context.oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"context.oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"uniqueKey":"context.oneOf.0","typeLabel":"GuardContext · object"},{"type":"null","description":"Optional framework context","uniqueKey":"context.oneOf.1","typeLabel":"null"}],"uniqueKey":"context","typeLabel":"GuardContext · object | null"},"retrieved_context":{"oneOf":[{"type":"array","items":{"properties":{"content":{"type":"string","maxLength":100000,"title":"Content","description":"Document text content","isRequired":true,"uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].content","typeLabel":"string"},"source":{"oneOf":[{"type":"string","title":"Source","description":"Source identifier (URL, doc ID, etc.)","uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].source.oneOf.0","typeLabel":"string"},{"type":"null","title":"Source","description":"Source identifier (URL, doc ID, etc.)","uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].source.oneOf.1","typeLabel":"null"}],"uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].source","typeLabel":"string | null"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Extra metadata","additionalProperties":true,"uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Extra metadata","uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"retrieved_context.oneOf.0.items.[INDEX].metadata","typeLabel":"Metadata · object | null"}},"type":"object","required":["content"],"title":"ContextDoc","description":"A document retrieved by a RAG pipeline to be scanned for poisoning.","uniqueKey":"retrieved_context.oneOf.0.items.[INDEX]","typeLabel":"ContextDoc · object"},"title":"Retrieved Context","description":"RAG-retrieved documents to scan for knowledge poisoning. Each document is scanned individually; the first poisoned one blocks the request, and its position and source are returned in the event metadata so you know which document to drop. Scanning stops at that point, so a request with several poisoned documents reports the first. Optional; backwards-compatible.","maxItems":32,"uniqueKey":"retrieved_context.oneOf.0","typeLabel":"ContextDoc · object[]"},{"type":"null","title":"Retrieved Context","description":"RAG-retrieved documents to scan for knowledge poisoning. Each document is scanned individually; the first poisoned one blocks the request, and its position and source are returned in the event metadata so you know which document to drop. Scanning stops at that point, so a request with several poisoned documents reports the first. Optional; backwards-compatible.","uniqueKey":"retrieved_context.oneOf.1","typeLabel":"null"}],"uniqueKey":"retrieved_context","typeLabel":"ContextDoc · object[] | null"},"media":{"oneOf":[{"type":"array","items":{"properties":{"type":{"type":"string","pattern":"^(image|audio|document)$","title":"Type","description":"Media type: 'image', 'audio' or 'document'","isRequired":true,"uniqueKey":"media.oneOf.0.items.[INDEX].type","typeLabel":"string"},"mime_type":{"type":"string","title":"Mime Type","description":"MIME type, e.g. 'image/png', 'audio/wav'","isRequired":true,"uniqueKey":"media.oneOf.0.items.[INDEX].mime_type","typeLabel":"string"},"url":{"oneOf":[{"type":"string","title":"Url","description":"URL to fetch the media from","uniqueKey":"media.oneOf.0.items.[INDEX].url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Url","description":"URL to fetch the media from","uniqueKey":"media.oneOf.0.items.[INDEX].url.oneOf.1","typeLabel":"null"}],"uniqueKey":"media.oneOf.0.items.[INDEX].url","typeLabel":"string | null"},"base64":{"oneOf":[{"type":"string","title":"Base64","description":"Base64-encoded media data","uniqueKey":"media.oneOf.0.items.[INDEX].base64.oneOf.0","typeLabel":"string"},{"type":"null","title":"Base64","description":"Base64-encoded media data","uniqueKey":"media.oneOf.0.items.[INDEX].base64.oneOf.1","typeLabel":"null"}],"uniqueKey":"media.oneOf.0.items.[INDEX].base64","typeLabel":"string | null"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Extra metadata","additionalProperties":true,"uniqueKey":"media.oneOf.0.items.[INDEX].metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Extra metadata","uniqueKey":"media.oneOf.0.items.[INDEX].metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"media.oneOf.0.items.[INDEX].metadata","typeLabel":"Metadata · object | null"}},"type":"object","required":["type","mime_type"],"title":"MediaPartSchema","description":"A media attachment to be scanned for steganographic/adversarial payloads.","uniqueKey":"media.oneOf.0.items.[INDEX]","typeLabel":"MediaPartSchema · object"},"title":"Media","description":"Media attachments to scan for steganographic payloads, adversarial patches, and font injection. Optional.","maxItems":8,"uniqueKey":"media.oneOf.0","typeLabel":"MediaPartSchema · object[]"},{"type":"null","title":"Media","description":"Media attachments to scan for steganographic payloads, adversarial patches, and font injection. Optional.","uniqueKey":"media.oneOf.1","typeLabel":"null"}],"uniqueKey":"media","typeLabel":"MediaPartSchema · object[] | null"},"images":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"images.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Images","description":"Image URLs or `data:` URIs to scan, as LiteLLM's PromptGuard guardrail sends them. Scanned like an `image_url` block on a message.","maxItems":8,"uniqueKey":"images.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Images","description":"Image URLs or `data:` URIs to scan, as LiteLLM's PromptGuard guardrail sends them. Scanned like an `image_url` block on a message.","uniqueKey":"images.oneOf.1","typeLabel":"null"}],"uniqueKey":"images","typeLabel":"string[] | null"},"override":{"oneOf":[{"type":"object","title":"GuardOverride","description":"A Shadow AI Device reporting an **Override**: the person sent a prompt the Device coached (a block that rested on one detector) anyway, with a reason. Sent with every message empty and nothing else to scan; any content is refused with 422. Recorded as an event with the decision `override`, its threat type and the reason, alerted on like a block and delivered to the SIEM, and not metered. The answer is `allow`: nothing was scanned.","required":["reference"],"properties":{"reference":{"type":"string","pattern":"^C-[0-9A-F]{8}$","title":"Reference","description":"The Device's coaching reference for the prompt, e.g. `C-1A2B3C4D`.","isRequired":true,"uniqueKey":"override.oneOf.0.reference","typeLabel":"string"},"reason":{"type":"string","maxLength":500,"title":"Reason","description":"The reason the person gave, masked on the Device and masked again here like a preview. Empty when the Device's Disclosure sends no prompt content.","default":"","uniqueKey":"override.oneOf.0.reason","typeLabel":"string"},"threat_type":{"oneOf":[{"type":"string","title":"Threat Type","description":"What the coached block was for, as this API names threat types. One it does not know is not stored.","maxLength":64,"uniqueKey":"override.oneOf.0.threat_type.oneOf.0","typeLabel":"string"},{"type":"null","title":"Threat Type","description":"What the coached block was for, as this API names threat types. One it does not know is not stored.","uniqueKey":"override.oneOf.0.threat_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"override.oneOf.0.threat_type","typeLabel":"string | null"},"engine_event_id":{"oneOf":[{"type":"string","title":"Engine Event Id","description":"The event the coached block was recorded as, when the Engine decided it.","maxLength":64,"uniqueKey":"override.oneOf.0.engine_event_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Engine Event Id","description":"The event the coached block was recorded as, when the Engine decided it.","uniqueKey":"override.oneOf.0.engine_event_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"override.oneOf.0.engine_event_id","typeLabel":"string | null"}},"uniqueKey":"override.oneOf.0","typeLabel":"GuardOverride · object"},{"type":"null","description":"A Shadow AI Device reporting an **Override**: the person sent a prompt the Device coached (a block that rested on one detector) anyway, with a reason. Sent with every message empty and nothing else to scan; any content is refused with 422. Recorded as an event with the decision `override`, its threat type and the reason, alerted on like a block and delivered to the SIEM, and not metered. The answer is `allow`: nothing was scanned.","uniqueKey":"override.oneOf.1","typeLabel":"null"}],"uniqueKey":"override","typeLabel":"GuardOverride · object | null"},"agreement":{"oneOf":[{"type":"boolean","title":"Agreement","description":"Count how many independent detectors agree on a `block`. With `true`, a confident finding is put to the rest of the detectors for a second opinion and `detectors_agreeing` counts them, at the cost of the ML layer's latency on every such block. With `false`, the scan stops at its first detection and asks no second opinion, so `detectors_agreeing` counts only the detectors that had found the threat when the scan decided. The decision, threat type and deciding rule are the same either way. Left out (or `null`), agreement is counted, and the response carries `Deprecation` and `Sunset` headers: from 2027-02-11 leaving it out means `false`. A Shadow AI Device's credential always counts.","uniqueKey":"agreement.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Agreement","description":"Count how many independent detectors agree on a `block`. With `true`, a confident finding is put to the rest of the detectors for a second opinion and `detectors_agreeing` counts them, at the cost of the ML layer's latency on every such block. With `false`, the scan stops at its first detection and asks no second opinion, so `detectors_agreeing` counts only the detectors that had found the threat when the scan decided. The decision, threat type and deciding rule are the same either way. Left out (or `null`), agreement is counted, and the response carries `Deprecation` and `Sunset` headers: from 2027-02-11 leaving it out means `false`. A Shadow AI Device's credential always counts.","uniqueKey":"agreement.oneOf.1","typeLabel":"null"}],"uniqueKey":"agreement","typeLabel":"boolean | null"},"device_findings":{"oneOf":[{"type":"array","items":{"properties":{"category":{"type":"string","enum":["prompt_injection","pii_leak","data_exfiltration","toxicity","api_key_leak","system_prompt_leak","policy_violation","fraud_abuse","malware","secret_key_leak","url_violation","malicious_entity","off_topic","mcp_violation","insecure_code","gibberish","language_violation","multi_turn_escalation","html_obfuscation","syntactic_masking","image_stego","image_adversarial","audio_stego","font_injection","dynamic_cloaking","framing_bias","critic_evasion","persona_hyperstition","rag_poisoning","memory_poisoning","few_shot_poisoning","sub_agent_spawning","compositional_fragment","sybil_attack","systemic_cascade","tacit_collusion","approval_fatigue"],"title":"ThreatType","description":"The Engine's threat category, e.g. 'api_key_leak' or 'pii_leak'.","isRequired":true,"uniqueKey":"device_findings.oneOf.0.items.[INDEX].category","typeLabel":"enum\u003cstring>"},"count":{"type":"integer","maximum":100000,"minimum":1,"title":"Count","description":"How many values of this category the masker replaced.","isRequired":true,"uniqueKey":"device_findings.oneOf.0.items.[INDEX].count","typeLabel":"integer"}},"additionalProperties":false,"type":"object","required":["category","count"],"title":"DeviceFinding","description":"One category the Device's masker caught, and how many times.","uniqueKey":"device_findings.oneOf.0.items.[INDEX]","typeLabel":"DeviceFinding · object"},"title":"Device Findings","description":"What the calling Device's own masker caught before sending, as `{category, count}` pairs, never the values. `category` is one of the threat types this API returns (e.g. `api_key_leak`, `pii_leak`) and appears at most once; `count` is a positive integer. Any other key is rejected with 422. Recorded on this request's event, attributed to the Device, and shown in the fleet views; it does not change the decision. A block an injection model decided on a request whose findings include a secret is reported as that secret (`threat_type` `secret_key_leak` or `api_key_leak`), with the model's verdict kept as a finding that did not decide. Optional; clients that omit it are unaffected.","maxItems":37,"uniqueKey":"device_findings.oneOf.0","typeLabel":"DeviceFinding · object[]"},{"type":"null","title":"Device Findings","description":"What the calling Device's own masker caught before sending, as `{category, count}` pairs, never the values. `category` is one of the threat types this API returns (e.g. `api_key_leak`, `pii_leak`) and appears at most once; `count` is a positive integer. Any other key is rejected with 422. Recorded on this request's event, attributed to the Device, and shown in the fleet views; it does not change the decision. A block an injection model decided on a request whose findings include a secret is reported as that secret (`threat_type` `secret_key_leak` or `api_key_leak`), with the model's verdict kept as a finding that did not decide. Optional; clients that omit it are unaffected.","uniqueKey":"device_findings.oneOf.1","typeLabel":"null"}],"uniqueKey":"device_findings","typeLabel":"DeviceFinding · object[] | null"}},"type":"object","required":["messages"],"title":"GuardRequest","description":"Request body for the guard endpoint.","uniqueKey":"","typeLabel":"GuardRequest · object"},"examples":{"Example":{"title":"Example","value":{"messages":[{"role":"\u003cstring>","content":"","tool_calls":["\u003cunknown>"]}],"direction":"input","model":"\u003cstring>","context":{"framework":"\u003cstring>","chain_name":"\u003cstring>","agent_id":"\u003cstring>","session_id":"\u003cstring>","tool_calls":[{}],"tool_definitions":[{}],"metadata":{}},"retrieved_context":[{"content":"\u003cstring>","source":"\u003cstring>","metadata":{}}],"media":[{"type":"\u003cstring>","mime_type":"\u003cstring>","url":"\u003cstring>","base64":"\u003cstring>","metadata":{}}],"images":["\u003cstring>"],"override":{"reference":"\u003cstring>","reason":"","threat_type":"\u003cstring>","engine_event_id":"\u003cstring>"},"agreement":true,"device_findings":[{"count":50000}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"e56889c3-9564-49e9-8871-9a8903f29f1a":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"decision":{"type":"string","title":"Decision","description":"Policy decision: 'allow', 'block', or 'redact'","isRequired":true,"uniqueKey":"decision","typeLabel":"string"},"event_id":{"type":"string","title":"Event Id","description":"Unique event identifier for tracking","isRequired":true,"uniqueKey":"event_id","typeLabel":"string"},"confidence":{"type":"number","title":"Confidence","description":"Confidence score of the decision","isRequired":true,"uniqueKey":"confidence","typeLabel":"number"},"latency_ms":{"type":"number","title":"Latency Ms","description":"Processing time in milliseconds","isRequired":true,"uniqueKey":"latency_ms","typeLabel":"number"},"dashboard_url":{"oneOf":[{"type":"string","title":"Dashboard Url","description":"The dashboard page of the event this decision recorded, in its project: the page the proxy names in `x-promptguard-dashboard-url`. Null when no event was recorded (a `pgshadow doctor` probe is answered but not recorded), so there is no page to open.","uniqueKey":"dashboard_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Dashboard Url","description":"The dashboard page of the event this decision recorded, in its project: the page the proxy names in `x-promptguard-dashboard-url`. Null when no event was recorded (a `pgshadow doctor` probe is answered but not recorded), so there is no page to open.","uniqueKey":"dashboard_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"dashboard_url","typeLabel":"string | null"},"weighted_score":{"oneOf":[{"type":"number","title":"Weighted Score","description":"Aggregate decision-driving score (severity * confidence, clamped to [0, 1]) when a severity-carrying detector decided the verdict; null otherwise. Raw confidence stays in the `confidence` field.","uniqueKey":"weighted_score.oneOf.0","typeLabel":"number"},{"type":"null","title":"Weighted Score","description":"Aggregate decision-driving score (severity * confidence, clamped to [0, 1]) when a severity-carrying detector decided the verdict; null otherwise. Raw confidence stays in the `confidence` field.","uniqueKey":"weighted_score.oneOf.1","typeLabel":"null"}],"uniqueKey":"weighted_score","typeLabel":"number | null"},"threat_type":{"oneOf":[{"type":"string","title":"Threat Type","description":"Primary threat type detected","uniqueKey":"threat_type.oneOf.0","typeLabel":"string"},{"type":"null","title":"Threat Type","description":"Primary threat type detected","uniqueKey":"threat_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"threat_type","typeLabel":"string | null"},"reason":{"oneOf":[{"type":"string","title":"Reason","description":"Why the decision was reached, in the words the event records: the reason the dashboard shows for it (unless the project keeps no content, when the event keeps only the threat type). Free text, and it may quote what was found. A client that tells a person why a request was stopped names this and `threat_type`, not a finding of its own, so the person and the dashboard give one explanation. Null on an `allow` that found nothing, and on any response from an Engine older than this field.","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reason","description":"Why the decision was reached, in the words the event records: the reason the dashboard shows for it (unless the project keeps no content, when the event keeps only the threat type). Free text, and it may quote what was found. A client that tells a person why a request was stopped names this and `threat_type`, not a finding of its own, so the person and the dashboard give one explanation. Null on an `allow` that found nothing, and on any response from an Engine older than this field.","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"},"redacted_messages":{"oneOf":[{"type":"array","items":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: system, user, assistant, tool. On an input scan a tool (or function) message is also scanned as a tool's result, and an instruction planted in it blocks as prompt_injection.","isRequired":true,"uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Content","description":"Message text, or an OpenAI/Anthropic content-block array. Attachments carried in blocks are extracted and scanned like any other text; blocks we cannot read are listed in `unscanned`.","default":"","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"title":"Content","description":"Message text, or an OpenAI/Anthropic content-block array. Attachments carried in blocks are extracted and scanned like any other text; blocks we cannot read are listed in `unscanned`.","default":"","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].content.oneOf.1","typeLabel":"Content · object[]"}],"uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].content","typeLabel":"string | Content · object[]"},"tool_calls":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].tool_calls.oneOf.0.items.[INDEX]","typeLabel":"any"},"title":"Tool Calls","description":"The tool calls this message made, as a conversation carries them, in any shape `context.tool_calls` reads. Their names and arguments are scanned like `context.tool_calls`, as part of this message's turn; a call we cannot read is listed in `unscanned`. On a Device's request an Earlier turn's calls are not rescanned for what blocks, and personal data or a credential in their arguments is redacted again: the decision is `redact`, and the call is the caller's to mask, because `redacted_messages` carries text only.","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].tool_calls.oneOf.0","typeLabel":"any[]"},{"type":"null","title":"Tool Calls","description":"The tool calls this message made, as a conversation carries them, in any shape `context.tool_calls` reads. Their names and arguments are scanned like `context.tool_calls`, as part of this message's turn; a call we cannot read is listed in `unscanned`. On a Device's request an Earlier turn's calls are not rescanned for what blocks, and personal data or a credential in their arguments is redacted again: the decision is `redact`, and the call is the caller's to mask, because `redacted_messages` carries text only.","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"redacted_messages.oneOf.0.items.[INDEX].tool_calls","typeLabel":"any[] | null"}},"type":"object","required":["role"],"title":"GuardMessage","description":"A single message in the conversation.\n\n``content`` takes either a plain string or a provider-shaped content-block\narray, OpenAI's ``text``/``image_url``/``input_audio``/``file`` and\nAnthropic's ``text``/``image``/``document`` are all understood, because\nthose are the two shapes our own proxy already receives.\n\nBlocks are accepted as loose dicts rather than a closed union on purpose.\nBoth providers add block types faster than we can model them, and a strict\nschema would 422 a request we could otherwise have scanned the text of.\nAnything unrecognised is *reported* in the response's ``unscanned`` rather\nthan dropped, see ``shared.security.content_parts``.","uniqueKey":"redacted_messages.oneOf.0.items.[INDEX]","typeLabel":"GuardMessage · object"},"title":"Redacted Messages","description":"Redacted messages (only present when decision='redact'). Always the TEXT projection: a message sent as content blocks comes back as a string. Attachments are never rewritten, we do not re-encode a PDF with the secret removed, and returning one that looked redacted would be worse than returning none. A message listed in `unscanned` as `over_size_budget` was not read, so it comes back as its text, unredacted.","uniqueKey":"redacted_messages.oneOf.0","typeLabel":"GuardMessage · object[]"},{"type":"null","title":"Redacted Messages","description":"Redacted messages (only present when decision='redact'). Always the TEXT projection: a message sent as content blocks comes back as a string. Attachments are never rewritten, we do not re-encode a PDF with the secret removed, and returning one that looked redacted would be worse than returning none. A message listed in `unscanned` as `over_size_budget` was not read, so it comes back as its text, unredacted.","uniqueKey":"redacted_messages.oneOf.1","typeLabel":"null"}],"uniqueKey":"redacted_messages","typeLabel":"GuardMessage · object[] | null"},"threats":{"items":{"properties":{"type":{"type":"string","title":"Type","isRequired":true,"uniqueKey":"threats.items.[INDEX].type","typeLabel":"string"},"confidence":{"type":"number","title":"Confidence","isRequired":true,"uniqueKey":"threats.items.[INDEX].confidence","typeLabel":"number"},"details":{"type":"string","title":"Details","isRequired":true,"uniqueKey":"threats.items.[INDEX].details","typeLabel":"string"},"weighted_score":{"oneOf":[{"type":"number","title":"Weighted Score","description":"severity_score * confidence, clamped to [0, 1]. The decision-driving number when a severity-carrying detector (e.g. structural heuristics) fired; null when confidence alone is the signal.","uniqueKey":"threats.items.[INDEX].weighted_score.oneOf.0","typeLabel":"number"},{"type":"null","title":"Weighted Score","description":"severity_score * confidence, clamped to [0, 1]. The decision-driving number when a severity-carrying detector (e.g. structural heuristics) fired; null when confidence alone is the signal.","uniqueKey":"threats.items.[INDEX].weighted_score.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].weighted_score","typeLabel":"number | null"},"technique":{"oneOf":[{"type":"string","title":"Technique","description":"The attack technique an injection or jailbreak finding belongs to, as ATR names it: a dotted category and subcategory such as `prompt-injection.persona-hijacking`. When several findings disagree, the highest-scoring one names it. Null for a finding that is not an attack, such as redacted PII.","uniqueKey":"threats.items.[INDEX].technique.oneOf.0","typeLabel":"string"},{"type":"null","title":"Technique","description":"The attack technique an injection or jailbreak finding belongs to, as ATR names it: a dotted category and subcategory such as `prompt-injection.persona-hijacking`. When several findings disagree, the highest-scoring one names it. Null for a finding that is not an attack, such as redacted PII.","uniqueKey":"threats.items.[INDEX].technique.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].technique","typeLabel":"string | null"},"rule":{"oneOf":[{"type":"object","title":"FindingRule","description":"The detector and rule that made this finding, the pair a Suppression is keyed on. On a block, the rule that decided.","required":["detector","id","suppressible"],"properties":{"detector":{"type":"string","title":"Detector","description":"The detector that made the finding, e.g. `injection_regex`, `pii`, `ml_injection_classifier`. Stable across releases.","isRequired":true,"uniqueKey":"threats.items.[INDEX].rule.oneOf.0.detector","typeLabel":"string"},"id":{"type":"string","title":"Id","description":"The rule of that detector that fired. Stable across releases: a detector that reports by type uses the type (`email` for `pii`), a pattern rule its declared name (`ignore_previous_instructions`), an ATR rule ATR's own id, and a detector with one verdict its own name.","isRequired":true,"uniqueKey":"threats.items.[INDEX].rule.oneOf.0.id","typeLabel":"string"},"suppressible":{"type":"boolean","title":"Suppressible","description":"Whether a Suppression may target this rule. False for the ML injection classifier and every model or LLM judge of injection, the secret detectors, canary tokens, and the project's own rules and MCP configuration. Other judges, such as content safety, can be.","isRequired":true,"uniqueKey":"threats.items.[INDEX].rule.oneOf.0.suppressible","typeLabel":"boolean"}},"uniqueKey":"threats.items.[INDEX].rule.oneOf.0","typeLabel":"FindingRule · object"},{"type":"null","description":"The detector and rule that made this finding, the pair a Suppression is keyed on. On a block, the rule that decided.","uniqueKey":"threats.items.[INDEX].rule.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].rule","typeLabel":"FindingRule · object | null"},"segment":{"oneOf":[{"type":"string","title":"Segment","description":"The part of the request the finding came from. On a Shadow AI Device's scan: `current_turn` (the person's new message, its tool results and the tool calls they answer), `earlier_turn` (a turn already sent, redacted again because the app resends it), or `instructions` (the app's system or developer prompt, scanned for secrets only). On any caller's scan: `tool_definition`, for an entry of `context.tool_definitions`. Null otherwise.","uniqueKey":"threats.items.[INDEX].segment.oneOf.0","typeLabel":"string"},{"type":"null","title":"Segment","description":"The part of the request the finding came from. On a Shadow AI Device's scan: `current_turn` (the person's new message, its tool results and the tool calls they answer), `earlier_turn` (a turn already sent, redacted again because the app resends it), or `instructions` (the app's system or developer prompt, scanned for secrets only). On any caller's scan: `tool_definition`, for an entry of `context.tool_definitions`. Null otherwise.","uniqueKey":"threats.items.[INDEX].segment.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].segment","typeLabel":"string | null"},"status":{"type":"string","enum":["active","candidate","suppressed"],"title":"FindingStatus","description":"Whether this finding decides. `active`: it does, and is what `decision`, `confidence` and `threat_type` report. `candidate`: a Candidate rule matched. It is recorded so the rule can be measured on live traffic, and it never changes the decision, the score or the threat type; a `candidate` threat can appear on an `allow`. `suppressed`: one of the project's Suppressions silenced the rule, so it is recorded and decides nothing, and another rule may decide instead. Decide on `decision`, never on whether `threats` is empty.","default":"active","uniqueKey":"threats.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"threshold":{"oneOf":[{"type":"object","title":"AppliedThreshold","description":"The warn and block thresholds this finding's score was compared with, when the project set them for its detector (#970): which band it fell in, both thresholds and the score. A `warn` band finding appears on an `allow`: it was reported, not enforced. Null when the detector has no thresholds configured and decided as it always has, and on a finding that did not decide.","required":["band","warn","block","score"],"properties":{"band":{"type":"string","enum":["warn","block"],"title":"Band","description":"`block`: the score reached `block`, and the finding blocked. `warn`: the score reached `warn` but not `block`, so the finding was reported and the request allowed (the event is stored as `flag`).","isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.band","typeLabel":"enum\u003cstring>"},"warn":{"oneOf":[{"type":"number","title":"Warn","description":"The detector's warn threshold, or null when it has only a block band.","isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.warn.oneOf.0","typeLabel":"number"},{"type":"null","title":"Warn","description":"The detector's warn threshold, or null when it has only a block band.","isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.warn.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.warn","typeLabel":"number | null"},"block":{"type":"number","title":"Block","description":"The detector's block threshold.","isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.block","typeLabel":"number"},"score":{"type":"number","title":"Score","description":"The score compared with the thresholds: the weighted score where the detector reports one, otherwise its confidence.","isRequired":true,"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0.score","typeLabel":"number"}},"uniqueKey":"threats.items.[INDEX].threshold.oneOf.0","typeLabel":"AppliedThreshold · object"},{"type":"null","description":"The warn and block thresholds this finding's score was compared with, when the project set them for its detector (#970): which band it fell in, both thresholds and the score. A `warn` band finding appears on an `allow`: it was reported, not enforced. Null when the detector has no thresholds configured and decided as it always has, and on a finding that did not decide.","uniqueKey":"threats.items.[INDEX].threshold.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].threshold","typeLabel":"AppliedThreshold · object | null"},"flagged":{"type":"boolean","title":"Flagged","description":"True when this finding flagged: it was reported and not enforced. A warn band raised it (`threshold` says so), a custom policy rule or LLM guard whose action is `flag`, an agentic judge's `flag`, or a detector in `flag` mode. A flagged finding can sit beside the `block` or `redact` that decided; it never changes `decision`.","default":false,"uniqueKey":"threats.items.[INDEX].flagged","typeLabel":"boolean"},"match_sha256":{"oneOf":[{"type":"string","title":"Match Sha256","description":"Lowercase hex SHA-256 of the UTF-8 text this finding's rule matched: the `match_sha256` a Suppression names to silence the rule for that text only. Null when the rule cannot be suppressed, or the finding has no one matched text (a redaction by type).","uniqueKey":"threats.items.[INDEX].match_sha256.oneOf.0","typeLabel":"string"},{"type":"null","title":"Match Sha256","description":"Lowercase hex SHA-256 of the UTF-8 text this finding's rule matched: the `match_sha256` a Suppression names to silence the rule for that text only. Null when the rule cannot be suppressed, or the finding has no one matched text (a redaction by type).","uniqueKey":"threats.items.[INDEX].match_sha256.oneOf.1","typeLabel":"null"}],"uniqueKey":"threats.items.[INDEX].match_sha256","typeLabel":"string | null"}},"type":"object","required":["type","confidence","details"],"title":"ThreatDetail","description":"Individual threat found during scanning.","uniqueKey":"threats.items.[INDEX]","typeLabel":"ThreatDetail · object"},"type":"array","title":"Threats","description":"Detailed threat breakdown","uniqueKey":"threats","typeLabel":"ThreatDetail · object[]"},"flagged":{"type":"boolean","title":"Flagged","description":"True when a finding flagged: allowed, reported, not enforced. The flagged findings are in `threats` with `flagged: true`, each with its threat type and rule. `decision` stays `allow` for a flag that decided, so a client that does not read this field lets the traffic through as before; on a `block` or `redact` it says a flag was also found. The event is stored with the decision `flag`.","default":false,"uniqueKey":"flagged","typeLabel":"boolean"},"detectors_agreeing":{"type":"integer","title":"Detectors Agreeing","description":"On a `block`, how many independent detectors found the threat that decided it: 1 when one detector's verdict alone decided, 2 or more when others agreed. Counted by detector, not rule. 0 on anything but a `block`. A Shadow AI Device coaches rather than blocks a block resting on one detector (`basis` `detectors` and 1 here): the person may send it anyway, with a reason.","default":0,"uniqueKey":"detectors_agreeing","typeLabel":"integer"},"basis":{"oneOf":[{"type":"string","title":"Basis","description":"On a `block`, what it rests on: `secret` (a credential), `organisation_rule` (a policy, rule or pattern the organisation wrote), or `detectors` (the built-in detectors, as many as `detectors_agreeing` says). Null on anything but a `block`.","enum":["secret","organisation_rule","detectors"],"uniqueKey":"basis.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Basis","description":"On a `block`, what it rests on: `secret` (a credential), `organisation_rule` (a policy, rule or pattern the organisation wrote), or `detectors` (the built-in detectors, as many as `detectors_agreeing` says). Null on anything but a `block`.","uniqueKey":"basis.oneOf.1","typeLabel":"null"}],"uniqueKey":"basis","typeLabel":"enum\u003cstring> | null"},"unscanned":{"items":{"properties":{"index":{"type":"integer","title":"Index","description":"Position within the list the reason names, the combined attachment list; the request's tool calls for `unsupported_tool_call` (`context.tool_calls` first, then each message's in order); `messages` for `over_size_budget`. -1 when the part has no position, which is every `unsupported_block`.","isRequired":true,"uniqueKey":"unscanned.items.[INDEX].index","typeLabel":"integer"},"reason":{"type":"string","title":"Reason","description":"Stable machine-readable code","isRequired":true,"uniqueKey":"unscanned.items.[INDEX].reason","typeLabel":"string"},"detail":{"type":"string","title":"Detail","description":"Reason with any extra qualifier, e.g. 'no_text_extracted:pages=3'","isRequired":true,"uniqueKey":"unscanned.items.[INDEX].detail","typeLabel":"string"}},"type":"object","required":["index","reason","detail"],"title":"UnscannedAttachment","description":"One part of the request we could not read, and why.","uniqueKey":"unscanned.items.[INDEX]","typeLabel":"UnscannedAttachment · object"},"type":"array","title":"Unscanned","description":"Parts that reached us and were not read: they produced nothing to scan, or the scan budget was spent first. An `allow` with a non-empty `unscanned` is NOT 'this content is clean', it is 'the text was clean and these parts were never read'. Reasons: url_only (we do not fetch caller-supplied URLs, that would be an SSRF primitive), file_id_unsupported, encrypted, no_text_extracted (a scanned/rasterised document), too_large, undecodable, unsupported_type, extractor_unavailable, unsupported_block, unsupported_tool_call (a tool call in none of the shapes we can read: `index` is its position among the request's tool calls), over_size_budget (a message older than the newest ones that filled the scan budget: `index` is its position in `messages`; it was not read on this call, and was the newest turn of an earlier one).","uniqueKey":"unscanned","typeLabel":"UnscannedAttachment · object[]"},"unavailable":{"items":{"properties":{"detector":{"type":"string","title":"Detector","description":"Stable detector name, e.g. 'jailbreak_judge'.","isRequired":true,"uniqueKey":"unavailable.items.[INDEX].detector","typeLabel":"string"},"reason":{"type":"string","title":"Reason","description":"Why it cannot run: ml_inference_off (ML_INFERENCE_MODE=off), ml_inference_not_configured (no inference endpoint or token), ml_inference_mode_unsupported (a mode this detector does not implement), llm_judge_not_configured (no LLM judge endpoint), model_not_bundled (an in-process model artifact is missing).","isRequired":true,"uniqueKey":"unavailable.items.[INDEX].reason","typeLabel":"string"}},"type":"object","required":["detector","reason"],"title":"UnavailableCheck","description":"One detector the deployment cannot run, and why.","uniqueKey":"unavailable.items.[INDEX]","typeLabel":"UnavailableCheck · object"},"type":"array","title":"Unavailable","description":"Unavailable checks: detectors this scan would have run but the deployment cannot, because their backing service (an ML inference endpoint, an LLM judge, a bundled model) is not configured. An `allow` with a non-empty `unavailable` is NOT 'every check passed', these detectors never looked. A detector that ran and found nothing is not listed, and neither is one the project's plan or guardrail settings leave out.","uniqueKey":"unavailable","typeLabel":"UnavailableCheck · object[]"},"skipped":{"items":{"properties":{"type":{"type":"string","title":"Type","description":"The detector type of the match, e.g. `email`.","isRequired":true,"uniqueKey":"skipped.items.[INDEX].type","typeLabel":"string"},"reason":{"type":"string","title":"Reason","description":"Why it was left in the text, a stable code. `reserved_domain`: an email at a domain reserved for documentation and testing by RFC 2606 and RFC 6761 (`example.com`, `example.net`, `example.org`, and any domain ending `.example`, `.test`, `.invalid` or `.localhost`), which cannot be a person's address. Test redaction with an address at a real-looking domain. A client that does not recognise a code must still treat the match as left in the text.","examples":["reserved_domain"],"isRequired":true,"uniqueKey":"skipped.items.[INDEX].reason","typeLabel":"string"}},"type":"object","required":["type","reason"],"title":"SkippedMatch","description":"One match a detector found and deliberately did not act on.","uniqueKey":"skipped.items.[INDEX]","typeLabel":"SkippedMatch · object"},"type":"array","title":"Skipped","description":"Matches deliberately not redacted, one entry per match, in the order found; an empty list when there were none. The text of a skipped match is left as it was. Reported for the text the scan's PII pass read; empty when the Project's guardrails run none.","examples":[[{"reason":"reserved_domain","type":"email"}]],"uniqueKey":"skipped","typeLabel":"SkippedMatch · object[]"},"requests_counted":{"type":"integer","title":"Requests Counted","description":"How many Requests this call counted as toward the monthly allowance: 1 for a scan, whatever its length. 0 for a call that is not a scan: a findings-only report, a doctor probe or an Override.","default":0,"uniqueKey":"requests_counted","typeLabel":"integer"},"billed_tokens":{"type":"integer","title":"Billed Tokens","description":"The tokens of content this call scanned, counted with the `cl100k_base` tokenizer whatever model the content is for: each scanned text is encoded on its own and the counts are added. What is scanned is the messages read with their tool calls, retrieved context and Tool definitions; for a Shadow AI Device, the Current turn, the Instructions and the Tool definitions not already checked, never an Earlier turn. Reported, not yet charged for. 0 for a call that is not a scan.","default":0,"uniqueKey":"billed_tokens","typeLabel":"integer"},"detection_level":{"type":"string","const":"deep","title":"Detection Level","description":"The Detection level this call ran at: always `deep`, every detector including the LLM judges. Every plan runs the full engine and is billed at one list price, per call and per Billed token.","default":"deep","uniqueKey":"detection_level","typeLabel":"string"},"entitlement":{"oneOf":[{"type":"object","title":"GuardEntitlement","description":"What this account is entitled to, at the instant this scan was answered. Null when the engine cannot say, an account with no subscription row, an admin key that bypasses the counter, or a row it could not read. Null is 'unknown', NOT 'unentitled': a client that reads it as a limit has invented a refusal the engine never made.","required":["plan","seats","scans_used","scan_allowance","mode","as_of"],"properties":{"plan":{"type":"string","title":"Plan","description":"Plan identifier, e.g. 'free', 'shadow_team'","isRequired":true,"uniqueKey":"entitlement.oneOf.0.plan","typeLabel":"string"},"seats":{"type":"integer","title":"Seats","description":"Seats on the subscription, mirrored from the Stripe quantity. Always 1 on a flat-rate Plan, which does not bill per seat.","isRequired":true,"uniqueKey":"entitlement.oneOf.0.seats","typeLabel":"integer"},"scans_used":{"type":"integer","title":"Scans Used","description":"Scans counted against the org's pool this month, INCLUDING the one being answered.","isRequired":true,"uniqueKey":"entitlement.oneOf.0.scans_used","typeLabel":"integer"},"scan_allowance":{"type":"integer","title":"Scan Allowance","description":"The month's pool. The enforced figure, not one recomputed from the Plan grid, so it carries a per-contract override where one exists.","isRequired":true,"uniqueKey":"entitlement.oneOf.0.scan_allowance","typeLabel":"integer"},"mode":{"type":"string","title":"Mode","description":"How the client should run: 'full' while the engine arbitrates, or 'redact_only' once the entitlement is spent or lapsed, where an on-device detection masks rather than refuses. A client that does not recognise the value must treat it as unknown and keep running as it was, never as a default.","isRequired":true,"uniqueKey":"entitlement.oneOf.0.mode","typeLabel":"string"},"as_of":{"type":"string","format":"date-time","title":"As Of","description":"When this reading was taken (UTC). Not the scan's timestamp.","isRequired":true,"uniqueKey":"entitlement.oneOf.0.as_of","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"entitlement.oneOf.0","typeLabel":"GuardEntitlement · object"},{"type":"null","description":"What this account is entitled to, at the instant this scan was answered. Null when the engine cannot say, an account with no subscription row, an admin key that bypasses the counter, or a row it could not read. Null is 'unknown', NOT 'unentitled': a client that reads it as a limit has invented a refusal the engine never made.","uniqueKey":"entitlement.oneOf.1","typeLabel":"null"}],"uniqueKey":"entitlement","typeLabel":"GuardEntitlement · object | null"}},"type":"object","required":["decision","event_id","confidence","latency_ms"],"title":"GuardResponse","description":"Response from the guard endpoint.","uniqueKey":"","typeLabel":"GuardResponse · object"},"example":{"decision":"block","event_id":"74d7d17b-eef7-4431-be48-cbb3e2392584","confidence":0.81,"weighted_score":null,"threat_type":"data_exfiltration","redacted_messages":null,"threats":[{"type":"data_exfiltration","confidence":0.81,"details":"Data exfiltration attempt: Data exfiltration attempt detected (rule d763c3b4)","weighted_score":null,"technique":"context-exfiltration.system-prompt-leak","rule":{"detector":"exfiltration","id":"show_system_prompt","suppressible":true},"segment":null,"status":"active","threshold":null,"flagged":false,"match_sha256":"2fb2b1a07e62a8a9fab2e923f0dc5e49f6595905da4b7d4c27b66b030fa5bdde"}],"flagged":false,"detectors_agreeing":3,"basis":"detectors","latency_ms":116.28,"unscanned":[],"unavailable":[],"entitlement":{"plan":"pro","seats":1,"scans_used":345,"scan_allowance":100000,"mode":"full","as_of":"2026-10-31T15:50:30.863343Z"}},"examples":{"Example":{"title":"Example","value":{"decision":"block","event_id":"74d7d17b-eef7-4431-be48-cbb3e2392584","confidence":0.81,"weighted_score":null,"threat_type":"data_exfiltration","redacted_messages":null,"threats":[{"type":"data_exfiltration","confidence":0.81,"details":"Data exfiltration attempt: Data exfiltration attempt detected (rule d763c3b4)","weighted_score":null,"technique":"context-exfiltration.system-prompt-leak","rule":{"detector":"exfiltration","id":"show_system_prompt","suppressible":true},"segment":null,"status":"active","threshold":null,"flagged":false,"match_sha256":"2fb2b1a07e62a8a9fab2e923f0dc5e49f6595905da4b7d4c27b66b030fa5bdde"}],"flagged":false,"detectors_agreeing":3,"basis":"detectors","latency_ms":116.28,"unscanned":[],"unavailable":[],"entitlement":{"plan":"pro","seats":1,"scans_used":345,"scan_allowance":100000,"mode":"full","as_of":"2026-10-31T15:50:30.863343Z"}}}},"exampleType":"examples"}},"exampleType":"examples"},"ebd23233-e673-42d5-aa51-a8f2caea1d06":{"description":"Missing, malformed, unknown, disabled or expired API key","content":{"application/json":{"examples":{"missing_api_key":{"title":"missing_api_key","summary":"No X-API-Key header","value":{"error":{"message":"PromptGuard API key required. Please provide via X-API-Key header.","type":"authentication_error","code":"missing_api_key","doc_url":"https://docs.promptguard.co/production/error-handling#missing_api_key"}}},"malformed_api_key":{"title":"malformed_api_key","summary":"Not a pg_live_ key","value":{"error":{"message":"Invalid API key format","type":"authentication_error","code":"invalid_api_key","doc_url":"https://docs.promptguard.co/production/error-handling#invalid_api_key"}}},"unknown_api_key":{"title":"unknown_api_key","summary":"No such key","value":{"error":{"message":"Invalid API key","type":"authentication_error","code":"invalid_api_key","doc_url":"https://docs.promptguard.co/production/error-handling#invalid_api_key"}}},"disabled_api_key":{"title":"disabled_api_key","summary":"Key disabled","value":{"error":{"message":"API key is disabled","type":"authentication_error","code":"disabled_api_key","doc_url":"https://docs.promptguard.co/production/error-handling#disabled_api_key"}}},"expired_api_key":{"title":"expired_api_key","summary":"Key expired","value":{"error":{"message":"API key has expired","type":"authentication_error","code":"expired_api_key","doc_url":"https://docs.promptguard.co/production/error-handling#expired_api_key"}}}},"schema":{"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","description":"Human-readable error description","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"Error category, e.g. 'authentication_error'","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"Machine-readable error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code"],"title":"ErrorDetail","examples":[{"code":"missing_api_key","message":"PromptGuard API key required. Please provide via X-API-Key header.","type":"authentication_error"}],"isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"AuthErrorEnvelope","uniqueKey":"","typeLabel":"AuthErrorEnvelope · object"},"exampleType":"examples"}},"exampleType":"examples"},"4e403bcf-c4fb-4bf2-8ca4-a570cce94b6d":{"description":"Refused by the key's scopes or the IP allowlist, or by a project access list","content":{"application/json":{"examples":{"scope_denied":{"title":"scope_denied","summary":"The key's scopes exclude this endpoint","value":{"error":{"message":"This endpoint needs the `scan:write` scope, which this API key does not hold. Create a key that includes it, or use an unrestricted key.","type":"insufficient_scope","code":"scope_denied","doc_url":"https://docs.promptguard.co/production/error-handling#scope_denied"}}},"scan_only_credential":{"title":"scan_only_credential","summary":"A scan-only device credential","value":{"error":{"message":"This credential is scan-only; endpoint not permitted.","type":"insufficient_scope","code":"scope_denied","doc_url":"https://docs.promptguard.co/production/error-handling#scope_denied"}}},"read_only_key":{"title":"read_only_key","summary":"A SIEM export key","value":{"error":{"message":"This is a read-only export key. It may only GET /api/v1/alerts, /api/v1/audit-events, /api/v1/audit-events/stream, /api/v1/interactions and /api/v1/interactions/stream.","type":"insufficient_scope","code":"read_only_key","doc_url":"https://docs.promptguard.co/production/error-handling#read_only_key"}}},"ip_not_allowed":{"title":"ip_not_allowed","summary":"Caller IP outside the allowlist","value":{"error":{"message":"Request IP is not in the organization's allowlist","type":"permission_error","code":"ip_not_allowed","doc_url":"https://docs.promptguard.co/production/error-handling#ip_not_allowed"}}},"ip_allowlist_error":{"title":"ip_allowlist_error","summary":"Allowlist could not be checked","value":{"error":{"message":"IP allowlist validation failed","type":"permission_error","code":"ip_allowlist_error","doc_url":"https://docs.promptguard.co/production/error-handling#ip_allowlist_error"}}},"access_list_block":{"title":"access_list_block","summary":"access_list_block","value":{"error":{"message":"Blocked by access list (ip=203.0.113.7)","type":"access_denied","code":"access_list_block","rule_id":"5b0c9a7e-2f1d-4c3b-9a8e-6d7f1e2a3b4c","target_type":"ip","doc_url":"https://docs.promptguard.co/production/error-handling#access_list_block"}}}},"schema":{"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","description":"Human-readable error description","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"Error category, e.g. 'authentication_error'","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"Machine-readable error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code"],"title":"ErrorDetail","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"exampleType":"examples"}},"exampleType":"examples"},"40e4a695-d30d-49b4-b6e2-38ff539d61c2":{"description":"Validation Error","content":{"application/json":{"schema":{"description":"The developer API's 422 (`shared/infrastructure/framework_errors.py`).","properties":{"error":{"properties":{"message":{"description":"The failed fields, one line","title":"Message","type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"description":"'invalid_request_error'","title":"Type","type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"description":"'invalid_request'","title":"Code","type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"details":{"description":"Each field that failed","items":{"description":"One field that failed validation, as FastAPI reports it.","properties":{"loc":{"description":"The field's path, e.g. ['body', 'messages']","items":{"oneOf":[{"type":"string","uniqueKey":"error.details.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.details.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"error.details.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"title":"Loc","type":"array","isRequired":true,"uniqueKey":"error.details.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"description":"What is wrong with it","title":"Msg","type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].msg","typeLabel":"string"},"type":{"description":"The kind of failure, e.g. 'missing'","title":"Type","type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].type","typeLabel":"string"},"input":{"default":null,"description":"The value that was sent","title":"Input","uniqueKey":"error.details.items.[INDEX].input","typeLabel":"any"},"ctx":{"oneOf":[{"type":"object","title":"Ctx","description":"The limit it broke, where there is one","additionalProperties":true,"uniqueKey":"error.details.items.[INDEX].ctx.oneOf.0","typeLabel":"Ctx · object"},{"type":"null","title":"Ctx","description":"The limit it broke, where there is one","uniqueKey":"error.details.items.[INDEX].ctx.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details.items.[INDEX].ctx","typeLabel":"Ctx · object | null"}},"required":["loc","msg","type"],"title":"ValidationErrorField","type":"object","uniqueKey":"error.details.items.[INDEX]","typeLabel":"ValidationErrorField · object"},"title":"Details","type":"array","isRequired":true,"uniqueKey":"error.details","typeLabel":"ValidationErrorField · object[]"},"error_id":{"oneOf":[{"type":"string","title":"Error Id","description":"Equals the X-Request-ID header","uniqueKey":"error.error_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Error Id","description":"Equals the X-Request-ID header","uniqueKey":"error.error_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.error_id","typeLabel":"string | null"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.doc_url","typeLabel":"string | null"}},"required":["message","type","code","details"],"title":"ValidationErrorDetail","type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"ValidationErrorDetail · object"},"detail":{"deprecated":true,"description":"The same list as `error.details`, in FastAPI's old shape. Removed on 2027-02-11; read `error.details`","items":{"description":"One field that failed validation, as FastAPI reports it.","properties":{"loc":{"description":"The field's path, e.g. ['body', 'messages']","items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"title":"Loc","type":"array","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"description":"What is wrong with it","title":"Msg","type":"string","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"description":"The kind of failure, e.g. 'missing'","title":"Type","type":"string","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"input":{"default":null,"description":"The value that was sent","title":"Input","uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"oneOf":[{"type":"object","title":"Ctx","description":"The limit it broke, where there is one","additionalProperties":true,"uniqueKey":"detail.items.[INDEX].ctx.oneOf.0","typeLabel":"Ctx · object"},{"type":"null","title":"Ctx","description":"The limit it broke, where there is one","uniqueKey":"detail.items.[INDEX].ctx.oneOf.1","typeLabel":"null"}],"uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Ctx · object | null"}},"required":["loc","msg","type"],"title":"ValidationErrorField","type":"object","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationErrorField · object"},"title":"Detail","type":"array","isRequired":true,"uniqueKey":"detail","typeLabel":"ValidationErrorField · object[]"}},"required":["error","detail"],"title":"ValidationErrorEnvelope","type":"object","example":{"error":{"message":"The request is invalid: body.messages: Field required","type":"invalid_request_error","code":"invalid_request","details":[{"type":"missing","loc":["body","messages"],"msg":"Field required","input":{"direction":"input"}}],"error_id":"3f0b8c1e-6a0e-4d52-9a57-0c2a9a7f5b11","doc_url":"https://docs.promptguard.co/production/error-handling#invalid_request"},"detail":[{"type":"missing","loc":["body","messages"],"msg":"Field required","input":{"direction":"input"}}]},"uniqueKey":"","typeLabel":"ValidationErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The request is invalid: body.messages: Field required","type":"invalid_request_error","code":"invalid_request","details":[{"type":"missing","loc":["body","messages"],"msg":"Field required","input":{"direction":"input"}}],"error_id":"3f0b8c1e-6a0e-4d52-9a57-0c2a9a7f5b11","doc_url":"https://docs.promptguard.co/production/error-handling#invalid_request"},"detail":[{"type":"missing","loc":["body","messages"],"msg":"Field required","input":{"direction":"input"}}]}}},"exampleType":"generated"}},"exampleType":"generated"},"4357569d-dacb-4f51-9cd0-4c13f28dc64b":{"description":"Rate limit, monthly quota, the key's own monthly cap, spending limit, or an inactive subscription (branch on `error.code`)","content":{"application/json":{"examples":{"rate_limit_exceeded":{"title":"rate_limit_exceeded","summary":"Per-minute limit reached","value":{"error":{"message":"Rate limit exceeded: your plan allows 60 requests per minute. Please retry later.","type":"rate_limit_exceeded","code":"rate_limit_exceeded","retry_after":42,"doc_url":"https://docs.promptguard.co/production/error-handling#rate_limit_exceeded"}}},"api_key_request_cap_exceeded":{"title":"api_key_request_cap_exceeded","summary":"This key's own monthly request cap reached","value":{"error":{"message":"This API key's monthly cap of 10,000 requests is reached. It resets on December 1 (UTC). Raise or remove the cap in the dashboard, or use another key.","type":"quota_exceeded","code":"api_key_request_cap_exceeded","requests_limit":10000,"resets_at":"2026-12-01T00:00:00+00:00","retry_after":1209600,"doc_url":"https://docs.promptguard.co/production/error-handling#api_key_request_cap_exceeded"}}},"monthly_quota_exceeded":{"title":"monthly_quota_exceeded","summary":"Monthly request quota spent","value":{"error":{"message":"Monthly quota of 100,000 requests exceeded.","type":"quota_exceeded","code":"monthly_quota_exceeded","current_plan":"pro","requests_used":100000,"requests_limit":100000,"upgrade_url":"https://app.promptguard.co/dashboard/billing","retry_after":1209600,"doc_url":"https://docs.promptguard.co/production/error-handling#monthly_quota_exceeded"}}},"spending_limit_exceeded":{"title":"spending_limit_exceeded","summary":"Monthly spending limit reached","value":{"error":{"message":"Monthly spending limit of $500.00 exceeded.","type":"spending_limit_exceeded","code":"spending_limit_exceeded","current_plan":"scale","current_spending":500.12,"spending_limit":500,"settings_url":"https://app.promptguard.co/dashboard/spending","retry_after":1209600,"doc_url":"https://docs.promptguard.co/production/error-handling#spending_limit_exceeded"}}},"subscription_inactive":{"title":"subscription_inactive","summary":"Subscription not active; never retry","value":{"error":{"message":"Your pro subscription is not active (status: past_due).","type":"subscription_inactive","code":"subscription_inactive","current_plan":"pro","subscription_status":"past_due","reactivate_url":"https://app.promptguard.co/dashboard/billing","doc_url":"https://docs.promptguard.co/production/error-handling#subscription_inactive"}}}},"schema":{"oneOf":[{"type":"object","title":"RateLimitErrorEnvelope","required":["error"],"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"oneOf.0.error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"'rate_limit_exceeded'","isRequired":true,"uniqueKey":"oneOf.0.error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"'rate_limit_exceeded'","isRequired":true,"uniqueKey":"oneOf.0.error.code","typeLabel":"string"},"retry_after":{"type":"integer","title":"Retry After","description":"Seconds until the window resets; also `Retry-After`","isRequired":true,"uniqueKey":"oneOf.0.error.retry_after","typeLabel":"integer"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.0.error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.0.error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code","retry_after"],"title":"RateLimitErrorDetail","isRequired":true,"uniqueKey":"oneOf.0.error","typeLabel":"RateLimitErrorDetail · object"}},"uniqueKey":"oneOf.0","typeLabel":"RateLimitErrorEnvelope · object"},{"type":"object","title":"QuotaErrorEnvelope","required":["error"],"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"'quota_exceeded' or 'spending_limit_exceeded'","isRequired":true,"uniqueKey":"oneOf.1.error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"'monthly_quota_exceeded' or 'spending_limit_exceeded'","isRequired":true,"uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"current_plan":{"type":"string","title":"Current Plan","isRequired":true,"uniqueKey":"oneOf.1.error.current_plan","typeLabel":"string"},"requests_used":{"type":"integer","title":"Requests Used","isRequired":true,"uniqueKey":"oneOf.1.error.requests_used","typeLabel":"integer"},"requests_limit":{"oneOf":[{"type":"integer","title":"Requests Limit","description":"The month's Request allowance; null on a Plan sold in usage credit (ADR-0041), which reports `credit_*` instead","isRequired":true,"uniqueKey":"oneOf.1.error.requests_limit.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Requests Limit","description":"The month's Request allowance; null on a Plan sold in usage credit (ADR-0041), which reports `credit_*` instead","isRequired":true,"uniqueKey":"oneOf.1.error.requests_limit.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.error.requests_limit","typeLabel":"integer | null"},"upgrade_url":{"type":"string","title":"Upgrade Url","isRequired":true,"uniqueKey":"oneOf.1.error.upgrade_url","typeLabel":"string"},"credit_usd":{"oneOf":[{"type":"number","title":"Credit Usd","description":"The month's usage credit at list prices, in US dollars","uniqueKey":"oneOf.1.error.credit_usd.oneOf.0","typeLabel":"number"},{"type":"null","title":"Credit Usd","description":"The month's usage credit at list prices, in US dollars","uniqueKey":"oneOf.1.error.credit_usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.credit_usd","typeLabel":"number | null"},"credit_used_usd":{"oneOf":[{"type":"number","title":"Credit Used Usd","description":"What this month's Requests cost at list prices, in US dollars","uniqueKey":"oneOf.1.error.credit_used_usd.oneOf.0","typeLabel":"number"},{"type":"null","title":"Credit Used Usd","description":"What this month's Requests cost at list prices, in US dollars","uniqueKey":"oneOf.1.error.credit_used_usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.credit_used_usd","typeLabel":"number | null"},"credit_remaining_usd":{"oneOf":[{"type":"number","title":"Credit Remaining Usd","description":"The month's usage credit not yet spent, in US dollars","uniqueKey":"oneOf.1.error.credit_remaining_usd.oneOf.0","typeLabel":"number"},{"type":"null","title":"Credit Remaining Usd","description":"The month's usage credit not yet spent, in US dollars","uniqueKey":"oneOf.1.error.credit_remaining_usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.credit_remaining_usd","typeLabel":"number | null"},"retry_after":{"oneOf":[{"type":"integer","title":"Retry After","uniqueKey":"oneOf.1.error.retry_after.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Retry After","uniqueKey":"oneOf.1.error.retry_after.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.retry_after","typeLabel":"integer | null"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.1.error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.1.error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code","current_plan","requests_used","requests_limit","upgrade_url"],"title":"QuotaErrorDetail","isRequired":true,"uniqueKey":"oneOf.1.error","typeLabel":"QuotaErrorDetail · object"}},"uniqueKey":"oneOf.1","typeLabel":"QuotaErrorEnvelope · object"},{"type":"object","title":"KeyRequestCapErrorEnvelope","required":["error"],"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"oneOf.2.error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"'quota_exceeded'","isRequired":true,"uniqueKey":"oneOf.2.error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"'api_key_request_cap_exceeded'","isRequired":true,"uniqueKey":"oneOf.2.error.code","typeLabel":"string"},"requests_limit":{"type":"integer","title":"Requests Limit","description":"The key's monthly Request cap","isRequired":true,"uniqueKey":"oneOf.2.error.requests_limit","typeLabel":"integer"},"resets_at":{"type":"string","title":"Resets At","description":"When the cap resets: the first of next month, UTC","isRequired":true,"uniqueKey":"oneOf.2.error.resets_at","typeLabel":"string"},"retry_after":{"type":"integer","title":"Retry After","isRequired":true,"uniqueKey":"oneOf.2.error.retry_after","typeLabel":"integer"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.2.error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.2.error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.2.error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code","requests_limit","resets_at","retry_after"],"title":"KeyRequestCapErrorDetail","description":"One key past its own monthly Request cap (#1111), not the account's quota.\n\nDeliberately not ``QuotaErrorDetail``: nothing about the Plan was exceeded,\nso it names no Plan and offers no upgrade. The account's other keys are\nstill served.","isRequired":true,"uniqueKey":"oneOf.2.error","typeLabel":"KeyRequestCapErrorDetail · object"}},"uniqueKey":"oneOf.2","typeLabel":"KeyRequestCapErrorEnvelope · object"},{"type":"object","title":"SubscriptionInactiveErrorEnvelope","required":["error"],"properties":{"error":{"properties":{"message":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"oneOf.3.error.message","typeLabel":"string"},"type":{"type":"string","title":"Type","description":"'subscription_inactive'","isRequired":true,"uniqueKey":"oneOf.3.error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","description":"'subscription_inactive'","isRequired":true,"uniqueKey":"oneOf.3.error.code","typeLabel":"string"},"current_plan":{"type":"string","title":"Current Plan","isRequired":true,"uniqueKey":"oneOf.3.error.current_plan","typeLabel":"string"},"subscription_status":{"type":"string","title":"Subscription Status","description":"e.g. 'cancelled', 'past_due', 'paused'; 'none' where no plan covers the key's organization at all","isRequired":true,"uniqueKey":"oneOf.3.error.subscription_status","typeLabel":"string"},"reactivate_url":{"type":"string","title":"Reactivate Url","isRequired":true,"uniqueKey":"oneOf.3.error.reactivate_url","typeLabel":"string"},"doc_url":{"oneOf":[{"type":"string","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.3.error.doc_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Doc Url","description":"The error catalogue's entry for `code` (cause and fix); present when the catalogue documents the code","uniqueKey":"oneOf.3.error.doc_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.3.error.doc_url","typeLabel":"string | null"}},"type":"object","required":["message","type","code","current_plan","subscription_status","reactivate_url"],"title":"SubscriptionInactiveErrorDetail","description":"A refusal for the subscription's state, not for a spent quota.\n\nDeliberately not ``QuotaErrorDetail``: it carries no ``requests_used`` /\n``requests_limit`` (nothing was exceeded -- reporting them beside this\nmessage is the contradiction #565 was filed for), no ``retry_after``\n(waiting does not fix it), and no ``on_demand_url`` (pay-as-you-go on a dead\nsubscription is refused by design). One door, and it works.","isRequired":true,"uniqueKey":"oneOf.3.error","typeLabel":"SubscriptionInactiveErrorDetail · object"}},"uniqueKey":"oneOf.3","typeLabel":"SubscriptionInactiveErrorEnvelope · object"}],"uniqueKey":"","typeLabel":"RateLimitErrorEnvelope · object | QuotaErrorEnvelope · object | KeyRequestCapErrorEnvelope · object | SubscriptionInactiveErrorEnvelope · object"},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"d145d575-d9cd-4ad3-8d50-136df2fe469d":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"3322fcfd-2e1e-450b-9829-61a049baba57":{"url":"https://api.promptguard.co","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"X-API-Key","description":"PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"X-API-Key","type":"string","description":"PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"X-API-Key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"api-reference/openapi-developer.json"},"subdomain":"promptguard","siteName":"PromptGuard","title":"Guard Content - PromptGuard","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"api-reference/guard/guard-content.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Scan messages for security threats without proxying to an LLM. This is the primary endpoint for auto-instrumentation and framework callback integrations. It runs the same policy engine, ML ensemble, preset configuration, custom rules, and entitlements checks as the proxy pipeline. Use direction=\u0026quot;input\u0026quot; before sending messages to the LLM and direction=\u0026quot;output\u0026quot; after receiving a response. Returns a decision of allow, block, or redact along with detailed threat information and optional redacted messages. Guide: Guard API\">\u003cmeta data-mint-head name=\"application-name\" content=\"PromptGuard\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Guard Content - PromptGuard\">\u003cmeta data-mint-head property=\"og:description\" content=\"Scan messages for security threats without proxying to an LLM. This is the primary endpoint for auto-instrumentation and framework callback integrations. It runs the same policy engine, ML ensemble, preset configuration, custom rules, and entitlements checks as the proxy pipeline. Use direction=\u0026quot;input\u0026quot; before sending messages to the LLM and direction=\u0026quot;output\u0026quot; after receiving a response. Returns a decision of allow, block, or redact along with detailed threat information and optional redacted messages. Guide: Guard API\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PromptGuard Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.promptguard.co/api-reference/guard/guard-content\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://promptguard.mintlify.site/_mintlify/api/og/v2?division=guard\u0026amp;title=Guard+Content\u0026amp;description=Scan+messages+for+security+threats+without+proxying+to+an+LLM.%0A%0AThis+is+the+primary+endpoint+for+auto-instrumentation+and+framework%0Acallback+integrations.+It+ru\u0026amp;theme=e6f5a1cb5aa0e419d003f7b9\u0026amp;signature=a5de01d6c3ba9dd0160fb678804ae3655d7377e9a88631c467adcb3dc2b7311a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Guard Content - PromptGuard\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Scan messages for security threats without proxying to an LLM. This is the primary endpoint for auto-instrumentation and framework callback integrations. It runs the same policy engine, ML ensemble, preset configuration, custom rules, and entitlements checks as the proxy pipeline. Use direction=\u0026quot;input\u0026quot; before sending messages to the LLM and direction=\u0026quot;output\u0026quot; after receiving a response. Returns a decision of allow, block, or redact along with detailed threat information and optional redacted messages. Guide: Guard API\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://promptguard.mintlify.site/_mintlify/api/og/v2?division=guard\u0026amp;title=Guard+Content\u0026amp;description=Scan+messages+for+security+threats+without+proxying+to+an+LLM.%0A%0AThis+is+the+primary+endpoint+for+auto-instrumentation+and+framework%0Acallback+integrations.+It+ru\u0026amp;theme=e6f5a1cb5aa0e419d003f7b9\u0026amp;signature=a5de01d6c3ba9dd0160fb678804ae3655d7377e9a88631c467adcb3dc2b7311a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/promptguard/qMghc8kofYAB8Q5A/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PromptGuard\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B82F6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.promptguard.co/api-reference/guard/guard-content\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/guard/guard-content.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.promptguard.co/#organization\",\"name\":\"PromptGuard\",\"url\":\"https://docs.promptguard.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/promptguard/sBVZPqZYn263LC-L/logo/light.svg?fit=max\u0026auto=format\u0026n=sBVZPqZYn263LC-L\u0026q=85\u0026s=8bf0b3b1f4e6fcd571bd4fefce2cda92\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.promptguard.co#website\",\"name\":\"PromptGuard\",\"url\":\"https://docs.promptguard.co\",\"publisher\":{\"@id\":\"https://docs.promptguard.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.promptguard.co/api-reference/guard/guard-content#webpage\",\"url\":\"https://docs.promptguard.co/api-reference/guard/guard-content\",\"name\":\"Guard Content\",\"description\":\"Scan messages for security threats without proxying to an LLM. This is the primary endpoint for auto-instrumentation and framework callback integrations. It runs the same policy engine, ML ensemble, preset configuration, custom rules, and entitlements checks as the proxy pipeline. Use direction=\\\"input\\\" before sending messages to the LLM and direction=\\\"output\\\" after receiving a response. Returns a decision of allow, block, or redact along with detailed threat information and optional redacted messages. Guide: Guard API\",\"isPartOf\":{\"@id\":\"https://docs.promptguard.co#website\"},\"breadcrumb\":{\"@id\":\"https://docs.promptguard.co/api-reference/guard/guard-content#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.promptguard.co/api-reference/guard/guard-content#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PromptGuard\",\"item\":\"https://docs.promptguard.co\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guard Content\",\"item\":\"https://docs.promptguard.co/api-reference/guard/guard-content\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.promptguard.co/api-reference/guard/guard-content#apireference\",\"headline\":\"Guard Content\",\"name\":\"Guard Content\",\"description\":\"Scan messages for security threats without proxying to an LLM. This is the primary endpoint for auto-instrumentation and framework callback integrations. It runs the same policy engine, ML ensemble, preset configuration, custom rules, and entitlements checks as the proxy pipeline. Use direction=\\\"input\\\" before sending messages to the LLM and direction=\\\"output\\\" after receiving a response. Returns a decision of allow, block, or redact along with detailed threat information and optional redacted messages. Guide: Guard API\",\"url\":\"https://docs.promptguard.co/api-reference/guard/guard-content\",\"mainEntityOfPage\":{\"@id\":\"https://docs.promptguard.co/api-reference/guard/guard-content#webpage\"},\"publisher\":{\"@id\":\"https://docs.promptguard.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.promptguard.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PromptGuard\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PromptGuard\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/guard/guard-content.md","siteName":"PromptGuard","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"rectangle-terminal","href":"https://app.promptguard.co"},{"anchor":"Blog","icon":"newspaper","href":"https://promptguard.co/blog"}]},"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","icon":"square-terminal","groups":[{"group":"Overview","icon":"rocket","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"group":"Endpoints","icon":"server","pages":[{"title":"Guard API","href":"/api-reference/guard"},{"title":"Security Scan, Redact \u0026 Test","href":"/api-reference/security-endpoints"},{"title":"Agent Security API","href":"/api-reference/agent-security"},{"title":"MCP Manifest Scan","href":"/api-reference/mcp-manifest-scan"},{"title":"API Keys Management","href":"/api-reference/api-keys"}]},{"group":"SDK Reference","icon":"code","pages":[{"title":"Python SDK reference","href":"/sdk-reference/python"},{"title":"Node.js SDK reference","href":"/sdk-reference/node"}]},{"group":"API Reference","pages":[{"title":"Proxy Chat Completions","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/chat/completions","href":"/api-reference/proxy-chat-completions"},{"title":"Proxy Messages","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/messages","href":"/api-reference/proxy-messages"},{"title":"Proxy Responses","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/responses","href":"/api-reference/proxy-responses"},{"title":"Proxy Count Tokens","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/messages/count_tokens","href":"/api-reference/proxy-count-tokens"},{"title":"Proxy Models","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/models","href":"/api-reference/proxy-models"},{"title":"Root","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /","href":"/api-reference/root"},{"title":"Health","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /health","href":"/api-reference/health"},{"title":"Version","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /version","href":"/api-reference/version"}]},{"group":"api-keys","pages":[{"title":"List Api Keys","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/api-keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create Api Key","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/api-keys","href":"/api-reference/api-keys/create-api-key"},{"title":"Delete Api Key","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json delete /api/v1/api-keys/{key_id}","href":"/api-reference/api-keys/delete-api-key"},{"title":"Toggle Api Key","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json put /api/v1/api-keys/{key_id}/toggle","href":"/api-reference/api-keys/toggle-api-key"}]},{"group":"usage","pages":[{"title":"Get Usage Stats","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/usage/stats","href":"/api-reference/usage/get-usage-stats"}]},{"group":"projects","pages":[{"title":"List Projects","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/projects","href":"/api-reference/projects/list-projects"},{"title":"Create Project","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/projects","href":"/api-reference/projects/create-project"},{"title":"Get Project","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/projects/{project_id}","href":"/api-reference/projects/get-project"},{"title":"Delete Project","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json delete /api/v1/projects/{project_id}","href":"/api-reference/projects/delete-project"}]},{"group":"SIEM export","pages":[{"title":"Export Alerts","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/alerts","href":"/api-reference/siem-export/export-alerts"},{"title":"Export Interactions","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/interactions","href":"/api-reference/siem-export/export-interactions"},{"title":"Stream Interactions","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/interactions/stream","href":"/api-reference/siem-export/stream-interactions"},{"title":"Export Audit Events","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/audit-events","href":"/api-reference/siem-export/export-audit-events"},{"title":"Stream Audit Events","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/audit-events/stream","href":"/api-reference/siem-export/stream-audit-events"}]},{"group":"guardrails","pages":[{"title":"Get Project Guardrails","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/projects/{project_id}/guardrails","href":"/api-reference/guardrails/get-project-guardrails"},{"title":"Update Project Guardrails","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json put /api/v1/projects/{project_id}/guardrails","href":"/api-reference/guardrails/update-project-guardrails"}]},{"group":"fleet-device","pages":[{"title":"List Own Org Devices","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/fleet/devices","href":"/api-reference/fleet-device/list-own-org-devices"},{"title":"Describe Own Identity","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/fleet/identity","href":"/api-reference/fleet-device/describe-own-identity"},{"title":"Revoke Self","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json delete /api/v1/fleet/devices/self","href":"/api-reference/fleet-device/revoke-self"},{"title":"Issue Device Certificate","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/fleet/device-certificate","href":"/api-reference/fleet-device/issue-device-certificate"}]},{"group":"agent","pages":[{"title":"Validate Tool Call","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/agent/validate-tool","href":"/api-reference/agent/validate-tool-call"},{"title":"Ingest Agent Trace","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/agent/trace","href":"/api-reference/agent/ingest-agent-trace"},{"title":"Scan Agent Memory","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/agent/memory","href":"/api-reference/agent/scan-agent-memory"},{"title":"Get Agent Stats","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/agent/{agent_id}/stats","href":"/api-reference/agent/get-agent-stats"},{"title":"End Agent Session","deprecated":true,"version":null,"openapi":"/api-reference/openapi-developer.json delete /api/v1/agent/{agent_id}/session/{session_id}","href":"/api-reference/agent/end-agent-session"},{"title":"Agent Security Health","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/agent/health","href":"/api-reference/agent/agent-security-health"},{"title":"Managed Policy","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/agent/managed-policy","href":"/api-reference/agent/managed-policy"}]},{"group":"security","pages":[{"title":"Scan Content","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/security/scan","href":"/api-reference/security/scan-content"},{"title":"Redact Content","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/security/redact","href":"/api-reference/security/redact-content"}]},{"group":"mcp","pages":[{"title":"Scan Mcp Manifest","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/mcp/manifest-scan","href":"/api-reference/mcp/scan-mcp-manifest"}]},{"group":"security-testing","pages":[{"title":"Run All Tests","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/security-testing/run-all","href":"/api-reference/security-testing/run-all-tests"},{"title":"Run Custom Test","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/security-testing/run-custom","href":"/api-reference/security-testing/run-custom-test"},{"title":"List Tests Route","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/security-testing/tests","href":"/api-reference/security-testing/list-tests-route"},{"title":"Run Named Test","description":"Run a single named attack from the corpus.\n\nGuide: [Security Scan, Redact \u0026 Test](https://docs.promptguard.co/api-reference/security-endpoints#security-testing-red-team-endpoints)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/security-testing/run/{test_name}","href":"/api-reference/security-testing/run-named-test"}]},{"group":"guard","pages":[{"title":"Guard Content","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/guard","href":"/api-reference/guard/guard-content"}]},{"group":"enroll","pages":[{"title":"Enroll Device","description":"Guide: [Enroll your team's devices](https://docs.promptguard.co/shadow-ai/fleet-enrollment)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/enroll","href":"/api-reference/enroll/enroll-device"}]},{"group":"shadow-exceptions","pages":[{"title":"List Exceptions","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/exceptions","href":"/api-reference/shadow-exceptions/list-exceptions"},{"title":"Create Exception","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/exceptions","href":"/api-reference/shadow-exceptions/create-exception"},{"title":"List Active Grants","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/exceptions/active","href":"/api-reference/shadow-exceptions/list-active-grants"},{"title":"Get Exception","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/exceptions/{exception_id}","href":"/api-reference/shadow-exceptions/get-exception"},{"title":"Cancel Exception","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/exceptions/{exception_id}/cancel","href":"/api-reference/shadow-exceptions/cancel-exception"}]},{"group":"policies","pages":[{"title":"List Policies","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/policies","href":"/api-reference/policies/list-policies"}]},{"group":"overlays","pages":[{"title":"Preview Overlay","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/overlays/preview","href":"/api-reference/overlays/preview-overlay"},{"title":"Apply Overlay Endpoint","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/overlays/apply","href":"/api-reference/overlays/apply-overlay-endpoint"},{"title":"Get Active Overlay","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/overlays/active","href":"/api-reference/overlays/get-active-overlay"}]},{"group":"tool-requests","pages":[{"title":"List Tool Requests","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json get /api/v1/tool-requests","href":"/api-reference/tool-requests/list-tool-requests"},{"title":"Create Tool Request","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/tool-requests","href":"/api-reference/tool-requests/create-tool-request"},{"title":"Cancel Tool Request","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/tool-requests/{request_id}/cancel","href":"/api-reference/tool-requests/cancel-tool-request"}]},{"group":"GitHub Webhooks","pages":[{"title":"Handle Webhook","deprecated":null,"version":null,"openapi":"/api-reference/openapi-developer.json post /api/v1/github/webhook","href":"/api-reference/github-webhooks/handle-webhook"}]}]}]},"basePath":"","title":"Guard Content - PromptGuard","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js","Markdown-CK5C-fmV.js","AssistantPageLink-Cw134Dd-.js","dist-3xM3Qrc7.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}