JuliusBrussee/caveman · error

vertex publisher is not on the allowlist

Error message

vertex publisher %q is not on the allowlist

What it means

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.

Solutions

  1. Switch the request to an allowlisted publisher (google or anthropic) with a model from that family.
  2. 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.
  3. Check for case/spacing typos: the comparison is exact, so 'google' not 'Google' or ' google'.

Example fix

# before
CAVE_VERTEX_PUBLISHER_ALLOWLIST=google
# after (deliberate opt-in)
CAVE_VERTEX_PUBLISHER_ALLOWLIST=google,anthropic,meta
Defensive patterns

Strategy: validation

Validate before calling

if !publisherAllowed(publisher) {
    return fmt.Errorf("publisher %q not allowlisted — default is google,anthropic; override with CAVE_VERTEX_PUBLISHER_ALLOWLIST", publisher)
}

Type guard

func isAllowlistedPublisher(p string) bool {
    return publisherAllowed(p)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "publisher") && strings.Contains(err.Error(), "allowlist") {
    return httpError(403, "publisher not allowlisted; adjust the model family or CAVE_VERTEX_PUBLISHER_ALLOWLIST")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/c5ebff4673f3dada. Report an issue: GitHub.

Appendix: source

Thrown at proxy/providers/vertex/routing.go:44

// ResolveUpstreamURL validates the Vertex request shape (publisher + model on
// the allowlist), enforces SSRF/host constraints against the aiplatform
// endpoint, and resolves the upstream URL. The /vertex prefix is stripped so the
// upstream path is the native aiplatform path
// (/v1/projects/{p}/locations/{l}/publishers/{pub}/models/{model}:{method}). The
// non-authentication query bytes (e.g. ?alt=sse) are preserved unchanged.
func (a Adapter) ResolveUpstreamURL(ctx context.Context, req *http.Request, route providers.RouteContext) (*url.URL, error) {
	if _, err := providers.GoogleRequestAPIKey(req); err != nil {
		return nil, err
	}
	publisher, model, method := parsePredictPath(req.URL.Path)
	if publisher == "" || model == "" || method == "" {
		return nil, fmt.Errorf("vertex request path %q does not name a publisher, model, and method", req.URL.Path)
	}
	if !methodAllowed(publisher, method) {
		return nil, fmt.Errorf("vertex method %q is not allowed for publisher %q", method, publisher)
	}
	if !publisherAllowed(publisher) {
		return nil, fmt.Errorf("vertex publisher %q is not on the allowlist", publisher)
	}
	if !modelAllowed(model) && !anthropicCountTokensPath(publisher, model, method) {
		return nil, fmt.Errorf("vertex model %q is not on the allowlist", model)
	}

	baseURL := a.BaseURL
	if route.BaseURL != "" {
		baseURL = route.BaseURL
	}
	base, err := url.Parse(baseURL)
	if err != nil {
		return nil, fmt.Errorf("vertex base url invalid: %w", err)
	}
	base.Path = strings.TrimRight(base.Path, "/") + strings.TrimPrefix(req.URL.Path, "/vertex")
	base.RawQuery = providers.WithoutGoogleAPIKeyQuery(req.URL.RawQuery)

	// SSRF/host validation on the resolved endpoint. Active in managed (prod)
	// mode; local/self-hosted (stub) endpoints are permitted so the dry-run and

View on GitHub (pinned to 3ee70a1026)