Apache Airflow · Monthly Virtual Town Hall · July 10, 2026
Fan out work in milliseconds. Run code you don’t trust in a fresh computer.
One fresh microVM per task try. Destroyed when the task ends.
apache/airflow #68847 · issue #68845 · dev@airflow discussion
Yossi Eliaz — Incredibuild · more writing ·
01 · Why now
“Airflow lacks native sandboxing mechanisms… DAG authors can execute arbitrary code on workers.” — Airflow security model docs. Mitigation: code review.
That model assumed a human wrote and reviewed every task. With common.ai (Airflow’s provider for AI-agent tasks), agents now write task code at runtime — and Airflow runs it on the worker, with the worker’s credentials, reviewed by no one.
Agents also read the outside world, and an LLM can’t tell instructions from data — anything it reads can steer the code it writes. The fix: a sandbox — a microVM, a tiny full computer that boots in milliseconds, created per task try and deleted when it ends.
02 · Where Airflow stands, mid-2026
AIP = Airflow Improvement Proposal — how the community designs and votes on big changes.
| Mechanism | Actual boundary | Isolation |
|---|---|---|
| Task SDK / AIP-72 | Workers hold zero DB credentials; per-task JWT via Execution API. But task code = ordinary OS process. | credential-only |
| Local / Celery | Shared long-lived worker: one filesystem, network identity, pip env for every task. | none |
| Multi-team / AIP-67 | “Logical isolation… not complete isolation” — docs’ words, not mine. | logical |
| KubernetesExecutor | Pod per task — a real boundary, paid for in image-pull + schedule + bootstrap. | pod · slow |
| ECS / Fargate executor | Container per task, Fargate by default. ~50–60s startup latency per task (amazon-provider docs). | container · slow |
Sources: Airflow security-model, multi-team & executor docs; amazon-provider ECS executor docs
03 · The trap
Celery-style workers start tasks instantly — into a process sharing everything on the node: one filesystem, one network identity, one pip env (your torch pin fights their pandas pin).
Pod-per-task and Fargate give a real wall — and charge seconds-to-minutes of cold start on every try. Billed twice: warm fleets idle between bursts; cold starts tax retries.
No Airflow executor targets ephemeral cloud sandboxes.
That’s the gap issue #68845 names.
04 · The primitive
Start a hot snapshot, fork it across mapped tasks, collect artifacts or XComs, then delete every machine.
Agent-written code, tenant code, partner scripts, and eval contestants run off the worker with scoped egress.
Airflow already has the shape: map out, fan in, retry, teardown. The missing part is the per-try computer.
The whole shift in one line: “the efficiency of multitenancy with the security of single tenancy.” — Modal
05 · What the agent platforms figured out
≈ 3–4 orders of magnitude faster — at a stronger isolation boundary.
Firecracker: AWS / NSDI ’20 (~125 ms boot, <5 MiB overhead, 150 VMs/s/host) · E2B docs · Firecracker snapshot docs · Airflow amazon-provider docs
06 · The mechanism
pip install, imports, cache warmup — every task try forks from it, already hot.import torch — ~5 s cold → ~1.05 s from a memory snapshot.modal.com/blog/mem-snapshots · cognition.ai blockdiff · morph.so/blog/infinibranch · aws.amazon.com/lambda/lambda-microvms
07 · The proposal — PR #68847
Queues task tries exactly as today. No core changes — rides AIP-51’s public executor interface.
Creates a sandbox per try, uploads the workload, then only reconciles exit state via a polling watcher.
The task heartbeats its state to Airflow (EdgeExecutor-style) and ships logs to remote storage — no extra plumbing on the worker.
Task ends, sandbox dies. Nothing to clean, nothing to leak into the next try.
Plus SandboxOperator and @task.sandbox for per-task opt-in — mix executors per deployment (AIP-61) and route only untrusted or heavy tasks to sandboxes.
github.com/apache/airflow/pull/68847 · at talk time (Jul 2026): +3,216 lines · 54 files · docs, tests, example DAG
08 · Pluggable backends
SandboxProvider # abstract base — backends/base.py authenticate() → create_sandbox(spec) → upload_workload() → run() → poll_status() → fetch_logs() → destroy() SandboxSpec(image, cpu, memory_mb, disk_gb, timeout, env, …) SandboxState: PENDING · RUNNING · SUCCEEDED · FAILED · GONE · UNKNOWN # UNKNOWN ≠ GONE — transient API blips never kill a healthy task
Same shape across the ecosystem — instant sandboxes and agent computers are converging
Config: [sandbox] provider = local|daytona|e2b|modal|islo — or any module:Class path · exe.dev/Tensorlake/AWS/crabbox are market signals, not current PR backends
09 · What it looks like
from airflow.sdk import dag, task @dag def nightly_train(): @task.sandbox( image="python:3.12-slim", cpu=2, memory_mb=2048, ) def train(): # returns the command the sandbox runs return "python train.py --epochs 3" train()
# airflow.cfg — all-in; or opt in # per task via AIP-61 multi-executor [core] executor = SandboxExecutor [sandbox] provider = e2b poll_interval = 5 creation_batch_size = 8
The callable returns the shell command that runs inside the sandbox; logs ship out before it dies, so every try leaves a complete record.
Status (Jul 2026): open PR. Update: merged 2026-08-13 as SandboxToolset in common.ai · standalone executor: github.com/zozo123/airflow-provider-sandbox
10 · What the community said — and the pivot
“My first main concern… is how would this integrate with Common AI Provider and why should it be separate provider instead of part of common.ai.”
“It likely requires an AIP… your current PR and implementation will be treated as one potential solution — and mostly a starting point.”
“+1 to Kaxil’s comments… we discussed this offline earlier in the context of agentic workflows… interaction with the common.ai provider would be the logical first step.”
So: the work pivots into common.ai as a SandboxToolset (proposed) — a first-class toolset like SQLToolset / MCPToolset. Agent-written code runs off the worker — so it no longer executes with the worker’s credentials.
11 · Honest limits — and what you can do today
runtimeClassName in a KubernetesExecutor pod_overrideThis is proposal-stage engineering — the caveats are part of the design discussion, not footnotes.
12 · Where this goes — with your help
Make Airflow safe for code nobody wrote. · THANK YOU — QUESTIONS IN #TOWNHALL-SPEAKERS