FeatureRecipe
prompt-injection-shield-nginx
Component-scope FeatureRecipe for core/prompt-injection-shield on the NGINX gateway, core/gateway/nginx, under Docker Compose. 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.
来源
- 内容摘要
- sha256:c55ad9836a4b0b3a69f21522f81c79e180e7038fd0bf1485c0646439241cd169
- 发布时间
- 2026-11-10T10:15:00Z
- 签名身份
- https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
签名
- 官方application/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:2b821c81701ded72284b140ee0d0b89e9f584b7d73eaae9309ef89583edaa344
此版本的引用
oci://hub.aggrega.ai/featurerecipe/compose/prompt-injection-shield-nginx:1.0.0- 目标
- —
- 实现
- core/prompt-injection-shield:1.0.0
提供
此配方为使用方接入的确定性指针模板。
未声明 provides 模板。
注入映射
{{- $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
未声明工作负载模板。
局部变量
| 名称 | 模板 |
|---|---|
| sensitivity_thresholds | {"standard": 0.5, "strict": 0.001} |
值映射
未声明值映射。
关系
与其他已发布实体之间的类型化边。没有已发布目标的引用会呈现为断开的边,而不是链接。
使用
- 实现实现
core/prompt-injection-shield:1.0.0
被使用
目录中没有任何内容依赖此实体。