REGISTER NOW FOR THE KONG AGENTIC ERA WORLD TOUR GOVERN A2A TRAFFIC WITH KONG'S NEW AGENT GATEWAY WHY GARTNER’S “CONTEXT MESH” CHANGES EVERYTHING DON’T MISS API + AI SUMMIT 2026 SEPT 30 – OCT 1
  • [Why Kong](/company/why-kong)Why Kong
    • Explore the unified API Platform
        • BUILD APIs
        • [
          Kong Insomnia](/products/kong-insomnia)
          Kong Insomnia
        • [
          API Design](/products/kong-insomnia/api-design)
          API Design
        • [
          API Mocking](/products/kong-insomnia/api-mocking)
          API Mocking
        • [
          API Testing and Debugging](/products/kong-insomnia/api-testing-and-debugging)
          API Testing and Debugging
        • [
          MCP Client](/products/kong-insomnia/mcp-client)
          MCP Client
        • RUN APIs
        • [
          API Gateway](/products/kong-gateway)
          API Gateway
        • [
          Context Mesh](/products/kong-konnect/features/context-mesh)
          Context Mesh
        • [
          AI Gateway](/products/kong-ai-gateway)
          AI Gateway
        • [
          Event Gateway](/products/event-gateway)
          Event Gateway
        • [
          Kubernetes Operator](/products/kong-gateway-operator)
          Kubernetes Operator
        • [
          Service Mesh](/products/kong-mesh)
          Service Mesh
        • [
          Ingress Controller](/products/kong-ingress-controller)
          Ingress Controller
        • [
          Runtime Management](/products/kong-konnect/features/runtime-management)
          Runtime Management
        • DISCOVER APIs
        • [
          Developer Portal](/products/kong-konnect/features/developer-portal)
          Developer Portal
        • [
          Service Catalog](/products/kong-konnect/features/api-service-catalog)
          Service Catalog
        • [
          MCP Registry](/products/mcp-registry)
          MCP Registry
        • GOVERN APIs
        • [
          Metering and Billing](/products/kong-konnect/features/usage-based-metering-and-billing)
          Metering and Billing
        • [
          APIOps and Automation](/products/apiops-automation)
          APIOps and Automation
        • [
          API Observability](/products/kong-konnect/features/api-observability)
          API Observability
        • [Why Kong?](/company/why-kong)Why Kong?
      • CLOUD
      • [Cloud API Gateways](/products/kong-konnect/features/dedicated-cloud-gateways)Cloud API Gateways
      • [Need a self-hosted or hybrid option?](/products/kong-enterprise)Need a self-hosted or hybrid option?
      • COMPARE
      • [Considering AI Gateway alternatives? ](/performance-comparison/ai-gateway-alternatives)Considering AI Gateway alternatives?
      • [Kong vs. Postman](/performance-comparison/kong-vs-postman)Kong vs. Postman
      • [Kong vs. MuleSoft](/performance-comparison/kong-vs-mulesoft)Kong vs. MuleSoft
      • [Kong vs. Apigee](/performance-comparison/kong-vs-apigee)Kong vs. Apigee
      • [Kong vs. IBM](/performance-comparison/ibm-api-connect-vs-kong)Kong vs. IBM
      • GET STARTED
      • [Sign Up for Kong Konnect](/products/kong-konnect/register)Sign Up for Kong Konnect
      • [Documentation](https://developer.konghq.com/)Documentation
      • FOR PLATFORM TEAMS
      • [Developer Platform](/solutions/building-developer-platform)Developer Platform
      • [Kubernetes and Microservices](/solutions/build-on-kubernetes)Kubernetes and Microservices
      • [Observability](/solutions/observability)Observability
      • [Service Mesh Connectivity ](/solutions/service-mesh-connectivity)Service Mesh Connectivity
      • [Kafka Event Streaming](/solutions/kafka-stream-api-management)Kafka Event Streaming
      • FOR EXECUTIVES
      • [AI Connectivity](/ai-connectivity)AI Connectivity
      • [Open Banking](/solutions/open-banking)Open Banking
      • [Legacy Migration](/solutions/legacy-api-management-migration)Legacy Migration
      • [Platform Cost Reduction](/solutions/api-platform-consolidation)Platform Cost Reduction
      • [Kafka Cost Optimization](/solutions/reduce-kafka-cost)Kafka Cost Optimization
      • [API Monetization](/solutions/api-monetization)API Monetization
      • [AI Monetization](/solutions/ai-monetization)AI Monetization
      • [AI FinOps](/solutions/ai-cost-governance-finops)AI FinOps
      • FOR AI TEAMS
      • [Agent Gateway](/agent-gateway)Agent Gateway
      • [AI Governance](/solutions/ai-governance)AI Governance
      • [AI Security](/solutions/ai-security)AI Security
      • [AI Cost Control](/solutions/ai-cost-optimization-management)AI Cost Control
      • [Agentic Infrastructure](/solutions/agentic-ai-workflows)Agentic Infrastructure
      • [MCP Production](/solutions/mcp-production-and-consumption)MCP Production
      • [MCP Traffic Gateway](/solutions/mcp-governance)MCP Traffic Gateway
      • FOR DEVELOPERS
      • [Mobile App API Development](/solutions/mobile-application-api-development)Mobile App API Development
      • [GenAI App Development](/solutions/power-openai-applications)GenAI App Development
      • [API Gateway for Istio](/solutions/istio-gateway)API Gateway for Istio
      • [Decentralized Load Balancing](/solutions/decentralized-load-balancing)Decentralized Load Balancing
      • BY INDUSTRY
      • [Financial Services](/solutions/financial-services-industry)Financial Services
      • [Healthcare](/solutions/healthcare)Healthcare
      • [Higher Education](/solutions/api-platform-for-education-services)Higher Education
      • [Insurance](/solutions/insurance)Insurance
      • [Manufacturing](/solutions/manufacturing)Manufacturing
      • [Retail](/solutions/retail)Retail
      • [Software & Technology](/solutions/software-and-technology)Software & Technology
      • [Transportation](/solutions/transportation-and-logistics)Transportation
      • [See all Solutions](/solutions)See all Solutions
  • [Pricing](/pricing)Pricing
      • DOCUMENTATION
      • [Kong Konnect](https://developer.konghq.com/konnect/)Kong Konnect
      • [Kong Gateway](https://developer.konghq.com/gateway/)Kong Gateway
      • [Kong Mesh](https://developer.konghq.com/mesh/)Kong Mesh
      • [Kong AI Gateway](https://developer.konghq.com/ai-gateway/)Kong AI Gateway
      • [Kong Event Gateway](https://developer.konghq.com/event-gateway/)Kong Event Gateway
      • [Kong Insomnia](https://developer.konghq.com/insomnia/)Kong Insomnia
      • [Plugin Hub](https://developer.konghq.com/plugins/)Plugin Hub
      • EXPLORE
      • [Blog](/blog)Blog
      • [Learning Center](/blog/learning-center)Learning Center
      • [eBooks](/resources/e-book)eBooks
      • [Reports](/resources/reports)Reports
      • [Demos](/resources/demos)Demos
      • [Customer Stories](/customer-stories)Customer Stories
      • [Videos](/resources/videos)Videos
      • EVENTS
      • [API + AI Summit](/events/conferences/api-ai-summit)API + AI Summit
      • [Agentic Era World Tour](/agentic-era-world-tour)Agentic Era World Tour
      • [Webinars](/events/webinars)Webinars
      • [User Calls](/events/user-calls)User Calls
      • [Workshops](/events/workshops)Workshops
      • [Meetups](/events/meetups)Meetups
      • [See All Events](/events)See All Events
      • FOR DEVELOPERS
      • [Get Started](https://developer.konghq.com/)Get Started
      • [Community](/community)Community
      • [Certification](/academy/certification)Certification
      • [Training](https://education.konghq.com)Training
      • COMPANY
      • [About Us](/company/about-us)About Us
      • [We're Hiring!](/company/careers)We're Hiring!
      • [Press Room](/company/press-room)Press Room
      • [Contact Us](/company/contact-us)Contact Us
      • [Kong Partner Program](/partners)Kong Partner Program
      • [Enterprise Support Portal](https://support.konghq.com/s/)Enterprise Support Portal
      • [Documentation](https://developer.konghq.com/?_gl=1*tphanb*_gcl_au*MTcxNTQ5NjQ0MC4xNzY5Nzg4MDY0LjIwMTI3NzEwOTEuMTc3MzMxODI2MS4xNzczMzE4MjYw*_ga*NDIwMDU4MTU3LjE3Njk3ODgwNjQ.*_ga_4JK9146J1H*czE3NzQwMjg1MjkkbzE4OSRnMCR0MTc3NDAyODUyOSRqNjAkbDAkaDA)Documentation
  • [](/search)
  • [Login](https://cloud.konghq.com/login)Login
  • [Book Demo](/contact-sales)Book Demo
  • [Get Started](/products/kong-konnect/register)Get Started
[Blog](/blog)Blog
  • [AI Gateway](/blog/tag/ai-gateway)AI Gateway
  • [AI Security](/blog/tag/ai-security)AI Security
  • [AIOps](/blog/tag/aiops)AIOps
  • [API Security](/blog/tag/api-security)API Security
  • [API Gateway](/blog/tag/api-gateway)API Gateway
|
    • [API Management](/blog/tag/api-management)API Management
    • [API Development](/blog/tag/api-development)API Development
    • [API Design](/blog/tag/api-design)API Design
    • [Automation](/blog/tag/automation)Automation
    • [Service Mesh](/blog/tag/service-mesh)Service Mesh
    • [Insomnia](/blog/tag/insomnia)Insomnia
    • [Event Gateway](/blog/tag/event-gateway)Event Gateway
    • [View All Blogs](/blog/page/1)View All Blogs
We're Entering the Age of AI Connectivity [Read more](/blog/news/the-age-of-ai-connectivity)Read moreProducts & Agents:
    • [Kong AI Gateway](/products/kong-ai-gateway)Kong AI Gateway
    • [Kong API Gateway](/products/kong-gateway)Kong API Gateway
    • [Kong Event Gateway](/products/event-gateway)Kong Event Gateway
    • [Kong Metering & Billing](/products/usage-based-metering-and-billing)Kong Metering & Billing
    • [Kong Insomnia](/products/kong-insomnia)Kong Insomnia
    • [Kong Konnect](/products/kong-konnect)Kong Konnect
  • [Documentation](https://developer.konghq.com)Documentation
  • [Book Demo](/contact-sales)Book Demo
  1. Home
  2. Blog
  3. Engineering
  4. Beyond Static Routing: Modernizing API Logic with Conditional Policy Execution
[Engineering](/blog/engineering)Engineering
April 15, 2026
3 min read

# Beyond Static Routing: Modernizing API Logic with Conditional Policy Execution

Hugo Guerrero
Principal Tech PMM, Kong

Modern API architectures are no longer linear. A single request can traverse multiple layers of authentication, transformation, enrichment, and observability. As these flows grow more dynamic, the need for fine-grained control over when plugins execute becomes critical.

For years, the standard approach to API Gateway configuration followed a strict hierarchical model: you applied a plugin to a Service, a Route, or a Consumer. If you needed a plugin to behave differently based on a specific header or a dynamic path segment, you often had to split your configuration into multiple routes or resort to custom Lua scripts.

The introduction of [conditional plugin execution](https://developer.konghq.com/gateway/plugins/expressions/)conditional plugin execution in [Kong Gateway 3.14](https://konghq.com/blog/product-releases/kong-gateway-3-14)Kong Gateway 3.14 marks a shift from static, entity-bound logic. This enhancement empowers platform engineers to define precise, fine-grained execution rules directly within the plugin configuration.

This is more than a convenience feature. It fundamentally changes how you design API traffic flows.

## The "route explosion"

Imagine you have a single Service, *order-api*. You want to apply a strict rate limit to most traffic, but you want to bypass that limit—or apply a different one—if the request contains a specific *X-App-Priority: High* header.

Previously, you had two choices, neither of them ideal:

  1. - **Create two identical routes:** One matching the header and one not. This duplicates your routing logic and increases the surface area for configuration errors.
  2. - **Custom Plugin:** Write a wrapper plugin that checks the header before executing the internal logic. This adds maintenance overhead and requires Lua expertise.

## Declarative conditional policy execution

Kong Gateway 3.14 introduces a new condition field on plugins. This allows you to define when a plugin-based policy should execute, using Kong’s Advanced Traffic Control (ATC) expression language.

The logic is simple: If the condition evaluates to true, the plugin runs. If not, it is skipped.

You can now attach a plugin to a Service or Route but tell Kong: *"Only actually run this if these specific request criteria are met."*

This enables per-request decision-making without changing your routing topology.

### A practical example: Conditional OIDC authentication

Consider a common enterprise scenario:

  • - Requests may arrive with a client certificate already validated upstream
  • - **If** a certificate is present, you want to skip OIDC authentication
  • - **Otherwise**, enforce OIDC

Previously, this required multiple routes or complex routing logic.

With conditional plugin execution, this logic is now declarative:

_format_version: "3.0"
services:
  - name: core
    url: http://core-service:8080
    routes:
      - name: core_route
        paths:
          - /api

    plugins:
      - name: oidc
        condition: "http.headers.ssl_client_cert == nil"
        config:
          # OIDC configuration details...

**What’s happening here?**

  • - The `oidc` plugin is attached at the Service level, potentially covering dozens of routes.
  • - The `condition` checks for the absence of the `ssl_client_cert` header.
  • - If the header is missing, OIDC triggers. If present, the gateway bypasses the plugin entirely.

This creates a clean, declarative security policy without duplicating routes.

## Under the hood: ATC expressions

The `condition` field uses Kong’s Advanced Traffic Control (ATC) expression language.

For example:

http.headers.ssl_client_cert == nil
  • - **Normalization:** Header names are normalized *(e.g., http.headers.ssl_client_cert)*, ensuring consistency regardless of client formatting.
  • - **Performance:** ATC expressions are compiled into an efficient internal representation. They are evaluated in microseconds, ensuring that adding conditions doesn't introduce measurable latency.
  • - **Context-Aware:** Expressions can reference almost any request attribute, including headers, methods, paths, shared context, and more.

This gives you a powerful, composable way to define execution logic.

## Why this matters

**Reduced configuration complexity — **By eliminating the need for "shadow routes" created solely for plugin variations, your kong.yaml or Admin API state remains clean and readable. This significantly reduces the cognitive load for DevOps teams auditing the system.

**Decoupling logic from infrastructure — **Conditional execution allows you to treat plugins as "policies" rather than "attachments." You can apply a global plugin to every route in your workspace but use conditions to ensure it only fires for specific protocols, methods, or query parameters.

**Better observability — **When using the *instance_name* field alongside conditions, your logs and metrics become much more descriptive. You can see exactly which conditional instance of a plugin was triggered, making debugging complex traffic patterns straightforward.

## A shift toward declarative intelligence

Conditional plugin execution shifts API infrastructure from rigid to dynamic and context-aware, supporting a modern, declarative control plane. It recognizes that in complex environments (like those with AI and event-driven architectures), request context is critical for unique processing.

This feature allows Kong Gateway real-time adaptability by evaluating request attributes to dynamically execute plugins. Instead of uniform application, security, traffic, or transformation logic is applied only when specific conditions are met (e.g., header presence, IP range, consumer group). This precision boosts efficiency, reduces latency, and offers granular API lifecycle control.


## Get started modernizing your API logic

The introduction of conditional policy execution represents a shift toward a more "intent-based" networking model for API gateways. By using the power of ATC expressions, Kong Gateway allows engineers to build highly sophisticated, context-aware API policies without the baggage of configuration sprawl.

With conditional plugin execution in Kong Gateway 3.14, you can:

  • - Reduce configuration complexity
  • - Improve performance
  • - Centralize policy enforcement
  • - Unlock advanced traffic patterns

Most importantly, you gain precision control over your API flows without sacrificing simplicity.

This is a foundational capability for building AI-ready, policy-driven infrastructure, where decisions are made dynamically at the edge.

*To get started with conditional plugins, check out the *[*Kong Documentation*](https://developer.konghq.com/gateway/entities/plugin/#conditional-plugin-execution)*Kong Documentation** and the available *[*tutorial,*](https://developer.konghq.com/gateway/configure-conditional-plugin-execution/)*tutorial,** and explore the *[*conditional expressions for plugins*](https://developer.konghq.com/gateway/plugins/expressions/)*conditional expressions for plugins**.*

- [Kong Gateway](/blog/tag/kong-gateway)Kong Gateway- [Kong Gateway Enterprise](/blog/tag/kong-enterprise)Kong Gateway Enterprise- [API Gateway](/blog/tag/api-gateway)API Gateway- [Microservices](/blog/tag/microservices)Microservices

Table of Contents

  • The "route explosion"
  • Declarative conditional policy execution
  • Under the hood: ATC expressions
  • Why this matters
  • A shift toward declarative intelligence
  • Get started modernizing your API logic

## More on this topic

_Videos_

## Unlock Microservices Mastery: OpenTelemetry in Kong Gateway

_Videos_

## Kong Builders Nov 16- Introducing Kong Gateway Operator

## See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

[Get a Demo](/contact-sales)Get a Demo
**Topics**
- [Kong Gateway](/blog/tag/kong-gateway)Kong Gateway- [Kong Gateway Enterprise](/blog/tag/kong-enterprise)Kong Gateway Enterprise- [API Gateway](/blog/tag/api-gateway)API Gateway- [Microservices](/blog/tag/microservices)Microservices
Hugo Guerrero
Principal Tech PMM, Kong

Recommended posts

# Token Exchange at the Gateway

[Engineering](/blog)EngineeringApril 15, 2026

How OAuth 2.0 Token Exchange Reshapes Trust Between Services — and Why the API Gateway Is Exactly the Right Place to Enforce It Modern applications don’t run as a single monolithic. They are composed of services — frontend APIs, backend microservi

Veena Rajarathna
[](https://konghq.com/blog/engineering/token-exchange-at-the-gateway)

# How to Dynamically Route Requests With Kong Enterprise

[Engineering](/blog)EngineeringJuly 31, 2020

Having worked with many customers and prospects at Kong, one of the main requirements we often hear is how to handle dynamic routing based on the URL and headers. In this blog post, I will cover different use cases we come across for dynamic routing

Mos Amokhtari
[](https://konghq.com/blog/engineering/how-to-dynamically-route-requests-with-kong-enterprise)

# No More Static Secrets: Kong Expands Cloud-Native Authentication Support

[Engineering](/blog)EngineeringApril 15, 2026

How Kong Gateway 3.14 closes the consistency gap in IAM-based authentication across AWS, Azure and GCP — and what it means for your production deployments Starting with 3.13 (which addressed Redis support) and completed in 3.14, Kong now presents

Walker Zhao
[](https://konghq.com/blog/engineering/cloud-native-authentication)

# Practical Strategies to Monetize AI APIs in Production

[Engineering](/blog)EngineeringMarch 27, 2026

Traditional APIs are, in a word, predictable. You know what you're getting: Compute costs that don't surprise you Traffic patterns that behave themselves Clean, well-defined request and response cycles AI APIs, especially anything that runs on LLMs

Deepanshu Pandey
[](https://konghq.com/blog/engineering/monetize-ai-apis)

# Connecting Kong and Solace: Building Smarter Event-Driven APIs

[Engineering](/blog)EngineeringMarch 20, 2026

Running Kong in front of your Solace Broker adds real benefits: Authentication & Access Control – protect your broker from unauthorized publishers. Validation & Transformation – enforce schemas, sanitize data, and map REST calls into event topics.

Hugo Guerrero
[](https://konghq.com/blog/engineering/smarter-event-driven-apis-kong-solace)

# Kong Gateway 3.9: Extended AI Support and Enhanced Security

[Product Releases](/blog)Product ReleasesDecember 20, 2024

Today we're excited to announce Kong Gateway 3.9!  Since unveiling Kong Gateway 3.8 at API Summit 2024 just a few months ago, we’ve been busy making important updates and improvements to Kong Gateway. This release introduces new functionality arou

Alex Drag
[](https://konghq.com/blog/product-releases/kong-gateway-3-9)

# What's New in Kong Gateway 3.7?

[Product Releases](/blog)Product ReleasesMay 29, 2024

We're thrilled to announce the general availability of Kong Gateway 3.7 and Kong Gateway Enterprise 3.7. Along with enhancements and new features for both OSS and enterprise users, this version comes with the general availability of our edge AI Gate

Veena Rajarathna
[](https://konghq.com/blog/product-releases/kong-gateway-3-7)

## Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

[Get a Demo](/contact-sales)Get a Demo

## step-0

  • ## Company

    • [About Kong](/company/about-us)About Kong
    • [Customers](/customer-stories)Customers
    • [Careers](/company/careers)Careers
    • [Press](/company/press-room)Press
    • [Events](/events)Events
    • [Contact](/company/contact-us)Contact
    • [Pricing](/pricing)Pricing
      • Terms
      • Privacy
      • Trust and Compliance
  • ## Platform

    • [Kong AI Gateway](/products/kong-ai-gateway)Kong AI Gateway
    • [Kong Konnect](/products/kong-konnect)Kong Konnect
    • [Kong Gateway](/products/kong-gateway)Kong Gateway
    • [Kong Event Gateway](/products/event-gateway)Kong Event Gateway
    • [Kong Insomnia](/products/kong-insomnia)Kong Insomnia
    • [Documentation](https://developer.konghq.com)Documentation
    • [Book Demo](/contact-sales)Book Demo
  • ## Compare

    • [AI Gateway Alternatives](/performance-comparison/ai-gateway-alternatives)AI Gateway Alternatives
    • [Kong vs Apigee](/performance-comparison/kong-vs-apigee)Kong vs Apigee
    • [Kong vs IBM](/performance-comparison/ibm-api-connect-vs-kong)Kong vs IBM
    • [Kong vs Postman](/performance-comparison/kong-vs-postman)Kong vs Postman
    • [Kong vs Mulesoft](/performance-comparison/kong-vs-mulesoft)Kong vs Mulesoft
  • ## Explore More

    • [Open Banking API Solutions](/solutions/open-banking)Open Banking API Solutions
    • [API Governance Solutions](/solutions/api-governance)API Governance Solutions
    • [Istio API Gateway Integration](/solutions/istio-gateway)Istio API Gateway Integration
    • [Kubernetes API Management](/solutions/build-on-kubernetes)Kubernetes API Management
    • [API Gateway: Build vs Buy](/campaign/secure-api-scalability)API Gateway: Build vs Buy
    • [Kong vs Apigee](/performance-comparison/kong-vs-apigee)Kong vs Apigee
  • ## Open Source

    • [Kong Gateway](https://developer.konghq.com/gateway/install/)Kong Gateway
    • [Kuma](https://kuma.io/)Kuma
    • [Insomnia](https://insomnia.rest/)Insomnia
    • [Kong Community](/community)Kong Community

Kong enables the connectivity layer for the agentic era – securely connecting, governing, and monetizing APIs and AI tokens across any model or cloud.

  • English
  • Japanese
  • Frenchcoming soon
  • Spanishcoming soon
  • Germancoming soon
© Kong Inc. 2026
Interaction mode