By NHI Mgmt Group Editorial TeamBased on Riptides: “From Kernel WASM to User-Space Policy Evaluation: Lessons Learned at Riptides” (October 6, 2025)

TL;DR: Latency gains from moving OPA policy evaluation from kernel-space WASM to a user-space agent can be outweighed by memory fragility, debugging opacity, and maintenance drift, according to Riptides’ October 2025 engineering write-up. The deeper lesson is that workload identity enforcement works best when policy logic stays simpler than the kernel it protects.


At a glance

What this is: This is an engineering analysis of why Riptides moved workload identity policy evaluation out of the Linux kernel and into user space after kernel-space WASM introduced fragility, debugging opacity, and maintenance drift.

Why it matters: It matters because workload identity enforcement choices shape operational reliability, auditability, and control boundaries for NHI programmes that sit inside infrastructure paths.


Context

Kernel policy evaluation for workload identity is the problem space here, not a product feature debate. The question is where policy logic should run when it governs socket connections, SPIFFE-backed workload identity, and real-time access decisions inside a Linux environment.

Riptides’ experience shows that moving policy evaluation closer to the kernel is not automatically the best control design. When the policy engine becomes hard to debug, hard to maintain, or fragile under memory pressure, the governance model starts to work against the operational system it was meant to secure.

The practical identity-security question is how much logic should sit inside the enforcement path for NHI decisions. In this case, the answer depends less on theoretical latency and more on whether the control remains observable, recoverable, and safe to change in production.


Key questions

Q: What breaks when workload identity policy evaluation is pushed into the kernel?

A: Kernel policy evaluation can fail in ways that are much harder to isolate than user-space failures. Memory pressure, runtime incompatibility, and opaque debugging can turn the enforcement mechanism itself into a stability risk. The practical problem is not only latency. It is that the control becomes harder to operate, harder to test, and more dangerous to change safely.

Q: Why does moving policy evaluation to user space change operational risk for NHI controls?

A: User-space policy evaluation reduces the blast radius of policy bugs because the kernel no longer has to execute complex policy logic directly. That improves debuggability, release management, and failure containment. The trade-off is extra communication overhead, but caching and fail-closed behaviour can keep that overhead acceptable for many workload identity use cases.

Q: What signs indicate that kernel-adjacent policy logic is becoming unmanageable?

A: Warning signs include memory fragmentation, kernel panics, difficult root-cause analysis, forked runtime maintenance, and policy changes that require coordinated kernel work. When policy authors need specialised kernel knowledge just to ship a rule, the architecture is already too brittle. At that point, the control is consuming more operational effort than it saves.

Q: How should teams decide whether policy evaluation belongs in kernel space or user space?

A: Teams should place policy evaluation where failure is easiest to contain and operate. Kernel space only makes sense when the policy logic is simple, deterministic, and safe under severe runtime constraints. If the control needs rich debugging, memory flexibility, or frequent change, user space is the safer governance choice.


Technical breakdown

Why kernel-space WASM became unstable for workload identity policy

Riptides’ kernel-space design used OPA policies compiled to WASM and executed through a ported wasm3 runtime inside Linux. That created a tight coupling between policy evaluation, kernel memory behaviour, and runtime compatibility. The article highlights several failure modes: floating-point restrictions in kernel context, linear memory growth, stack pressure, and custom memory allocation replacing standard library functions. For workload identity, the architectural issue is that policy execution moved from a contained decision point into the most failure-sensitive layer of the system.

Practical implication: Keep policy evaluation outside the kernel when the policy engine itself introduces memory and runtime instability into the enforcement path.

Why user-space policy evaluation changes the control model

The move to a Go-based user-space agent did not eliminate kernel enforcement. It changed the decision boundary. The kernel now handles socket-level enforcement, caching, and denial on communication failure, while user space evaluates OPA policies and returns the decision through protobuf messages. That separation reduces the blast radius of policy bugs and makes the policy engine observable with standard tooling. For workload identity, the important shift is that policy logic becomes a governed service rather than embedded execution inside the kernel.

Practical implication: Treat user-space policy evaluation as a distinct governed component with logging, testing, and failure handling instead of embedding business logic in kernel code.

Why caching matters more than raw latency in workload identity enforcement

The article’s performance story is not just kernel versus user space. It is first-request evaluation versus cached decision reuse. The kernel module caches policy outcomes, so only uncached flows pay the user-space round trip. That design narrows the real-world latency penalty while preserving safer execution characteristics. In NHI terms, this is a reminder that control-path optimisation should include state reuse, cache expiry, and fallback behaviour, not just microsecond benchmarks.

Practical implication: Design workload identity controls so that caching, expiry, and default-deny behaviour are part of the enforcement model from the start.


Threat narrative

Attacker objective: The objective would be to weaken or destabilise enforcement around workload connections so that security decisions become less reliable or less observable.

  1. Entry occurs through workload connections that must be evaluated before a socket is allowed to proceed, so the policy engine sits directly on the enforcement path.
  2. Credential or policy access is exercised by the runtime when OPA decisions are compiled and executed through the kernel-adjacent WASM stack.
  3. Escalation happens when memory pressure, runtime incompatibility, or debugging blind spots turn policy evaluation itself into a system stability risk.
  4. Impact is a weaker and less maintainable enforcement plane, where policy failures can degrade availability and complicate trust decisions for workload traffic.
  • TrapDoor supply chain campaign 2026: TrapDoor's 34+ malicious npm, PyPI and Crates.io packages stole developer credentials and hid instructions for AI coding assistants. No victims known.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Policy evaluation inside the kernel creates control fragility, not just lower latency. Riptides’ experience shows that placing OPA and WASM execution in kernel space pulls policy logic into the failure domain of the operating system itself. That changes the governance problem from access enforcement to runtime survivability. For NHI programmes, the lesson is that the enforcement path must remain simpler than the policy it evaluates.

Workload identity policy should be treated as a governed service, not embedded kernel logic. Once policy evaluation moved to a user-space agent, debugging, observability, and release management became ordinary engineering problems again. That is the more durable model for workload identity because it separates enforcement from policy computation without surrendering control. Practitioners should read this as a structural argument for clearer operational boundaries.

Kernel-level identity enforcement has a smaller blast radius only when the kernel stays narrow. The article shows that the security value of kernel proximity is lost when the runtime, memory model, and policy language all expand the kernel attack and failure surface. The field should be careful not to confuse closer placement with better governance. The better control is the one that remains inspectable, recoverable, and easy to change.

Ephemeral decision caching is the practical bridge between security and performance. The article’s user-space design keeps first-request policy evaluation flexible while letting subsequent requests use cached decisions. That pattern matters for workload identity because it preserves enforcement quality without forcing every decision through a heavyweight runtime. Teams should think in terms of decision reuse, not only decision speed.

Runtime simplicity beats architectural ambition when the subject is identity enforcement. The most useful concept in the article is not kernel policy evaluation itself but the failure of over-complex enforcement architecture. That is a reusable identity-governance lesson: if the policy engine becomes harder to operate than the system it protects, the security model is already too brittle. Practitioners should prefer controllable enforcement over impressive placement.

What this signals

Kernel proximity is not a substitute for governable complexity: workload identity controls still need to be inspectable, debuggable, and safe to change. Once policy logic crosses into runtime code paths that can destabilise the host, the architecture has stopped serving the programme and started constraining it.

The lesson for IAM and NHI teams is to design the control plane so that enforcement remains narrow while evaluation can evolve independently. That separation is especially important where socket decisions, SPIFFE-backed identity, and policy changes intersect in production environments.


For practitioners

  • Prioritise enforcement-path simplicity Map every step in the workload identity decision path and remove runtime dependencies that increase kernel fragility, especially custom interpreters and memory-heavy policy execution.
  • Separate policy computation from kernel enforcement Keep the kernel focused on socket control, caching, and fail-closed behaviour while moving complex OPA evaluation into a user-space service with standard observability.
  • Test policy engines under memory pressure Run failure testing for policy evaluation under low-memory conditions, runtime incompatibility, and cache misses so you can see how the control behaves before production.
  • Instrument policy decisions for auditability Log policy inputs, decisions, and fallback outcomes in a form that security and compliance teams can review without kernel-specific debugging tools.

Key takeaways

  • Moving workload identity policy evaluation into the kernel can increase fragility even when it improves theoretical latency.
  • Riptides found that user-space evaluation preserved acceptable performance while improving maintainability, observability, and failure containment.
  • The control lesson is to keep enforcement narrow and let policy logic live in a place where teams can test, debug, and govern it safely.

Key terms

  • Workload Identity Management: Workload Identity Management is the practice of creating, issuing, securing, rotating, and revoking identities used by software workloads. It covers how services, containers, functions, and agents prove who they are to other systems, usually through certificates, tokens, keys, or federated assertions, so access can be controlled and audited.
  • Kernel-Space Enforcement: A control pattern where traffic inspection, modification, or policy enforcement happens inside the operating system kernel rather than in a user-space process. It is used when identity or security logic must operate very close to network activity, often to support transparent interception, high performance, or environments with tight runtime constraints.
  • User Space Agent: A user space agent is security software that operates outside the kernel while still monitoring and protecting workloads. This approach can reduce compatibility risk and deployment friction, because the control plane does not depend on kernel modules or deep kernel changes to deliver detection and response.
  • Decision Caching: The practice of reusing a prior policy decision for a short period so subsequent requests do not need to re-run the full evaluation path. For workload identity, caching can preserve performance while keeping the live policy engine simpler and easier to operate.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 11, 2026.
Updated on October 10, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org