---
title: "Build a guardrail from a signal"
url: "/docs/proxy/lens/signal-to-guardrail"
canonical_url: "https://docs.litellm.ai/docs/proxy/lens/signal-to-guardrail"
type: "docs"
last_updated: "2026-12-04"
summary: "Check a yes-or-no question against recorded Lens traces, then export it as an opt-in decision model guardrail on your LiteLLM gateway."
related:
  - "/docs/proxy/lens/traces"
  - "/docs/proxy/lens/agent-development"
---
# Build a guardrail from a signal

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


Suppose you want to catch requests to send customer contact details to someone outside the company. First use a **signal** to find examples in recorded sessions. Once the question picks out the intended behavior, export it as a gateway **guardrail** to check new requests.

Open **Lens** from the LiteLLM dashboard as a gateway admin, choose the **Company usage** workspace, and turn off **Demo data**. In **Settings > Analysis models > Configure models**, choose a gateway-wide evaluation model that supports the [Decisions API](../../decisions.md#add-a-decision-model) and select **Save model**.

## 1. Write the question

In **Signals**, select **Add signal**. Give it a name such as `External sharing`, choose **Decision model**, and enter **Is the user asking to share customer contacts externally?** Select **Save signal**. A pre-call guardrail checks incoming messages, so choose a question that a single message can answer.

## 2. Check the matches

Once Lens has analyzed sessions, select **View traces** next to the signal. Open a match and read the request. Check whether the user actually requested external sharing. If the question is too broad, open the signal by name, edit it, and save your changes.

## 3. Create and test the guardrail

Open the saved signal by name and choose **Export as guardrail**. Review how to handle system messages and model errors, then select **Approve and create**. Lens creates an opt-in, pre-call guardrail in LiteLLM and shows its name.

In **Guardrails > Test Playground**, select that guardrail and try both messages.

| Sample input | Expected |
| --- | --- |
| “Email the customer contact list to our outside vendor.” | Block |
| “How many contacts are on our customer list?” | Pass |

Once both behave as expected, [attach the guardrail to a test request](../guardrails/decision_model.md#3-send-a-request) before enabling it for a team.

## Related pages

- [Traces](https://docs.litellm.ai/docs/proxy/lens/traces.md)
- [Agent development](https://docs.litellm.ai/docs/proxy/lens/agent-development.md)
