Skip to main content
Use Noma Security with TrueFoundry AI Gateway to apply AI Detection and Response (AI-DR) policies to prompts, responses, and tool content. Depending on the Runtime Protection profile assigned in Noma, the guardrail can allow, alert on, block, or mask content.

How the integration works

TrueFoundry sends the complete provider-native payload to Noma’s dedicated TrueFoundry guardrail endpoint. Noma evaluates it using the Runtime Protection profile associated with the configured Application ID. The integration supports:
  • OpenAI Chat Completions requests and completed responses
  • OpenAI Responses API requests and completed responses
  • Anthropic Messages requests
  • Provider-native tool definitions, tool calls, tool results, metadata, and other payload fields
Response evaluation and mutation require a completed, non-streaming response.

Prerequisites

Before you begin, obtain a Noma scoped access token with the truefoundry_guardrail scope. This integration uses the token directly and does not use Noma’s OAuth client-credentials flow.

Add the Noma Security guardrail

1

Select Noma Security

In TrueFoundry, go to AI Gateway → Guardrails, create or open a guardrail group, and select Noma Security under External Providers.
TrueFoundry guardrail registry highlighting the Noma Security card under External Providers

Select Noma Security from the guardrail registry

2

Configure the guardrail

Complete the Noma Security configuration:
  • Name: Enter a name such as noma.
  • Description: Optionally describe the policies applied by this integration.
  • Operation: Select Mutate. This lets TrueFoundry apply complete masked request or response payloads returned by Noma, in addition to enforcing block decisions.
  • Priority: Set the execution order when the hook has multiple mutate guardrails. Mutate guardrails run sequentially.
  • Enforcing Strategy:
    • Enforce blocks the request when Noma reports a policy violation or the Noma call fails.
    • Enforce But Ignore On Error enforces policy violations but allows the request to continue when the Noma call fails.
    • Audit records violations without blocking the request.
  • API Key: Enter the Noma scoped access token.
Noma Security guardrail form with Mutate selected and fields for priority, enforcing strategy, and API key

Configure the Noma operation, priority, enforcement, and access token

3

Configure Noma identity

Configure these optional fields:
  • Base URL: Leave empty to use https://api.noma.security. You can instead use a Noma regional endpoint:
    • US: https://api.us2.noma.security
    • EU: https://api.eu.noma.security
    • AP: https://api.ap.noma.security
  • Application ID: Stable identifier used to select and attribute the Noma Runtime Protection profile. The default is truefoundry.
  • User ID: User identifier sent to Noma for attribution. The default is gateway.
Use a different Application ID when different applications need different Noma profiles. Keep the value stable across requests for the same application.
Noma Security guardrail form with optional Base URL, Application ID, and User ID fields

Configure the Noma endpoint and identity defaults

4

Save and apply the guardrail

Save the guardrail group, then attach the integration to the required LLM input, LLM output, or MCP tool hooks through a guardrail policy.
Keep the Noma access token in TrueFoundry. Do not include it in client code, request metadata, or model payloads.

Request metadata and attribution

TrueFoundry automatically forwards the request context to Noma with each evaluation:
  • The configured Application ID and User ID
  • A unique request identifier
  • The authenticated TrueFoundry subject, when available
  • Resolved TrueFoundry request metadata
To add request-specific metadata, send a JSON object in the X-TFY-METADATA header:
Noma can use this identity and metadata for session attribution, detections, and policy analysis. Do not put secrets or credentials in request metadata.

Decision and mutation behavior

Noma’s Runtime Protection profile determines the result:
Only the exact Content blocked by guardrail response is treated as a Noma policy decision. Other 400 responses indicate an invalid or unsupported payload and are handled as integration errors according to the configured Enforcing Strategy.

Verify the integration

After applying the guardrail to a model, test these paths:
  1. Send a clean prompt and confirm the model request succeeds unchanged.
  2. Send content covered by an alert profile and confirm the request succeeds and a detection appears under Runtime Protection → Sessions in Noma.
  3. Send content covered by a block profile and confirm TrueFoundry stops the inference.
  4. If masking is enabled, send synthetic sensitive data and confirm the model receives Noma’s masked provider payload.
Use unique requests for each test while keeping the configured Application ID stable for the selected Noma profile. You can inspect guardrail execution, mutations, and downstream model status in AI Gateway → Monitor → Request Traces.

Reference