Trang này được dịch bằng máy. Đọc bản gốc tiếng Anh.

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.

Nguồn gốc

Chính thứcĐược ký bởi một danh tính ký mà danh mục này công nhận là nhà phát hành chính thức.
Digest nội dung
sha256:c55ad9836a4b0b3a69f21522f81c79e180e7038fd0bf1485c0646439241cd169
Đã xuất bản
2026-11-10T10:15:00Z
Danh tính ký
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Chữ ký

  • Chính thứcapplication/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

Tham chiếu ở phiên bản này

oci://hub.aggrega.ai/featurerecipe/compose/prompt-injection-shield-nginx:1.0.0
Đích
—
Triển khai
core/prompt-injection-shield:1.0.0

Cung cấp

Các mẫu con trỏ xác định mà công thức này nối cho bên tiêu thụ.

Chưa khai báo mẫu provides nào.

Ánh xạ tiêm

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

Chưa khai báo mẫu khối lượng công việc nào.

Giá trị cục bộ

TênMẫu
sensitivity_thresholds{"standard": 0.5, "strict": 0.001}

Ánh xạ values

Chưa khai báo ánh xạ values nào.

Quan hệ

Các cạnh có kiểu đi tới và đi từ các thực thể đã xuất bản khác. Một tham chiếu không có đích đã xuất bản được hiển thị là một cạnh bị đứt thay vì một liên kết.

Sử dụng

Được sử dụng bởi

Không có gì trong danh mục phụ thuộc vào thực thể này.

Tài liệu tham khảo khái niệm FeatureRecipe →

Danh mục Aggrega — chỉ mục mở gồm các thành phần, tính năng, công thức và các plugin kết xuất chúng.

Được xây dựng bằng hệ thống thiết kế dùng chung của Aggrega.

Quyền riêng tư