{"record":{"id":"c5ebff4673f3dada","repo":"JuliusBrussee/caveman","slug":"vertex-publisher-q-is-not-on-the-allowlist","errorCode":null,"errorMessage":"vertex publisher %q is not on the allowlist","messagePattern":"vertex publisher %q is not on the allowlist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/vertex/routing.go","lineNumber":44,"sourceCode":"// ResolveUpstreamURL validates the Vertex request shape (publisher + model on\n// the allowlist), enforces SSRF/host constraints against the aiplatform\n// endpoint, and resolves the upstream URL. The /vertex prefix is stripped so the\n// upstream path is the native aiplatform path\n// (/v1/projects/{p}/locations/{l}/publishers/{pub}/models/{model}:{method}). The\n// non-authentication query bytes (e.g. ?alt=sse) are preserved unchanged.\nfunc (a Adapter) ResolveUpstreamURL(ctx context.Context, req *http.Request, route providers.RouteContext) (*url.URL, error) {\n\tif _, err := providers.GoogleRequestAPIKey(req); err != nil {\n\t\treturn nil, err\n\t}\n\tpublisher, model, method := parsePredictPath(req.URL.Path)\n\tif publisher == \"\" || model == \"\" || method == \"\" {\n\t\treturn nil, fmt.Errorf(\"vertex request path %q does not name a publisher, model, and method\", req.URL.Path)\n\t}\n\tif !methodAllowed(publisher, method) {\n\t\treturn nil, fmt.Errorf(\"vertex method %q is not allowed for publisher %q\", method, publisher)\n\t}\n\tif !publisherAllowed(publisher) {\n\t\treturn nil, fmt.Errorf(\"vertex publisher %q is not on the allowlist\", publisher)\n\t}\n\tif !modelAllowed(model) && !anthropicCountTokensPath(publisher, model, method) {\n\t\treturn nil, fmt.Errorf(\"vertex model %q is not on the allowlist\", model)\n\t}\n\n\tbaseURL := a.BaseURL\n\tif route.BaseURL != \"\" {\n\t\tbaseURL = route.BaseURL\n\t}\n\tbase, err := url.Parse(baseURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"vertex base url invalid: %w\", err)\n\t}\n\tbase.Path = strings.TrimRight(base.Path, \"/\") + strings.TrimPrefix(req.URL.Path, \"/vertex\")\n\tbase.RawQuery = providers.WithoutGoogleAPIKeyQuery(req.URL.RawQuery)\n\n\t// SSRF/host validation on the resolved endpoint. Active in managed (prod)\n\t// mode; local/self-hosted (stub) endpoints are permitted so the dry-run and","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/proxy/providers/vertex/routing.go#L26-L62","documentation":"The Vertex adapter only routes to publishers on an allowlist — by default ['google','anthropic'] (routing.go:19,43-44,163-165). Operators can override it with CAVE_VERTEX_PUBLISHER_ALLOWLIST. The pinning is deliberate: partner publishers have unpriced models whose cost the spend catalog cannot cover, so unknown publishers fail closed instead of being forwarded.","triggerScenarios":"Request a path with a third-party/partner publisher, e.g. '/vertex/.../publishers/meta/models/llama-4:rawPredict' or '/vertex/.../publishers/mistralai/...', while the allowlist is still the google/anthropic default.","commonSituations":"Attempting to route open-weights partner models (Llama, Mistral) through the gateway; a CAVE_VERTEX_PUBLISHER_ALLOWLIST override that omitted a publisher you now need; a typo such as 'Google' (allowlist is exact-match, case-sensitive).","solutions":["Switch the request to an allowlisted publisher (google or anthropic) with a model from that family.","If partner models are genuinely required, set CAVE_VERTEX_PUBLISHER_ALLOWLIST (comma-separated, exact names) to include the publisher — accepting that pricing coverage is your responsibility.","Check for case/spacing typos: the comparison is exact, so 'google' not 'Google' or ' google'."],"exampleFix":"# before\nCAVE_VERTEX_PUBLISHER_ALLOWLIST=google\n# after (deliberate opt-in)\nCAVE_VERTEX_PUBLISHER_ALLOWLIST=google,anthropic,meta","handlingStrategy":"validation","validationCode":"if !publisherAllowed(publisher) {\n    return fmt.Errorf(\"publisher %q not allowlisted — default is google,anthropic; override with CAVE_VERTEX_PUBLISHER_ALLOWLIST\", publisher)\n}","typeGuard":"func isAllowlistedPublisher(p string) bool {\n    return publisherAllowed(p)\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"publisher\") && strings.Contains(err.Error(), \"allowlist\") {\n    return httpError(403, \"publisher not allowlisted; adjust the model family or CAVE_VERTEX_PUBLISHER_ALLOWLIST\")\n}","preventionTips":["Check CAVE_VERTEX_PUBLISHER_ALLOWLIST before deploying new publisher traffic.","Remember allowlist matching is exact and case-sensitive ('google', not 'Google').","Pin only publishers whose models your pricing catalog covers."],"tags":["go","vertex","allowlist","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}