Databricks Safespark External Udf Runner gRPC

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up the databricks safespark external udf runner grpc service to run custom user code in isolated containers. This network channel sends row data from the compute node to a separate process and returns the result. Data teams use this path to keep untrusted code off shared cluster hosts. Still, broad role grants still let approved users run risky queries across entire tables. How databricks safespark external udf runner grpc works Shared compute clusters need strong boundaries between u

External Secrets Operator (K8s) + gRPC Security: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up the databricks safespark external udf runner grpc service to run custom user code in isolated containers. This network channel sends row data from the compute node to a separate process and returns the result. Data teams use this path to keep untrusted code off shared cluster hosts. Still, broad role grants still let approved users run risky queries across entire tables.

How databricks safespark external udf runner grpc works

Shared compute clusters need strong boundaries between users who run custom functions on the same host. The safe runner model moves custom function execution out of the main database engine process. Instead, the compute node starts a separate sandbox container for the user task. The main engine talks to this sandbox over a local high-speed remote procedure call channel.

When a query calls a custom function, the engine batches rows of data. It sends those batches across the local network channel to the external runner process. The runner executes the custom logic inside its restricted box and sends the output back. This design stops bad code from reading memory that belongs to another user on the cluster.

Platform admins pair this container boundary with catalog role grants. You assign permissions on catalogs, schemas, and functions to specific user groups. A user must hold the right role to register or call an external function. The cluster checks those permissions before it starts the external runner process for a query.

What native isolation solves and what it leaves open

This native setup solves process crashes and host memory leaks on shared compute nodes. A broken script or a hostile memory read stays trapped inside its temporary container. Other jobs on the same cluster keep running without a hitch. Catalog roles also stop unauthorized users from calling functions they do not own.

Yet container isolation and catalog roles only check who logs in and where code runs. They do not inspect what individual SQL statements or function calls do in flight. Once an engineer or an automated app holds a valid role, every query runs right away. A valid user can still pass sensitive columns into a custom function by mistake.

External Secrets Operator (K8s) + gRPC Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static permissions also leave raw sensitive values exposed in query outputs. If a table holds emails, phone numbers, card numbers, or national IDs, valid roles return them as plain text. Masking rewrites matched fields in results so raw sensitive strings do not leave the database. Teams also need query-level approvals when an engineer runs a wide update or export.

Managing query risks on shared analytics clusters

To close this gap, engineering teams separate host isolation from statement-level controls. Let the compute engine handle sandbox containers and local remote procedure calls for custom code. At the same time, apply checks to the database session before statements reach the cluster.

Good session controls inspect each command and log the exact user identity behind every run. They can pause a dangerous query until a peer reviews and approves the request. They also apply field masking on the fly to rewrite emails and card numbers in results. This pair of controls keeps both the cluster host and the underlying table data safe.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Why does the cluster use a separate runner for custom functions?

Shared clusters run workloads from many users at the same time. Moving custom code into a separate runner stops one user from reading another user's memory.

Why use a remote procedure call channel for external functions?

The engine must move large batches of rows between processes very fast. This binary network protocol sends structured data with low delay between the engine and the sandbox.

Do container sandboxes stop users from querying sensitive tables?

No, the sandbox only restricts what the custom code can touch on the host machine. If the user role allows table reads, the query still returns sensitive rows unless masking rewrites matched fields in results.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.