Check payload
check_payloadTest a synthetic request against guard-core's detection engine to confirm attack payloads are caught or diagnose why benign requests are flagged.
Instructions
Run one synthetic request through guard-core's real penetration-detection engine.
Use this to confirm that an attack payload is caught, or to explain why a benign request was flagged. Use validate_config instead to check a config, not a request.
Returns is_threat (bool), trigger_info (the matched parameter and pattern, empty when clean), threat_categories (for example sqli or xss), threat_scores (a score per category) and elapsed_ms. Verdicts come from the same detection path a live adapter runs. Read-only and sandboxed: the request is never sent anywhere and enable_redis is forced off so Redis is never touched. If guard-core is not installed, returns an object with an error key and a hint instead of raising.
This is the detection stage alone, not the whole middleware pipeline. A real request also passes IP rules, rate limiting, user-agent and cloud-provider checks, any of which can block it before detection runs, and a whitelisted IP skips detection entirely. A clean verdict here does not promise the request reaches the route, and a threat verdict does not promise a running app would block it.
The scan is bounded, so a payload past a cap is judged on the scanned prefix only: detection_max_scan_values caps values inspected (default 512), detection_max_scan_chars caps total characters scanned (default 65536), and detection_max_json_depth (default 32) caps how deep a JSON body is walked before the rest is scanned as one serialized value. These caps and the enhanced detection path apply from guard-core 3.15.0; versions reports what is installed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Request body as a raw string, or a JSON object or array, which is serialized for you. Omit for a bodyless request | |
| path | No | Request path of the request to test | / |
| query | No | Query-string parameters as a JSON object of names to string values | |
| config | No | SecurityConfig fields to override guard-core's defaults, as a JSON object, to see how a setting changes the verdict. enable_redis is always forced off | |
| method | No | HTTP method of the request to test | GET |
| headers | No | Request headers as a JSON object of names to values. Names are matched case-insensitively |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||