Skip to main content

Choosing a Guardrail Provider

AISIX enforces content policy through guardrails: checks that run on a caller request before it reaches the upstream model, on a model response before it reaches the caller, or both. Each guardrail is one kind with its own provider, capabilities, and configuration.

The comparison below helps narrow the choice before you follow a provider-specific setup guide.

Provider Comparison

KindProviderEvaluation LocationDetectsActions
keywordBuilt-inInside AISIXLiteral / regex patternsblock
piiBuilt-inInside AISIXRule-based PII (email, phone, ID, card, keys, …) + custom regexmask, block
presidioMicrosoft PresidioSelf-hosted Presidio serviceRule-based and NER/ML PII entities (PERSON, LOCATION, …)mask (replace / mask / hash / redact operators), block
lakeraLakera GuardLakera APIPrompt injection, jailbreak, content, PIIblock; PII-only detections mask
azure_content_safetyAzure AI Content SafetyAzure APIPrompt injection / jailbreak (Prompt Shield)block
azure_content_safety_text_moderationAzure AI Content SafetyAzure APICategory severity (hate, sexual, self-harm, violence) + blocklistsblock
openai_moderationOpenAI ModerationOpenAI APIContent categories (harassment, hate, violence, sexual, self-harm, …)block
bedrockAWS Bedrock GuardrailsAWS Bedrock serviceContent filters, denied topics, sensitive information, word filtersblock; PII ANONYMIZE masks
aliyun_text_moderationAlibaba Cloud AI GuardrailsAlibaba Cloud APIRisk-level content moderationblock

All listed guardrail kinds can run on caller requests, model responses, or both. They share the same platform controls for hook points, enforcement modes, remote failure handling, and caller responses. See Guardrail Behavior.

Choose a Guardrail by Goal

GoalStart WithConsider Also
Detect or redact PIIBuilt-in PII guardrail, because it runs inside AISIX with no external calls and covers rule-based detectors plus custom regex.Presidio for entities a regex cannot express, such as person names, locations, or nationalities. Presidio also supports a self-hosted compliance posture and hash or placeholder replacement. AWS Bedrock and Lakera are options when you already use those providers.
Detect prompt injection and jailbreaksLakera Guard or Azure Prompt Shield.Attach both if your security review calls for independent providers. Both can screen indirect injection carried in retrieved documents or tool results that appear in the conversation.
Moderate content categoriesOpenAI Moderation for the standard category set.Azure Text Moderation for per-category severity thresholds and server-side blocklists. Alibaba Cloud is the natural choice inside that ecosystem.
Enforce organization-specific rulesBuilt-in keyword guardrail.Use it for literal or regex patterns with no external dependency.

Detection-based guardrails can produce false positives and false negatives, so evaluate a new policy in monitor mode before enforcing it on production traffic. See Guardrail Behavior.

What the Gateway Records

Every request records which guardrails governed it, whether one blocked it, and why a guardrail was skipped for fail-open bypasses. Matched content never appears in gateway logs, usage records, or error responses. AISIX records only detector, entity, or category names. See the per-kind guides for the exact redaction-token and block-envelope shapes.

Next Steps

After you choose a provider, open its setup guide from the comparison table.

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation