Skip to content
Last updated December 3, 2026

PromptGate 0.8 — changelog

Archived from CHANGELOG.md, which keeps the unreleased changes and, until the next release, the latest one.

  • Claude Code with a Claude subscription. Claude Code signed in with Pro or Max sends an OAuth access token (sk-ant-oat…), which Anthropic accepts only as Authorization: Bearer. Passthrough sent every Anthropic key as x-api-key, so each request came back 401 and Claude Code retried until it gave up. Subscription tokens now go out as bearer tokens; API keys are unchanged. Live-tested with Claude Code 2.1 on a subscription.

The API Gateway release: agents and apps call more than models and MCP servers — GitHub, Jira, Salesforce, an internal service — and until now every one of them carried long-lived tokens and bypassed the log. PromptGate now serves those APIs on /api/<name>/… behind the same pg_ keys: the API’s credential — a static header or an OAuth token — lives only in PromptGate, every call is logged and rate-limited, the guardrails read request bodies and answers, and an SSRF check at dial time keeps configured URLs from becoming a door into the network PromptGate runs in. OAuth connections hold the tokens — 30 providers with v1’s mistakes fixed (PKCE sent, the right client authentication, refresh tokens at all), sealed with AES-256-GCM, renewed before they expire — for APIs and for remote MCP servers, which with oauth: auto find their authorization server and register PromptGate by themselves. Own implementation, no OAuth module.

  • API Gateway (internal/apigw) on surfaces.api_gateway.mount: /api/<name>/<path> goes to the API’s url joined with <path>, pg_ keys only (keys[].apis), the caller’s credentials, X-Forwarded-* and X-PromptGate-* headers never reach the API; traversal in any encoding refused (encoded slashes kept), method allowlist, streaming in both directions with flushing for event streams, request/response caps, redirects passed back unfollowed, retries for idempotent methods, X-PromptGate-Request-Id, one error shape; APIs reload live.
  • OAuth connections, part 1 — OAuth: oauth.connections (preset, grant authorization_code/client_credentials, client credentials, scopes, tenant config, URL overrides, token_auth, pkce, params) and oauth.redirect_url, validated on load; 30 built-in presets (promptgate oauth presets) with v1’s mistakes fixed: PKCE S256 sent, Basic client authentication where the provider wants it, Google/Dropbox offline access, Figma’s refresh endpoint, every tenant field used and checked; tokens stored in the request log database (schema v15) sealed with AES-256-GCM (PROMPTGATE_SECRET_KEY or a generated secret.key), pending authorizations only as the hash of their state.
  • OAuth connections, part 2: the authorization code flow with PKCE (promptgate oauth connect, the web UI’s /oauth/callback or a loopback listener of the command), state bound to the web UI user and single-use; client credentials; renewal a minute before expiry, one renewal for concurrent requests, renewal after a 401; needs reconnect with the reason when the provider refuses the refresh token or the secret key changed; RFC 7009 revocation on oauth disconnect; oauth list, refresh, prune; token endpoints reached through the SSRF check, never following redirects.
  • OAuth connections in use: apis.<name>.oauth and mcp.servers.<name>.oauth send the connection’s token as Authorization (never the caller’s), renew it once and resend after a 401 (API request bodies are kept for that); an API’s url defaults to its preset’s API; without a token the API Gateway answers 502 oauth_unavailable with the command to run. promptgate mcp servers|tools|call use the stored tokens too.
  • Quality gate: pgfuzz’s new api probe runs in scripts/pgfuzz-gate.sh (stages api-access, api-headers, api-paths, api-ssrf, api-size, api-requests, api-answers — 25 stages in all); API Gateway benchmarks (go test -bench APICall ./internal/apigw, a load run in bench/results): a plain call costs about 0.25 ms at the median over calling the API directly.
  • Web UI: APIs (list with today’s calls, errors and p50; a page per API with its credentials, OAuth state, recent calls and masked definition; YAML editor; disable, enable, delete) and Connections (state, expiry, who uses each; connect, renew, disconnect; new connections from the 30 presets) under API Gateway; the key form limits keys to APIs; an MCP server’s page shows its OAuth state with a Connect button; the OAuth result page leads to the connections.
  • promptgate apis list|call (call runs one request through the API Gateway’s rules in-process, without a pg_ key), keys create --api, an APIS column in keys list; control plane tools apis, oauth_connections, api_set and api_delete — agents can’t set credentials, private or move a credentialed API — and key_create takes apis; mcp import gives remote servers without credentials oauth: auto.
  • MCP authorization discovery: mcp.servers.<name>.oauth: auto finds the authorization server from the 401’s resource_metadata or the well-known URIs (RFC 9728), reads its metadata (RFC 8414 / OpenID), registers PromptGate as a client (RFC 7591, public with PKCE), sends resource (RFC 8707) with every request and refuses servers without PKCE S256; promptgate oauth connect mcp:<server>; 2025-03-26 servers without metadata are tried at their origin. Named connections get resource too.
  • security.ssrf.mcp: true checks remote MCP servers’ addresses; a changed SSRF setting reconnects them at once.
  • Guardrails on API Gateway bodies: global rules, guardrails.apis.<api>, then the key’s; requests read as role assistant, answers as role tool; JSON (every string value) and text bodies, binary bodies and event streams pass uninspected; redaction restored in the answer; blocks answer 422 (request) or 502 (answer withheld), compressed text bodies the guards can’t read are refused (415 / 502); ip_allowlist and time_window apply to every call. The web UI’s guardrails page has the new scope.
  • API Gateway requests in the request log (surface api: API as provider, method as model, path without query as route; refused requests too), logs --surface api, stats --by api|method (--surface api), own per-minute totals (store schema v14, api_rollups) kept out of model stats and cost; limits.apis (per API, shared by all keys, "*"), 429 with Retry-After; Prometheus promptgate_api_requests_total, promptgate_api_request_duration_seconds, promptgate_ssrf_blocked_total; console lines, the web UI’s log filter, the limits page and the control plane’s stats, logs and limit_set know the new surface.
  • API Gateway configuration: apis.<name> (url, methods, header policy forward/block/set with ${ENV} and {{ key }}, {{ user }}, {{ request_id }}, timeouts, body caps, query, retries, private, forwarded), surfaces.api_gateway.mount (default /api) and keys[].apis — see API Gateway.
  • SSRF protection (internal/netguard): outbound connections are checked at dial time on the resolved address — loopback, private, link-local and metadata, CGNAT, multicast and reserved ranges, IPv4 in mapped/NAT64/6to4 form — so DNS rebinding can’t get through; exceptions in security.ssrf.allow.
  • The API Gateway also refuses ..; path segments (..;jsessionid=x), which Tomcat and other servlet containers read as ..; streamed answers reuse their copy buffers (17 instead of 52 KB per call).
  • A remote MCP server whose OAuth connection has no token yet gets its requests without one; its 401 then says what to run.
  • The secret key file is created only when an OAuth connection first needs it, written whole and linked into place — concurrent first starts agree on one key and never read a half-written file.
  • Surface mounts are checked pairwise for overlaps (three surfaces now).

Release run, on a machine kept busy by unrelated projects (load average 13–24): the proxy path is unchanged code and measures as v0.7.0 does within the run’s noise (0.30 ms at the median at one client in the steadier round, 52–53 MB RSS); an API Gateway call with guardrails on both bodies costs 0.26–0.27 ms at the median over calling the API directly, 0.24 ms without — see bench/results.

Was this page helpful?