Creating a policy
- Select Safety and Evaluations > Responsible AI in the sidebar.
- Select Create New Policy and give it a name.
- Enable and configure the checks you need across the available categories.
- Select Save in the top right.
- Select Start Testing in the right panel to validate the policy against sample interactions.
Compliance frameworks
Compliance is a category in the Responsible AI policy editor that evaluates agent interactions against named regulatory and industry standards, in addition to the content checks described elsewhere on this page. Open a policy in Safety and Evaluations > Responsible AI, enable Compliance, and select the frameworks to enforce. Then assign the policy to an agent through the Responsible AI feature card in the Agent Builder.
Available frameworks
Select any combination of the following frameworks:Custom rules
Beyond the built-in frameworks, you can define your own compliance rules. Select Add rule to create a user-defined rule that is enforced in addition to the frameworks you selected.Input and output checks
A compliance framework runs at two points in an interaction, and you can enable either or both.- Input-level check evaluates what the user submits, for example a data retention policy or a storage description, against the selected framework and flags any violations before the agent acts on the input.
- Output-level check evaluates the agent’s response and blocks any non-compliant output, returning an explanation of which rule the response violated.
When to use each check
Custom guardrails
Custom guardrails let you bring your own HTTP guardrail servers into a Responsible AI policy. Enable Custom Guardrails in the policy editor, then add one or more guardrails that Lyzr calls during an interaction. Use this when your safety or compliance logic lives in your own service rather than in the built-in checks.
verdict field in the response body decides whether the interaction is allowed or denied. Each guardrail has the following settings:
You can add multiple custom guardrails to a single policy, and remove any of them with the delete icon.
AWS Bedrock Guardrails
Lyzr supports connecting AWS Bedrock Guardrails as an external content governance layer. This option requires your own AWS credentials and is not enabled by default.
You can combine Bedrock guardrails with native Lyzr checks, save the combination as a single policy, and assign it to agents.

Toxicity detection
Lyzr validates every LLM output for toxicity before it reaches the user. The system scores responses between 0 and 1. Responses above the configured threshold are blocked, and the LLM is asked to regenerate until a safe response is produced. Default threshold: 0.4. Values closer to 1 allow more content through; lower values are stricter.
Prompt injection protection
Lyzr checks every incoming user message for prompt injection attempts before it is sent to the LLM. The system assigns a risk score from 0 to 1. Messages above the threshold are blocked before they reach the model. Default threshold: 0.3. Lower values are stricter.
Secrets detection
Lyzr automatically detects and redacts sensitive credentials from both inputs and outputs. Detected values are masked before being stored, displayed, or transmitted. Covered: API keys, authentication tokens, JWTs, private keys, and certificate data.Allowed topics
Restrict the agent to responding only to queries within explicitly approved topic domains. Configure by providing comma-separated values:Banned topics
Prevent the agent from discussing specific prohibited topics. Configure by providing comma-separated values:NSFW detection
Detects and blocks not-safe-for-work or inappropriate content before it is processed or returned.
- Sentence-by-sentence: scans each sentence individually for higher precision.
- Full text: evaluates the entire response as a whole for contextual detection.
Keyword management
Block or redact specific words and phrases from both inputs and outputs.

- Literal: exact substring match.
- Regex: regular expression for format-based patterns.
- Cucumber: parameter extraction for advanced logical matching.
- Blocked: the interaction stops if the keyword is detected.
- Redacted: the keyword is masked and the conversation continues.
Personally Identifiable Information (PII)
Configure how the agent handles each category of personal data. Each type can be independently set to Disabled, Blocked, or Redacted.
Blocked stops the interaction entirely when the data type is detected. Redacted masks the value and allows the interaction to continue.