Join our Newsletter — 33% off our NHI Course
Architecture & Implementation

Kong PDK

← Back to Glossary
By NHI Mgmt Group Updated September 24, 2026 Domain: Architecture & Implementation

The Kong Plugin Development Kit is the supported interface for custom plugins to interact with Kong internals. It provides helper functions for request and response handling, logging, and runtime behavior, while avoiding direct dependence on lower-level Nginx variables unless absolutely necessary.

Kong PDK in the plugin execution model

Kong PDK is the supported abstraction layer for writing custom plugins that run inside Kong’s request pipeline. It gives plugin authors a stable way to inspect and influence traffic without coupling code to low-level Nginx internals.

That separation matters because a plugin is not just “code that runs nearby”; it is code that participates in request handling, response shaping, logging, and runtime decisions. The PDK is the point where extension logic becomes part of the gateway’s operational behavior.

What the PDK exposes to plugin authors

The PDK groups the functionality a plugin usually needs into a smaller, safer surface area. Typical helpers cover request metadata, headers, body handling, response construction, context storage, logging, and access to runtime information that Kong intentionally exposes.

That design reduces the need for brittle direct access to raw Nginx variables. It also makes custom plugins easier to reason about, because the extension interacts with Kong through documented behavior rather than depending on implementation details that may change across releases.

Why Kong PDK is the preferred integration layer

Using the PDK is the difference between a plugin that integrates cleanly and one that is tightly bound to a specific gateway internals model. When the gateway evolves, the PDK is the compatibility boundary that protects plugin logic from unnecessary churn.

It also helps separate gateway concerns from plugin concerns. Kong can retain control over request processing, phase handling, and internal data flow, while plugin authors focus on policy, transformation, observability, or access logic.

Operational implications for custom plugins

Because the PDK sits on the execution path, plugin behavior can affect latency, response correctness, logging fidelity, and request outcomes. Small mistakes, such as reading or mutating the wrong request state at the wrong phase, can create hard-to-diagnose production issues.

The practical takeaway is that PDK usage should be deliberate. A plugin should use the highest-level PDK helper that satisfies the need, only drop lower when necessary, and treat runtime phase behavior as part of the plugin’s design, not an implementation detail.

Risk and Threat Considerations

Custom plugins run close to sensitive traffic handling, so misuse of the PDK can create availability, integrity, and observability problems. The main risk is not the abstraction itself, but what happens when plugin code relies on unstable internals, mishandles request state, or performs unsafe transformations in the wrong execution phase.

Failure mechanism: Direct dependence on low-level internals can break across Kong or Nginx changes, while incorrect use of request, response, or logging helpers can produce malformed responses, missing telemetry, or unintended access decisions.

Impact: The result can be gateway instability, policy bypass, incorrect routing or headers, reduced auditability, and outages that are difficult to isolate because the failure is embedded in extension logic.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, OWASP ASVS and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SC-8 — Transmission Confidentiality and IntegrityKong PDK influences how traffic is handled and protected in transit.
AU-2 — Event LoggingPDK logging helpers affect how plugin actions are recorded for audit and troubleshooting.
CM-7 — Least FunctionalityUsing the supported PDK instead of low-level internals aligns with minimizing unnecessary dependency surface.
Recommendation — Use SC-8 to preserve confidentiality and integrity when plugins inspect or modify traffic. Define AU-2 logging requirements for plugin actions and gateway events. Apply CM-7 by limiting plugins to the supported Kong interfaces they actually need.
OWASP ASVSV15 — Secure Coding and ArchitecturePlugin development through an abstraction layer is an architecture and secure coding concern.
Recommendation — Design Kong plugins to use the supported extension surface and avoid brittle internal coupling.
NIST CSF 2.0PR.PS-01 — Platform SecurityKong PDK is part of secure platform extension behavior and safe runtime interaction.
Recommendation — Manage gateway extensions so platform behavior remains stable, supportable, and controlled.

Practitioner Guidance

Why practitioners should care: The PDK should be treated as the contract boundary for plugin development, not just a convenience API. Code that stays inside the supported abstraction is usually easier to maintain, test, and upgrade safely.

Common misunderstanding: Some teams treat direct internals access as a shortcut when the PDK appears to be missing a helper. That approach may work in the short term, but it increases coupling and makes future gateway upgrades much riskier.

Practitioner takeaway: Prefer PDK helpers first, reserve lower-level access for exceptional cases, and review plugin phase behavior as part of release readiness.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

    NHIMG Editorial Note
    Reviewed and updated by the NHIMG editorial team on September 24, 2026.
    NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org