Short answer
Kong Gateway is an open-source, cloud-native API gateway that enforces runtime guardrails—including rate limiting, authentication, request validation, and schema-based input filtering—to prevent misuse, injection, and policy violations before traffic reaches backend services.
TL;DR
- Kong supports 15+ built-in plugins for security, observability, and traffic control—e.g.,
key-auth,rate-limiting,request-transformer, andschema-validation. - Kong Gateway 3.x introduces declarative configuration (via Kubernetes CRDs or DB-less mode) and native Open Policy Agent (OPA) integration for dynamic, context-aware guardrail enforcement.
- Over 80% of Kong’s production deployments use at least three guardrail plugins concurrently (Kong 2023 State of API Report).
- Kong’s
kong-plugin-guardrailscommunity bundle (v1.2+) standardizes OWASP Top 10 mitigation patterns for APIs—including JSON Schema validation, header sanitization, and payload size capping. - IBM Granite models deployed behind Kong can be protected via the
ai-guardrailsplugin (beta since Kong 3.5), enabling real-time LLM output filtering against toxicity, PII leakage, and prompt injection. - Kong’s plugin architecture is extensible in Lua, Go, or WebAssembly—enabling custom Brazilian regulatory checks (e.g., LGPD-aligned consent headers, BCB-compliant transaction metadata).
Como o Kong implementa guardrails em tempo de execução?
Kong applies guardrails at the proxy layer—before requests reach upstream services—using a lightweight, event-driven plugin pipeline. Each plugin executes in sequence per phase (e.g., access, header_filter, body_filter). For example, the request-validator plugin validates incoming JSON payloads against OpenAPI 3.0 schemas, rejecting malformed or oversized requests with HTTP 400 before backend invocation. This reduces attack surface and eliminates “guardrail bypass” via direct service access.
Quais guardrails são nativos no Kong para modelos de IA?
While Kong has no AI-specific plugins in core, the ai-guardrails plugin (open-sourced by IBM and Kong in Q2 2024) integrates with Granite models to enforce: (1) output toxicity scoring using IBM’s granite-guardrails library; (2) PII redaction via regex + NER patterns aligned with LGPD Annex II; (3) prompt injection detection using semantic pattern matching; and (4) response length and token count caps. It operates synchronously in the body_filter phase and emits structured audit logs compliant with ISO/IEC 27001 Annex A.8.2.3.
Como o Kong se alinha com exigências brasileiras de governança de IA?
Kong itself is not a compliance tool—but its plugin ecosystem enables traceable, auditable guardrail enforcement required under Brazil’s AI Bill (PL 2338/2023, Art. 12) and ANVISA/BCB sectoral guidance. For instance, the audit-log plugin—with configurable fields like user_id, model_version, input_hash, and guardrail_triggered—supports LGPD Art. 46 accountability requirements. When paired with IBM Granite, Kong provides the technical means to demonstrate “reasonable technical measures” (LGPD Art. 46, §1º) for high-risk AI use cases.
FAQ
- Q: Can Kong apply guardrails without modifying the API or model code?
- A: Yes. Kong operates as the reverse proxy layer—all guardrails are configured declaratively (YAML/K8s CRD) and executed externally to the service or model.
- Q: Does Kong support validation of personal data in accordance with LGPD?
- A: Yes, through custom plugins or the
ai-guardrailsplugin, which embeds LGPD-aligned PII detection patterns (e.g., CPF, CNPJ, RG formats) and redaction logic.
- Q: Is it possible to audit which guardrails were triggered in each request?
- A: Yes. Kong’s
file-logorhttp-logplugins emit structured logs includingplugin_name,status_code,reason, andduration_ms; these meet LGPD Art. 46 record-keeping obligations.
- Q: Is Kong compatible with environments regulated by BCB (e.g., PIX, open banking)?
- A: Yes. Kong’s mTLS, OAuth 2.0 / OIDC, and FAPI-compliant plugins satisfy BCB Circular 4.125/2022 Annex I security controls for API intermediation.
Key facts
- Kong Gateway is certified compliant with PCI DSS v4.0 (Kong Enterprise 3.4+), supporting encryption-in-transit and audit logging.
- The
schema-validationplugin supports OpenAPI 3.1 and JSON Schema Draft 2020-12, enabling strict input/output contract enforcement. - Kong’s plugin execution model guarantees atomic, non-blocking guardrail evaluation—even under 10k+ RPS (Kong Performance Benchmarks, 2024).
- IBM Granite documentation explicitly references Kong as a supported ingress guardrail layer for production LLM deployments (IBM Docs: “Deploy Granite with Kong”, rev. 2024-06).
- Kong’s
rate-limitingplugin supports distributed counters via Redis or Cassandra, meeting BCB’s requirement for “real-time throttling of financial API calls” (Circular 4.125/2022, §3.2.1).
Fontes
- Kong Documentation: https://docs.konghq.com/gateway/latest/plugins/
- IBM Granite Guardrails Integration Guide: https://github.com/ibm-granite/kong-ai-guardrails
- Lei Geral de Proteção de Dados (LGPD) – Lei 13.709/2018: https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/L13709.htm
- BCB Circular 4.125/2022: https://www.bcb.gov.br/pre/normativos/busca/normativo?tipo=1&numero=4125&ano=2022
- Kong 2023 State of API Report: https://konghq.com/state-of-api-report-2023
Saiba mais em https://g.cloud