Questa pagina è stata tradotta automaticamente. Leggi l’originale in inglese.

FeatureRecipe

prompt-injection-shield-nginx

Component-scope FeatureRecipe for core/prompt-injection-shield on the NGINX gateway, core/gateway/nginx, on Kubernetes. It emits no file: it points the proxy_pass target the gateway's Recipe writes at the guard wired to the gateway's guard socket, in place of the component on its upstream socket, so every request the gateway forwards goes to the guard. The guard checks each chat request and forwards what it admits to the model its own infra.upstream_endpoint names, which the Release sets to the model the upstream socket names; it answers no completions, embeddings, responses or messages route, and its model listing passes the caller's Authorization header to the model's. The guard must be core/security/nemo-guardrails running the threshold the sensitivity names, 0.5 for standard and 0.001 for strict, the values measured for its detector's default classifier. The build halts otherwise, with nothing on the guard socket, naming it, with more than one guard, on a second attachment, beside core/traffic-shadowing, whose copies would bypass the guard, and on any component other than core/gateway/nginx. The guard reads only the latest user message, and judges no reply, tool-call argument or image. A request it refuses is answered with an ordinary completion, streamed when asked; when the guard or its detector cannot be reached the request is refused and nothing reaches the model.

Provenienza

UfficialeFirmato da un’identità di firma che questo catalogo riconosce come editore ufficiale.
Digest del contenuto
sha256:bd94d065cb465626dc9b4bb11fc72edf3d92bc37dd74a8730ba0652f7c26df6b
Pubblicato
2026-11-10T10:16:05Z
Identità di firma
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Firma

  • Ufficialeapplication/vnd.dev.sigstore.bundle.v0.3+json

    https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

    sha256:5df7e73447c4306c34fe00ea92a6f9de9fde5a05dca00e53acea7ab613f2ed11

Riferimento a questa versione

oci://hub.aggrega.ai/featurerecipe/helm/prompt-injection-shield-nginx:1.0.0
Destinazione
—
Implementa
core/prompt-injection-shield:1.0.0

Fornisce

Modelli di puntatori deterministici che questa ricetta collega per i consumatori.

Nessun modello provides dichiarato.

Mappatura di iniezione

{{- $guards := list }}
{{- range $alias, $edge := .context.uses }}{{ if eq $edge.socket "guard" }}{{ $guards = append $guards $edge }}{{ end }}{{ end }}
{{- if ne (len $guards) 1 }}{{ fail (printf "core/prompt-injection-shield attachment %q on %q needs exactly one guard, but %d components are wired to the gateway's guard socket; wire a single core/security/nemo-guardrails to it" .attachment_name .context.instance_id (len $guards)) }}{{ end }}
{{- $guard := first $guards }}
{{- $type := first (splitList ":" (toString $guard.component)) }}
{{- if ne $type "core/security/nemo-guardrails" }}{{ fail (printf "core/prompt-injection-shield attachment %q on %q is wired to the guard %q, a %s, but this realization sends the gateway's requests through core/security/nemo-guardrails alone, the one guard its two sensitivities are measured on and proved to refuse a request without the model's server receiving it; wire a core/security/nemo-guardrails to the guard socket instead" .attachment_name .context.instance_id $guard.target $type) }}{{ end }}
{{- $want := optional (fromJson .locals.sensitivity_thresholds) (toString .values.sensitivity) "" }}
{{- $have := optional $guard.provides "threshold" "" }}
{{- if not $have }}{{ fail (printf "core/prompt-injection-shield attachment %q on %q is wired to the guard %q, which publishes no threshold, so the sensitivity it refuses at cannot be checked; bind %q in the Manifest to a Recipe that publishes one" .attachment_name .context.instance_id $guard.target $guard.target) }}{{ end }}
{{- if ne (float64 $have) (float64 $want) }}{{ fail (printf "core/prompt-injection-shield attachment %q on %q asks for sensitivity %s, which this realization runs as the guard's threshold %v, but the guard %q runs at %v; set values.threshold of %q to %v" .attachment_name .context.instance_id (toString .values.sensitivity) $want $guard.target $have $guard.target $want) }}{{ end }}
{{- $hostVar := optional .locals "upstream_host_variable" "" }}
{{- $portVar := optional .locals "upstream_port_variable" "" }}
{{- if not (and $hostVar $portVar) }}{{ fail (printf "core/prompt-injection-shield attachment %q on %q points the gateway's proxy_pass target at the guard through the two variables the NGINX Recipe names in its locals, but the Recipe rendering %q names none; bind the component in the Manifest to a Recipe that does" .attachment_name .context.instance_id .context.instance_id) }}{{ end }}
env:
  {{ $hostVar }}: {{ $guard.provides.host | toJson }}
  {{ $portVar }}: {{ $guard.provides.port | toJson }}

Workload

Nessun modello di workload dichiarato.

Variabili locali

NomeModello
sensitivity_thresholds{"standard": 0.5, "strict": 0.001}

Mappatura dei valori

Nessuna mappatura dei valori dichiarata.

Relazioni

Archi tipizzati da e verso altre entità pubblicate. Un riferimento senza una destinazione pubblicata viene mostrato come arco interrotto anziché come link.

Usa

Usato da

Nulla nel catalogo dipende da questa entità.

Riferimento al concetto FeatureRecipe →

Il catalogo Aggrega — un indice aperto di componenti, funzionalità, ricette e dei plugin che li renderizzano.

Realizzato con il design system condiviso di Aggrega.

Privacy