Skip to content

NGF: Add guardrails doc - #2191

Open
bjee19 wants to merge 11 commits into
nginx:ngf-release-2.7from
bjee19:ngf/guardrails-doc
Open

NGF: Add guardrails doc#2191
bjee19 wants to merge 11 commits into
nginx:ngf-release-2.7from
bjee19:ngf/guardrails-doc

Conversation

@bjee19

@bjee19 bjee19 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Add document for NGF's integration with F5 AI Guardrails.

Checklist

Before sharing this pull request, I completed the following checklist:

Footnotes

  1. Potentially sensitive information includes personally identify information (PII), authentication credentials, and live URLs. Refer to the style guide for guidance about placeholder content.

@bjee19
bjee19 requested a review from a team as a code owner August 7, 2026 23:48
@github-actions github-actions Bot added documentation Improvements or additions to documentation product/ngf Issues related to NGINX Gateway Fabric labels Aug 7, 2026
@bjee19
bjee19 requested a review from a team August 7, 2026 23:49

@mjang mjang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of my comments depend on whether / where we refer to F5 AI Guardrails or NGF guardrails

Comment thread content/ngf/how-to/f5-ai-guardrails.md
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated

## Before you begin

You need an F5 AI Guardrails API endpoint to inspect payloads. This can be an F5 hosted service or a service running inside your cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have many F5 AI Guardrails API endpoints

I think the right endpoint might be: https://docs.aisecurity.f5.com/operations/get_prompts.html ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yea those are endpoints/paths on a specific F5 AI Guardrails service. I guess I was talking about the F5 AI Guardrails service. such as us1.calypsoai.app / eu1.calypsoai.app, or a self hosted endpoint.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a doc says:

"You need an F5 AI Guardrails API endpoint to inspect payloads."

I think: "Which endpoint"? I made my best guess.

Oh yea those are endpoints/paths on a specific F5 AI Guardrails service. I guess I was talking about the F5 AI Guardrails service. such as us1.calypsoai.app / eu1.calypsoai.app, or a self hosted endpoint.

As you can see from the link, you can include the server in the URL. The (changeable) default shown in the AI Security API doc is us1.calypsoai.app.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So do you think I should give the example us1.calypsoai.app to help clarify what endpoint means?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because that endpoint can be different per user. they should/would know the answer to "which endpoint?"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the base URL depends on the deployment -- which varies per customer (not user?)

us1.calypsoai.app or eu1.calypsoai.app would correspond to a SaaS install. For on prem, the base URL depends on the deploying customer. Ref: https://docs.aisecurity.f5.com/integrations/_base_vars.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry yea the base url can vary per customer, how would you suggest this portion be changed to account for that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I differentiate between BASE_URL and endpoint.

Suggested change
You need an F5 AI Guardrails API endpoint to inspect payloads. This can be an F5 hosted service or a service running inside your cluster.
To inspect payloads, you can use the F5 AI Guardrails [scans](https://docs.aisecurity.f5.com/operations/get_scans.html) endpoint. Specifically, this can be an F5 hosted service or a service running inside your cluster.
With the `scans/` endpoint, the server URL varies depending on whether you've deployed AI Security on your system, or use the AI Security SaaS deployment. For more information, see our description of [BASE_VARS](https://docs.aisecurity.f5.com/integrations/_base_vars.html).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, though currently NGF doesn't allow for any other endpoint besides the scans endpoint. We don't allow the user to configure any endpoint and it almost feels like an implementation detail that is unnecessary to bring up.

I'd rather hide that part of the implementation and perhaps add a small line just saying something like "NGINX Gateway Fabric uses the scans/ endpoint when communicating with the F5 AI Guardrails API for both requests and responses (and link to the docs just so they can look into it if they want)" than insinuate that the user can configure this endpoint.

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
The `cluster.local` suffix in the in-cluster URL is the cluster's DNS domain. If your cluster uses a different domain, configure it with the `--cluster-domain` flag on the NGINX Gateway Fabric controller (default: `cluster.local`).
{{< /call-out >}}

For an external backend, create an `ExternalName` Service pointing at your hosted Guardrails API:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: with the Guardrails API, are we referring to some F5 API? (That may change some of my comments)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it isn't an F5 API, we need to figure out how to clarify:

  • What's a NGF guardrail
  • What's used for F5 AI Guardrails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guardrails API is referring to this product https://docs.aisecurity.f5.com/api-docs/getting-started-defend.html. and this https://docs.aisecurity.f5.com/api-docs/prompts-scans.html.

There is no NGF guardrails.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in that section I don't put the full "F5 AI Guardrails" because they are self-hosted, meaning they aren't sending requests to https://us1.calypsoai.app/, they are sending to their own hosted version of F5 AI Guardrails. I can adjust if necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a suggstion earlier (and will add one for the end of the page)

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated

@mjang mjang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've suggested a few other changes. Thanks for clarifying how NGF integrates

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated

## Before you begin

You need an F5 AI Guardrails API endpoint to inspect payloads. This can be an F5 hosted service or a service running inside your cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I differentiate between BASE_URL and endpoint.

Suggested change
You need an F5 AI Guardrails API endpoint to inspect payloads. This can be an F5 hosted service or a service running inside your cluster.
To inspect payloads, you can use the F5 AI Guardrails [scans](https://docs.aisecurity.f5.com/operations/get_scans.html) endpoint. Specifically, this can be an F5 hosted service or a service running inside your cluster.
With the `scans/` endpoint, the server URL varies depending on whether you've deployed AI Security on your system, or use the AI Security SaaS deployment. For more information, see our description of [BASE_VARS](https://docs.aisecurity.f5.com/integrations/_base_vars.html).

Comment thread content/ngf/how-to/f5-ai-guardrails.md
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
The `cluster.local` suffix in the in-cluster URL is the cluster's DNS domain. If your cluster uses a different domain, configure it with the `--cluster-domain` flag on the NGINX Gateway Fabric controller (default: `cluster.local`).
{{< /call-out >}}

For an external backend, create an `ExternalName` Service pointing at your hosted Guardrails API:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a suggstion earlier (and will add one for the end of the page)

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
@mjang

mjang commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I'm going to follow up with the AI Security PM on Tuesday Aug 11 (we have a weekly meeting).

Comment thread content/ngf/how-to/f5-ai-guardrails.md
Comment thread content/ngf/how-to/f5-ai-guardrails.md
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment on lines +185 to +187
{{< call-out "note" >}}
The `cluster.local` suffix in the in-cluster URL is the cluster's DNS domain. If your cluster uses a different domain, configure it with the `--cluster-domain` flag on the NGINX Gateway Fabric controller (default: `cluster.local`).
{{< /call-out >}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make a reference to this section in the "Before you begin" section. If a user is following this document, they would have first installed NGF with nginxGateway.payloadProcessor.enable=true, then by the time they get to this step, the realize they need to set their own cluster domain, and then need to upgrade/reinstall NGF again.

It might be fine though as I think about it. What do you think?

@sjberman sjberman Aug 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just don't think they should install NGF in the before you begin section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't think its a big enough issue to make the change. Though it would be solved if we don't install NGF in the before you begin section.

@sjberman did you have a place in mind to install NGF? Technically we could Deploy the LLM, create the gateway, secret, guardrails backend Service before deploying NGF.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fine to me. Maybe do the gateway after installing NGF

Comment thread content/ngf/how-to/f5-ai-guardrails.md
Comment thread content/ngf/how-to/f5-ai-guardrails.md
@bjee19
bjee19 requested review from mjang, shaun-nx and sjberman August 11, 2026 18:18
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated

## Before you begin

You need an F5 AI Guardrails API endpoint to inspect payloads. This can be an F5 hosted service or a service running inside your cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there Guardrails installation/usage docs? Feels like we should link out to them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a small link. It's difficult since guardrails doesn't have guides on using the dashboard, which is what I think users would be using.

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated
Comment on lines +94 to +112
For an external backend, create an `ExternalName` Service pointing at your hosted Guardrails API:

```yaml
kubectl apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
name: guardrails-api
spec:
type: ExternalName
externalName: <GUARDRAILS_API_HOSTNAME>
ports:
- name: https
port: 443
protocol: TCP
EOF
```

For an in-cluster backend, your AI Guardrail backend pods will most likely have an existing Service which you can point the PayloadProcessor backendRef to.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use tabs for the external/internal differing configs? Kind of nice, concise way to display multiple options in a doc, similar to our installation docs with OSS/Plus

Comment thread content/ngf/how-to/f5-ai-guardrails.md Outdated

{{%tab name="External"%}}

To configure a Guardrails backend Service which is external, create an `ExternalName` Service pointing at your hosted Guardrails API:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this not be...

Suggested change
To configure a Guardrails backend Service which is external, create an `ExternalName` Service pointing at your hosted Guardrails API:
To configure a AI Guardrails backend Service which is external, create an `ExternalName` Service pointing at your hosted Guardrails API:

?
or the backend service is just "Guardrails" ?


{{%tab name="In-cluster"%}}

For an in-cluster backend, your AI Guardrail backend pods will most likely have an existing Service which you can point the PayloadProcessor backendRef to, otherwise create a Service configured to expose your guardrail backends:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For an in-cluster backend, your AI Guardrail backend pods will most likely have an existing Service which you can point the PayloadProcessor backendRef to, otherwise create a Service configured to expose your guardrail backends:
For an in-cluster backend, your AI Guardrails backend pods will most likely have an existing Service which you can point the PayloadProcessor backendRef to, otherwise create a Service configured to expose your guardrail backends:

See also my other question

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's the name of a product of service, it needs to be consistent (AI Guardrails) across the document. If it's not a product or service it needs to be lowercase...

## Send traffic

{{< call-out "note" >}}
Whether a given value is blocked depends entirely on your Guardrails backend's detector configuration. Enable the relevant detectors on your Guardrails service to see the block responses above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Whether a given value is blocked depends entirely on your Guardrails backend's detector configuration. Enable the relevant detectors on your Guardrails service to see the block responses above.
Whether a given value is blocked depends entirely on your AI Guardrails backend's detector configuration. Enable the relevant detectors on your Guardrails service to see the block responses above.

```


If the request payload contains content that your Guardrails backend is configured to block, the request never reaches the LLM and returns `HTTP 403`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the request payload contains content that your Guardrails backend is configured to block, the request never reaches the LLM and returns `HTTP 403`:
If the request payload contains content that your AI Guardrails backend is configured to block, the request never reaches the LLM and returns `HTTP 403`:

{"error":{"code":"content_policy_violation","message":"Request blocked by guardrails policy.","param":null,"type":"invalid_request_error"}
```

If the model's *output* contains content that your Guardrails backend blocks, the response is withheld from the client and returns `HTTP 403` with `error.type: api_error`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the model's *output* contains content that your Guardrails backend blocks, the response is withheld from the client and returns `HTTP 403` with `error.type: api_error`:
If the model's *output* contains content that your AI Guardrails backend blocks, the response is withheld from the client and returns `HTTP 403` with `error.type: api_error`:

@JTorreG JTorreG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with nits

@bjee19

bjee19 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

btw, waiting on some ongoing changes in nginx/nginx-gateway-fabric#5697 before merging. Will merge after that PR is merged.

@mjang mjang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on @JTorreG 's comments / suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation product/ngf Issues related to NGINX Gateway Fabric

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants