Apache APISIX custom plugin development

When a stock APISIX plugin does not cover a requirement, a custom plugin can, but it adds code your team must test, package and keep working across upgrades. This page explains what the work includes, what drives its cost, and what to provide.

On this page

When Apache APISIX custom plugin development is worth the cost

Custom plugin development is a scoped engineering task, and most gateway teams should reach for it last. When an APISIX route needs logic the more than 100 built-in plugins do not provide, such as a bespoke authorization check, a request transform tied to an internal system, or a custom logging format, the first step is to confirm that no combination of built-in plugins, route configuration, consumer design or the existing authentication plugins covers the need. Only after that review does a plugin become the right answer, and its cost should be weighed against the ongoing work of maintaining code inside the request path.

Teams that already write Lua, or the language of the runner they plan to use, and that run a non-production APISIX environment with realistic routes, often build small plugins in-house. This is reasonable for low-risk logic such as a log field or a header transform. A partner is usually worth bringing in for plugins on the request path of critical APIs, for work through the Java, Go or Python plugin runners or WebAssembly where the team lacks depth, or for a fixed deliverable that includes tests, documentation and handover. The deciding question is who will own the plugin after go-live, because that owner must be able to test it against each APISIX release.

Before you request a quote, confirm three things with your gateway team: the exact requirement written as inputs and outputs, the runner or language your organization can support, and the environment where tests will run. Ask a partner to state which of these it will deliver, such as code, unit and integration tests, packaging and a handover session, and what it will not cover, such as production change approval. The scope should also say how the plugin will be checked against the APISIX version in use, since the APISIX downloads page lists releases on a regular cadence that will need to be followed.

Choosing Lua, a plugin runner or WebAssembly for an APISIX plugin

Lua plugins are the native route. They run inside the gateway's request lifecycle, so the plugin is written against APISIX's plugin interface and runs in the same process as the built-in plugins. The apache/apisix repository lists this route alongside the others. The team that owns the plugin needs Lua skills and enough familiarity with NGINX request phases to know where each piece of logic belongs.

  • Maintainer: a team with Lua skills, usually the platform or gateway team, because changes touch the gateway process itself.
  • Access: the request, response and variables available in the plugin phases, plus the internal APIs the gateway exposes to Lua code. Access is broad, so review this code as privileged.
  • Loading and testing: the plugin is placed in the gateway's plugin path, enabled in configuration, then tested with unit tests and a staging gateway. Confirm the load steps for your deployment mode.
  • Performance and debugging: in-process execution keeps the call path short. Debugging uses the gateway's error logs and standard Lua tooling, which most platform teams already know.

Check that your upgrade process can rebuild and retest every Lua plugin against each new APISIX release before it reaches production.

What a custom APISIX plugin engagement includes

A custom plugin engagement is six pieces of work that depend on each other: the design fixes what the plugin does, the build delivers it in a chosen language, and the tests, packaging and compatibility checks prove it runs on the APISIX release your team operates. Each component ends with a named deliverable so you can check progress and hand the work over.

Requirements and plugin design

Design starts with the request the plugin must handle, the phase where it runs in the request lifecycle, and the inputs and outputs it reads and writes. The result is a configuration schema that operators fill in per route or consumer, and a list of the upstream services and identity sources it depends on. Check that the schema rejects invalid settings at load time. Deliverable: a signed-off design document and schema.

Implementation in the chosen runtime

The language decision is made here: Lua runs inside the gateway process, while the Java, Go and Python plugin runners and WebAssembly add a separate process or sandbox with its own overhead and debugging path. Ask which runtime your platform team can operate and patch. Each option changes build tooling and performance characteristics. Deliverable: plugin source committed to your repository.

APISIX repository

Automated tests against a running instance

Tests run against a live APISIX instance rather than only unit-level mocks, so they exercise route matching, plugin ordering and configuration reload. Cover valid and invalid configuration, authentication failures, and behavior when the upstream is slow or unavailable. Confirm the test suite runs in your CI pipeline. Deliverable: a test suite with run instructions and a pass report.

Packaging and deployment into your environment

Packaging defines how the plugin reaches your gateway nodes: a versioned artifact, a container image or a file mounted into the gateway configuration, and the matching entry in the plugin list. Traditional, decoupled and standalone deployments each load configuration differently, so the rollout path depends on the mode you run. Confirm who approves production releases. Deliverable: build artifacts and a documented deployment procedure.

Deployment modes docs

Compatibility checks against your release line

APISIX releases change internal APIs, so a plugin that loads on one version can fail on another. Test the plugin against the exact release your team runs and record the result for each version you plan to move to. Ask the team to state which release line is in production and who approves a move. Deliverable: a compatibility matrix and a pinned version record.

Documentation and handover

Handover closes the gap between the people who built the plugin and the people who will run it. The operations note covers configuration fields, failure symptoms, log locations and rollback steps. Agree before work starts who owns the code after handover and who answers questions during the first operating period. Deliverable: source in your repository, the test suite, build artifacts and an operations note.

What drives the cost and duration of a custom APISIX plugin

This table lists the factors that most change the effort of a custom APISIX plugin, why each one matters, and how to keep it down. Read it before asking for a quote, because each row is a question the scope should answer in writing. The main takeaway is that the request phase, the runner choice and external calls usually matter more than the line count of the plugin itself.

DriverWhy it mattersHow to keep it down
Request phase and response changesA plugin that runs in the access phase and only rejects requests is far simpler than one that rewrites upstream responses or body content, which adds buffering, ordering and error-path work.Confirm the phase in the design before build. Keep response changes to headers where possible and state body rewriting explicitly in the scope.
Language or runnerLua runs inside the gateway process. Java, Go and Python run through plugin runners, and WebAssembly adds its own toolchain. Each adds build, debugging and upgrade work if your team does not already run it.Choose the language your team already maintains. Confirm which runner or WebAssembly route the target APISIX release supports before committing.
External calls to identity stores, databases or servicesEach network call adds timeouts, retries, caching, failure handling and secrets management, and changes how the plugin behaves under load.Limit calls on the request path. Cache results where the data allows it, and define the fallback when the dependency is down.
Number and validation of configuration optionsEvery option needs a schema, defaults, documentation and negative tests. Options that interact multiply the test cases.Keep the option set small and fixed in the written scope. Move rarely used settings into the route or consumer design instead of the plugin.
Test coverage and CI integrationGateway plugins sit on every request path, so unit, integration and regression tests against the target APISIX version take real time to build and keep running.Ask for the test matrix in the scope, including the APISIX versions covered. Reuse the team's existing CI pipeline rather than building a new one.
Environments and gateway nodesEach environment needs its own packaging and configuration, and each gateway node must load the same plugin version. Node count changes rollout and verification effort.Use one artifact promoted through environments. Confirm the rollout method for multiple nodes and whether a restart or hot reload is needed.
Compliance evidence the plugin must produceAudit log fields, access decisions and change records may need to be produced and retained in a form assessors can review. Missing fields often surface late in a security review.List required log fields and retention in the written requirements before design. Confirm with your compliance team what evidence they will accept.

How a custom plugin sits in the APISIX request path

A client request enters APISIX and runs through the plugin phases in order, with built-in plugins and your custom plugin both on the path. A custom plugin can run as Lua inside the gateway, or it can hand work to an external runner process (Java, Go or Python) or a WebAssembly module, which is where the trust boundary sits. The configuration path runs from the Admin API into etcd and out to the gateway nodes. Check which language runtime each plugin uses, what it can read from the request, and whether it fails open or closed when the runner is unavailable.

Request path through built-in and custom plugins, with the configuration path from the Admin API.

The phases of a custom APISIX plugin project and what each produces

A custom plugin project moves from a written specification through build, staging, acceptance and rollout to handover, and each phase closes with a named artifact the client keeps. The sequence keeps the plugin tied to the APISIX mode, release line and security review your organization actually operates. The schedule for each phase comes from the agreed written scope.

  1. Define requirements and write the plugin specification

    DeployOpen reviews the APIs, routes and traffic the plugin must act on, along with the authentication, logging and header behavior it must follow. We confirm which APISIX deployment mode you run (traditional, decoupled or standalone) and which APISIX release line you target. The output is a written plugin specification covering inputs, outputs, configuration keys, failure behavior and out-of-scope items. The step is done when your team has signed off the specification in writing.

  2. Choose the language or runner and design the plugin

    We compare Lua, the Java, Go and Python plugin runners, and WebAssembly against your team's skills, the latency budget, and how the plugin will be maintained after handover. The design covers the plugin phases it hooks into, its schema for configuration validation, and how it interacts with built-in plugins. The output is a short design record that names the chosen approach and the reasons for it. Confirm the runner's support status for your target release before committing to it.

  3. Build the plugin with unit and integration tests

    Engineers implement the plugin and write unit tests for its logic and configuration validation. Integration tests run the plugin against a local APISIX instance with the same deployment mode and configuration format used in production, so route matching, hot reload and error paths are exercised. The output is a versioned source repository, a test report and a README describing configuration keys. The step is done when the tests pass in your CI system or in a pipeline we set up with you.

  4. Deploy to staging in your APISIX mode

    The plugin is installed in a staging environment that matches your production topology, whether traditional with a single etcd cluster, decoupled with separate control and data planes, or standalone with a file-driven configuration. We check that the plugin loads, reloads without a gateway restart, and behaves correctly under representative routes and consumers. The output is a staging deployment record listing versions, configuration and observed results. Confirm that the staging environment's access controls and secrets handling match production.

  5. Run acceptance testing and security review

    Your team runs acceptance tests against the written specification, and DeployOpen performs a security review of the plugin code and its configuration handling. The review checks input validation, credential and secret handling, error responses that could leak data, and resource use under load. Findings are logged with severity and fixes are retested. The output is an acceptance sign-off and a security review report. The step is done when every open finding is either fixed and retested or accepted in writing by the risk owner.

  6. Roll out to production with a rollback path

    The plugin is enabled in production through a controlled change, typically on a limited set of routes first where the platform allows it. The rollback procedure is written and rehearsed before the change, including how to disable the plugin from its configuration and which previous configuration version to restore. Operators watch error rates and latency during the window. The output is a change record, a rollback runbook and confirmation that the plugin is active on the agreed routes.

  7. Hand over code, runbooks and upgrade notes

    DeployOpen transfers the source code, build and packaging scripts, test suite, configuration reference and operating runbook to your team. The handover includes notes on how the plugin is tested against new APISIX releases before upgrades, and which parts depend on runner or Lua interfaces that may change. Your engineers are walked through a live configuration change and a rollback. The output is a handover package and a completed handover checklist signed by your platform owner.

Which parts of plugin work teams keep in-house and which they outsource

This table compares six areas of custom APISIX plugin work by the skills each needs and whether teams usually keep it in-house or hand it to a partner. Read the last column as a starting point, since the split depends on existing Lua, Go, Java or Python skills and on how much security review the plugin needs. The main takeaway is that business rules stay with the domain owner, while the first test harness, the security review and the release-by-release maintenance are the areas where outside help is most often used.

Work areaSkills it needsUsually in-house or outsourced
Plugin specification and business rulesDomain knowledge, API design, clear acceptance criteriaIn-house, owned by the domain owner
Lua or runner implementationLua for native plugins, or Go, Java or Python for plugin runnersDepends on existing skills in the team's language
Test harness and CI pipelineTest framework for APISIX plugins, CI tooling, gateway test environmentsOften outsourced for the first build, then handed over
Packaging and deployment automationContainer builds, configuration management, rollout tooling for gateway nodesIn-house once handed over and documented
Security review of header, body and credential accessGateway threat modeling, secrets handling, code review of request and response processingOften outsourced or done by an independent reviewer
Ongoing maintenance per APISIX releaseTracking release notes, re-running plugin tests, upgrade planningIn-house, with a retainer option for release testing

Keeping custom plugins working across Apache APISIX upgrades

A custom plugin is only as stable as the gateway interfaces it calls. Every custom plugin depends on APISIX's plugin interfaces, including the phases it hooks into, the schema it validates against, and the variables and APIs it reads from the request. Each APISIX release line can change those interfaces, so an upgrade that is safe for the built-in plugins can still break yours. Plan for this before go-live, not during the first upgrade window. Pin the exact APISIX version your plugin was built and tested against in your build files and container images, so that a plugin change and a gateway change are never mixed in the same release. Record which runner version (Java, Go or Python) or WebAssembly SDK version the plugin uses alongside that pin.

Put the plugin test suite in CI and run it against the next APISIX release before any production change. The suite should cover schema validation, the request and response behavior in each phase the plugin uses, and failure paths such as an unreachable upstream or a malformed token. Run it against a candidate build of the gateway in a non-production environment, and treat any failure as a blocking defect in the plugin or in your upgrade plan. Repeat the check whenever the plugin runner or the WebAssembly SDK changes, even if the gateway version stays the same, because a runner change can alter how the plugin is loaded, how it communicates with APISIX, or how errors surface. Ask your implementation partner or internal team to confirm which runner and SDK versions your plugin depends on and to document the compatibility check they used.

The downloads page lists APISIX 3.19.0, released on September 28, 2026, and does not mark any release as long-term support, so the choice of which release line to follow and how long to stay on it is yours to define. Write an upgrade policy that states which release lines you accept, how quickly you adopt new patch releases, who approves a minor-version change, and what evidence the change needs before it reaches production. Ongoing upgrade work after go-live, including the operational side of that policy, is covered on the Apache APISIX upgrades and support page.

What usually goes wrong with custom APISIX plugins and how to prevent it

Custom plugins sit in the request path of every API they protect, so a small mistake can weaken authentication, leak data or take the gateway down. The six risks below recur across Apache APISIX plugin projects, and each one has a design or test step that catches it before production.

Plugin runs in the wrong phase

A plugin that reads or sets identity in the wrong request phase can run before or after the authentication plugin has decided, so a request is allowed or denied for the wrong reason. Map each plugin's phase and priority against the built-in authentication plugins on the same route. Then test a rejected token, a missing key and an expired credential on that exact route, and confirm the outcome is unchanged after the custom plugin is added.

openid-connect docs

Secrets written to logs

Custom plugins often log request headers, upstream responses or error objects while debugging, and those logs can carry bearer tokens, API keys or client secrets into log stores with weaker access controls. Define a redaction list for headers and fields before coding starts, keep debug logging behind a configuration flag that is off in production, and include a test that sends a known token and searches the log output for it.

Runner becomes a bottleneck

Plugins written for the Java, Go or Python runners run in a separate process that APISIX calls for each request, so a slow or crashed runner can add latency or fail every route that uses it. Measure the added latency under expected peak load, run more than one runner instance where the design allows, and define what the gateway should do when the runner is unavailable. Confirm these behaviors with your own load test, since they depend on your configuration.

Upgrade breaks the plugin

A plugin written against one APISIX release can fail after an upgrade if internal Lua modules, plugin interfaces or runner protocols change. Pin the release line you tested, record the exact version in your build, and run the plugin's test suite against each candidate version in a staging gateway before the production upgrade. Read the release notes for changes to plugin APIs, and treat any failure as a blocker for that release.

APISIX downloads

Untested on the real configuration path

A plugin that passes unit tests can still fail when it receives configuration from etcd through the Admin API in traditional or decoupled mode, or from the YAML file used in standalone mode. Test the plugin through the same configuration path production uses, including schema validation, hot reload and a route change made while traffic flows. Check the mode-specific ports and reload behavior described in the deployment modes documentation.

Deployment modes docs

Knowledge held by one engineer

When a plugin exists only in one engineer's head, the next incident or upgrade depends on that person being available, and the plugin becomes hard to audit. Require a short design note covering purpose, phase, configuration schema, failure behavior and test coverage, store the source and tests in version control with code review, and run a handover exercise where a second engineer deploys and debugs the plugin in staging.

What the client needs to provide before plugin work starts

Before any plugin code is written, the client needs to name a business owner for the plugin's rules. A custom plugin usually encodes a decision the business has already made, such as which requests get rejected, how a header is rewritten, or which callers are allowed through a route. Someone accountable for that rule must confirm the expected behavior with examples, because the developer cannot infer it from the gateway configuration. DeployOpen plans and tests these items with the client rather than assuming them, so the business owner is asked to sign off the acceptance cases before the first build.

The client also provides a non-production APISIX environment that matches the production deployment mode. If production runs in traditional mode with an etcd cluster, or in decoupled or standalone mode, the test environment should use the same mode and the same plugin configuration format. A plugin that loads in a single-node sandbox can behave differently when configuration is pushed through etcd or read from a file. Confirm which mode production uses, which APISIX release line is deployed, and whether the Admin API on port 9180 can be reached from the build pipeline. Also name the repository and CI system where the code will live, along with who can approve merges and who holds the deployment credentials for the test gateway.

Next, list the identity provider, internal APIs and test accounts the plugin will call. If the plugin validates tokens, calls a policy service, or looks up a customer record, the client must supply endpoints, a test tenant, and service accounts with limited permissions. Name the security owner who will review what the plugin can read from requests, responses and consumer data, and what it may write to logs. This review should happen before development, since it decides which fields the plugin may touch. Finally, make a documented decision on the target APISIX release line. Check the APISIX downloads page for the currently supported versions, and confirm with the client's platform team which line they will upgrade to. The plugin's language choice, whether Lua, a plugin runner, or WebAssembly, depends on that decision.

Questions buyers ask about Apache APISIX custom plugin development

Can a built-in plugin or a configuration change replace custom plugin code?

Often, yes, and that should be the first check. APISIX documents more than 100 built-in plugins covering authentication, security, traffic control, observability and AI gateway functions. Before writing code, map each requirement to a built-in plugin, a combination of plugins, or a route, consumer or upstream setting. Custom code is justified when the logic is specific to your business, such as a proprietary token format, a bespoke header transformation or an internal policy check that no existing plugin covers. Document the gap first so the decision rests on evidence rather than preference.

Does the choice of Lua, a plugin runner or WebAssembly change who maintains the plugin?

Yes. The language and runtime determine which skills your team needs to keep the plugin working. APISIX repository documentation lists Lua for custom plugins, plus Java, Go and Python through plugin runners, and WebAssembly. Lua plugins run inside the gateway process and require engineers comfortable with the APISIX plugin API and NGINX internals. Runner-based plugins let teams work in a language they already support, but they add a separate process to deploy and monitor. Confirm with your engineers which option matches existing skills, and confirm the runner and WebAssembly support status for the APISIX version you plan to run.

What drives the cost and time of a custom APISIX plugin?

The main drivers are the number of behaviors the plugin must handle, how many routes and upstreams it touches, the chosen language or runner, and how many identity or backend systems it calls. Testing scope and packaging also matter, because a plugin used in production needs automated tests, a repeatable build and a deployment path across environments. Cost components are design, implementation, testing, documentation and handover, and each recurs whenever the plugin changes. The effort-driver table in this section sets out each component. Ask any provider for a fixed-scope quote that lists these items separately, because no figure applies without a written scope.

Can our own engineers build an APISIX plugin using the documentation?

Engineers with solid software experience can build a simple plugin from the official documentation and the apache/apisix repository, and a first plugin is a reasonable learning exercise in a non-production environment. The harder part is production readiness: handling failure modes, avoiding performance regressions in the request path, writing tests that exercise the gateway, and keeping the code aligned with new releases. Confirm that at least one or two engineers can own the plugin long term. If the team lacks capacity or has no prior gateway experience, a fixed-scope engagement can supply design and build work with handover.

What does the client need to provide for a custom plugin project?

Start with a written list of the behaviors the plugin must perform, examples of the requests and responses involved, and the routes or services it will protect. You will also need access to a non-production APISIX environment that matches your deployment mode, whether traditional, decoupled or standalone, along with the identity, logging or backend systems the plugin calls, including test credentials. Name an internal owner who can make decisions on behavior and approve changes. Clear acceptance criteria shorten the project because they define when the plugin is finished.

How is a custom plugin kept working after APISIX upgrades?

Plan for upgrades from the start by pinning the APISIX version the plugin was tested against and running the plugin's automated tests against each new release in staging before production. Keep plugin code isolated from the gateway's internal APIs where possible, and record every dependency on a specific plugin API. Also check the release notes for each APISIX version, since the downloads page does not mark releases as long-term support, so you need a schedule for reviewing them. Ask any partner how upgrade testing and handover documentation are included, and whether that work is covered by a retainer or a separate agreement.

How DeployOpen scopes, builds and hands over custom APISIX plugins

DeployOpen approaches custom APISIX plugin work as a fixed-scope engagement inside your own infrastructure. We agree the plugin's behavior, runtime and test evidence in writing before development starts, then build, document and hand over the plugin so your team can review and run it.

How we scope

  • Written scope names each plugin, its request and response behavior, and the runtime chosen: Lua, a plugin runner, or WebAssembly.
  • Scope lists the APISIX version line the plugin targets, so compatibility with later releases can be planned from the start.
  • Scope states which environments, etcd or standalone deployment modes, and identity or upstream systems the plugin must work with.

How we build

  • Plugins are built against the agreed APISIX configuration and tested in a non-production gateway that mirrors your deployment mode.
  • Tests cover the plugin's schema validation, normal and failing requests, and its behavior under the traffic controls already in place.
  • Access to the Admin API and secrets is limited during build, and any credentials used in testing are rotated before handover.

How we hand over

  • You receive the plugin source, test suite, packaging steps and a deployment guide that your own engineers can follow.
  • Documentation records the plugin's configuration keys, dependencies, known limits and the upgrade checks to run before each APISIX release.
  • A walkthrough with your platform and security engineers covers how the plugin is reviewed, loaded and rolled back if needed.

How we support

  • Ongoing support, upgrade testing and continuous testing for custom plugins are available as a retainer, scoped separately from the build.
  • Retainer scope should confirm which APISIX releases are covered and how plugin changes are retested after each upgrade.
  • Ask for a written statement of response expectations and what counts as a supported change before signing a retainer.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.