Extensibility

Istio provides two mechanisms for extending the Istio proxy: WebAssembly (Wasm) and Lua. Both are configured using the TrafficExtension API, which provides a unified way to attach extensions to workloads with consistent targeting and phase/priority ordering.

Choosing a filter type

WebAssemblyLua
LanguagesC++, Rust, Go, AssemblyScript, and moreLua only
DistributionPulled from OCI registries, HTTP URLs, or local filesInlined directly in the resource
MemoryHigher — each plugin runs in its own sandbox~10x lower than WebAssembly
IsolationFull VM sandbox — a crash is contained to the pluginRuns in-process; a crash can kill the worker thread
Failure policyConfigurable — fail-closed by defaultFail-open only — no configuration option
SDLCFull ecosystem: unit tests, CI, versioned releasesLimited — script lives in the resource itself
Best forComplex logic, reusable plugins, production extensionsSimple one-off transforms, temporary workarounds

In general, prefer WebAssembly for production extensions that need testing, versioning, and reuse. Prefer Lua for lightweight, localized changes where the simplicity of inline code outweighs the lack of tooling.

WebAssembly Plugins

WebAssembly is a sandboxing technology for more complex extensions. The Proxy-Wasm sandbox API replaces Mixer as the primary extension mechanism in Istio.

WebAssembly sandbox goals:

  • Efficiency - An extension adds low latency, CPU, and memory overhead.
  • Function - An extension can enforce policy, collect telemetry, and perform payload mutations.
  • Isolation - A programming error or crash in one plugin doesn’t affect other plugins.
  • Configuration - The plugins are configured using an API that is consistent with other Istio APIs. An extension can be configured dynamically.
  • Operator - An extension can be canaried and deployed as log-only, fail-open or fail-close.
  • Extension developer - The plugin can be written in several programming languages.

This video talk is an introduction about architecture of WebAssembly integration.

High-level architecture

Istio extensions (Proxy-Wasm plugins) have several components:

  • Filter Service Provider Interface (SPI) for building Proxy-Wasm plugins for filters.
  • Sandbox V8 Wasm Runtime embedded in Envoy.
  • Host APIs for headers, trailers and metadata.
  • Call out APIs for gRPC and HTTP calls.
  • Stats and Logging APIs for metrics and monitoring.
Extending Istio/Envoy
Extending Istio/Envoy

Example

An example C++ Proxy-Wasm plugin for a filter can be found here. You can follow this guide to implement a Wasm extension with C++.

Ecosystem

Lua Scripts

Lua filters provide a lightweight, inline scripting approach for simple request and response transformations. Lua code is inlined directly in the TrafficExtension resource and executed within the Envoy proxy, no module distribution is required. Lua filters are best suited for straightforward header manipulation, logging, or conditional logic. For more complex processing, WebAssembly filters are recommended.

The memory footprint of Lua is significantly smaller than WebAssembly. Benchmarks show Lua consuming roughly 20–26 MiB regardless of concurrency, while WebAssembly ranges from ~110 MiB at low concurrency to ~290 MiB at high concurrency:

ConcurrencyLua (MiB)Wasm (MiB)
119.79117.7
223.07132.5
422.63152.0
823.97190.9
1625.66291.8
Was this information useful?
Do you have any suggestions for improvement?

Thanks for your feedback!