Skip to main content
Guardrails inspect incoming model content inside the Aixy gateway before a request reaches the model provider. Use them to block recognized prompt-injection and jailbreak patterns, to block or redact sensitive data, and to reject excessive or repetitive context. All checks are deterministic and run in the gateway itself, without reviewer models, external detector APIs or a guardrails vendor. They apply to application, integration, and Playground model requests under the same project.

Configure a policy

  1. Select All projects for an organization policy, or select a project for a project policy.
  2. Open Guardrails and create a policy with a name and description.
  3. Choose Prompt injection, Jailbreak attempts, Sensitive data, and/or Context bloat. You can start from a preset and review or edit its selected protections and rules.
  4. Set Attack detection sensitivity for attack patterns and Credential detection sensitivity independently for secrets. For sensitive data, choose Block or Redact per kind and edit the replacement marker when redacting. Context bloat has its own limits.
  5. Test representative samples using This draft only or This draft and effective policies, review the result, and save the policy.
Organization policies apply across projects. Project policies add protection; they cannot weaken an organization policy. Project admins can change their project policies, while organization administrators manage shared policies.

Choose protections

For Company email, enter the protected domains; subdomains are included. Custom patterns use RE2-compatible syntax with linear-time matching, without backreferences or lookaround. A policy accepts up to 20 sensitive-data rules in total, including built-in and custom rules. Each custom pattern has at most 200 characters; a replacement has 1–40 characters. Up to 50 protected email domains are supported. Names have at most 80 characters and descriptions have at most 500. Credential detection sensitivity is independent of attack sensitivity. Standard uses recognized credential patterns; Strict additionally enables high-entropy secret detection, which may match legitimate identifiers. Existing policies without a separate credential setting retain their earlier sensitivity until you choose an explicit setting. The additional identity and financial recognizers check formats and checksums locally. They do not verify whether an identifier was issued, whether an account exists, or whether a credential works. These checks do not load a named-entity model to recognize people or locations.

Context bloat

Enable Context bloat to inspect the combined inbound text before any redaction. The check covers the supported prompt fields across messages, instructions and incoming tool-result text. It does not inspect images or execute tools. Text fields are joined with blank-line separators for the check, so splitting padding across messages does not bypass the configured aggregate limit. The default maximum is 5,000 characters, not model tokens. The advanced defaults are a 50-character minimum for content checks, minimum entropy 3.5, maximum repeated n-gram ratio 0.4, n-gram size 3, and maximum repeated-character run ratio 0.1. Below the minimum, only the size cap applies. Tune these values against representative legitimate text as well as unwanted repetition; source code, structured data and long conversations can have different repetition patterns. Context bloat always blocks a detected violation. It never silently truncates instructions. The error identifies whether the aggregate size cap, low entropy, a long character run or repeated n-grams caused the block. Existing policies gain no context-bloat checks unless you enable this protection.

Block or redact

Block rejects the request before an upstream connection is opened. The error identifies the policy and detector without echoing the matched text. The error message explains whether prompt injection, a jailbreak attempt, context bloat or a specific sensitive-data kind caused the block. OpenAI-compatible responses also include the policy ID, policy name, detector and rule in error.details, plus check for context-bloat violations. A guardrails service failure returns guardrails_unavailable (503), distinct from a policy block (400). Redact replaces matches in the prompt fields sent upstream. The draft tester lets you inspect the transformed model input before enabling the rule. Test both content that should match and ordinary content that should pass, especially when using strict sensitivity or custom patterns. Private key → Redact replaces the entire text field containing a detected key, including any surrounding instructions, with the replacement marker. Use the draft tester to verify what the model would receive.

Verify and operate a policy

Use the tester first, then send representative requests in Playground. The draft and effective-policy testers use the same input checks as the gateway. Draft-only mode evaluates the draft in isolation. Combined mode includes enabled organization and project policies for the selected scope and replaces the saved version of the policy you are editing with the draft. It does not save or activate the draft. Results show the blocking reason or the redacted model input, together with the matching policy, data kind and action. Test both samples that should be blocked and ordinary content that should pass. The prompt-injection and jailbreak protections use patterns, rather than a semantic classifier. They can miss unfamiliar or reformulated attacks and can match legitimate text. Keep application access controls and review agent actions independently. These policies inspect incoming content; they do not inspect generated model output. The tester evaluates samples in memory without saving them. Request-level diagnostic capture is an independent, explicit Activity setting.