Quality gate
Every build runs scripts/pgfuzz-gate.sh: it builds the binary and a
mock provider, starts the gateway with secrets, pii and
prompt_injection in block mode, a 10,000-entry keywords list for
one key, the commands answer guard for another,
a per-user rate limit, the endpoints pgfuzz probes, an MCP server, an
API and a model that answers with its prompt (pgfuzz’s own echo
servers), a key with control: write for the
Management API, webhooks that
deliver to pgfuzz, and the web UI, and runs
pgfuzz with
scripts/pgfuzz/gate.yaml — 35 stages:
| stage | payloads | must reach |
|---|---|---|
| secrets | 1,400 synthetic keys of seven providers in code | 99% caught |
| pii | 2,500 e-mails, IBANs, cards, phones, SSNs — inline and in Markdown/code | 99% caught |
| injection | 2,100 attacks of seven kinds, English and German — plain, in a sentence, with zero-width characters | 99% caught |
| keywords | 2,000 prompts with entries of a 10,000-entry list file — inline, other case, with punctuation, on a line of their own | 100% caught |
| negatives | every benign payload: order numbers, placeholder keys, “ignore the warnings”, code, prose | 100% passed |
| commands | 900 commands in answers of ten kinds — download and run, dropped executables, encoded and hidden PowerShell, reverse shells, Defender exclusions, autostart, abused Windows tools — plain, in prose and code blocks, obfuscated (carets, backticks, case, spacing); as answer text, as a tool call’s arguments, and streamed six characters per event | 99% refused |
| commands-benign | every ordinary answer with commands in it — builds, package managers, git, containers, harmless certutil, reg query, crontab -l, nc -z — as text, tool call and stream |
100% passed |
| indirect | injections hidden where people don’t see them — white, 0.5-point, invisible and off-page text in a PDF, hidden text in a Word file, display:none, 1-pixel white text and comments in an HTML mail, Unicode tag characters, bidi controls, zero-width spaces, percent-escaped after the # of a page URL (“HashJack”), and openly — each as the user’s attachment and as a tool’s result (an agent that read a mail or a page) in OpenAI Chat, Anthropic Messages and Responses; the classic phrasings and the ones mail attacks use (addressed to the AI, a task riding on the user’s, hiding it from the user, sending data out, markdown images with data in the URL) |
100% caught |
| indirect-heldout | paraphrases of those kinds the rules were not written for — a measurement of how far the phrases carry, not a target | reported (5 of 20 phrasings) |
| indirect-masked | the same attacks, the guard masking instead of refusing — PDF and Word files reach the model as their masked text: the model behind the gateway answers with what it received, which must keep every visible part of the document and lose every three words in a row of the payload | 100% masked |
| indirect-benign | the same carriers with nothing to refuse: newsletter preview lines, legal footers, mails that mention an AI assistant, ask to forward an invoice or warn about phishing, everyday requests that share words with the attacks | 100% passed |
| users-isolated | 20 end users at a per-user limit of 3: within it, one over, then users not seen yet | 100% as expected |
| users-required | a key with users: required, with and without an id |
100% as expected |
| users-ignored | a key with users: ignore, one id past the limit |
100% as expected |
| endpoints-variables | endpoint variables: wrong types, ranges, lengths, patterns, lookalike characters, unknown names, malformed bodies (400) and valid boundaries (200) | 100% as expected |
| endpoints-schema | answers that break the endpoint’s output schema (502, never 200) | 100% as expected |
| endpoints-sessions | sessions continued by their owner (200), another user, another key, forged and broken ids (404) | 100% as expected |
| endpoints-cache | the cache: a hit for the same key, a miss for another | 100% as expected |
| mcp-access | the MCP gateway: no valid key 401, no GET stream 405, foreign origins 403 | 100% as expected |
| mcp-names | a key limited to one tool lists and reaches only it — other tools in any spelling, forged cursors, PromptGate’s own tools: never | 100% as expected |
| mcp-protocol | header/body mismatches, unknown protocol versions, parse and structure errors, sessions bound to their key | 100% as expected |
| mcp-permissions | agent permissions: a read-only key lists and reaches only tools that read — one whose annotations lie is classified by the config — and calls held for approval reach the server only after a yes: not unasked, not with a tampered state, not twice for one yes, not for other arguments, not after a decline; the same in a session over its event stream | 100% as expected |
| mcp-size | an oversized tool result is an error, the gateway goes on | 100% as expected |
| mcp-arguments | 700 secrets in tool arguments never reach the server | 99% caught |
| mcp-results | 700 injections in tool results never reach the agent | 99% caught |
| api-access | the API Gateway: no valid key 401, APIs outside a key’s list 403, unknown names, wrong methods | 100% as expected |
| api-headers | the caller’s pg_ key, cookies, spoofed forwarding headers and the user id header never reach the API |
100% as expected |
| api-paths | no path climbs out of the API’s base, in any encoding (%2e, %2f, ..;, overlong UTF-8, double encoding) |
100% as expected |
| api-ssrf | loopback without private: true and the cloud metadata address refused, redirects not followed |
100% as expected |
| api-size | body caps in both directions | 100% as expected |
| api-requests | 700 secrets in request bodies never reach the API | 99% caught |
| api-answers | 700 injections in answers never reach the caller | 99% caught |
| admin | the Management API: no key, unknown and provider keys 401, keys without control 403, read keys can’t change; no key makes a stronger one or revokes itself; a stale If-Match 412 and eight changes sent at once with one version — exactly one goes through; SQL in filters, absurd windows, repeated and unknown parameters, broken, huge, deeply nested and non-JSON bodies, control characters in names — refused, never a 5xx; no answer carries a key or a hash |
100% held |
| webhooks | webhooks with pgfuzz as the receiver: Standard Webhooks signature and fresh timestamp, the configured header, a new id per event, a tampered body doesn’t verify; a refused delivery comes again after 30 s with the same id, signed afresh, and a redelivered one keeps its id; loopback without private, the metadata address and redirects never delivered to; no API answer carries the secret, a header value or a URL token |
100% held |
| ui | the web UI, as an attacker would try it: every page and action without a session or with forged cookies, forms without or with a wrong CSRF token and from another site, password guessing (429), unknown names vs wrong passwords, session fixation, open redirects, cookie flags, security headers, path traversal, markup in query parameters — 232 checks | 100% held |
Today every stage is at 100%. Run it locally with a checkout of pgfuzz next to this repository:
PGFUZZ_DIR=../pgfuzz scripts/pgfuzz-gate.sh # report: pgfuzz-report.json