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.

Provenance

OfficialSigned by a signing identity this catalog recognizes as an official publisher.
Content digest
sha256:bd94d065cb465626dc9b4bb11fc72edf3d92bc37dd74a8730ba0652f7c26df6b
Published
2026-11-10T10:16:05Z
Signing identity
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Signature

  • Officialapplication/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

Reference at this version

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

Provides

Deterministic pointer templates this recipe wires for consumers.

No provides templates declared.

Inject mapping

{{- $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

No workload template declared.

Locals

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

Values mapping

No values mapping declared.

Relationships

Typed edges to and from other published entities. A reference with no published target renders as a broken edge rather than a link.

Uses

Used by

Nothing in the catalog depends on this entity.

FeatureRecipe concept reference →

The Aggrega catalog — an open index of components, features, recipes, and the plugins that render them.

Built with the shared Aggrega design system.

Privacy