remote_reviewer() creates a reviewer function backed by an HTTP endpoint.
It is intended for teams that already have a policy service, review gateway,
or hosted model wrapper that returns llmshieldr-compatible JSON findings.
Usage
remote_reviewer(
url,
headers = list(),
body_field = "prompt",
response_path = NULL,
timeout = 30
)Value
A reviewer function suitable for reviewer = in scan_prompt(),
scan_output(), scan_context(), or secure_chat().
Details
The returned function accepts the reviewer prompt generated by llmshieldr and
sends a JSON body to url. By default, the body is:
The endpoint may return either a JSON response body or plain text containing
JSON. If the response body is JSON and response_path is supplied, the value
at that path is extracted before returning to the scanner. Otherwise the
response body is returned as text and parsed by llmshieldr's semantic-review
JSON extraction logic.
This helper requires the optional httr2 package and performs no network
calls until the reviewer function is invoked.
Examples
if (FALSE) { # \dontrun{
reviewer <- remote_reviewer(
"https://policy.example.com/review",
headers = c(Authorization = "Bearer <token>")
)
scan_prompt("Review me", reviewer = reviewer, checks = "llm")
} # }
