Why Airflow 3 workers should never hold database credentials
Airflow 3 routes worker access through the Task Execution API, so workers do not need database credentials to run tasks. If your team must show auditors who can reach the metadata database and the secrets it holds, the answer for workers is that they reach neither directly. Per the Airflow security model, workers do not receive database credentials and cannot access the metadata database directly. Task code reads what it needs and reports state through the API, which means the database password and the signing keys stay with the control plane components that need them.
The security model is precise about what is enforced and what is not. The DAG File Processor and the Triggerer rely on software guards that keep ordinary DAG code away from the database, but those guards do not stop a DAG author who writes code on purpose to bypass them. Treat the DAG File Processor and Triggerer as components a malicious DAG author could reach, and do not count them as isolation boundaries. Confirm this boundary against the version you run, and check whether your team can review every DAG change before it is deployed.
This design matters most when DAG authors span several teams, when the metadata database holds connections or variables for regulated systems, or when you must answer audit questions about database access. It matters less when a single trusted team writes all DAGs and the environment has no regulatory scope, although the same network and key controls still apply. Before you commit to a layout, confirm with your own environment which components can reach the database, which hosts run workers, and where the JWT signing key is stored.
Which worker and token configuration fits your environment
Asymmetric signing is the configuration the Airflow security model recommends for keeping signing material away from workers. The Scheduler holds the private key and signs tokens, while the API Server validates them against a public JWKS, so a component that only verifies tokens never holds the ability to mint new ones. The trade-off is operational: you must generate, store and rotate a key pair, publish the public keys in a form the API Server can load, and test that rotation does not interrupt running tasks.
- Signing authority: only the Scheduler holds the private key, which narrows the set of processes that could issue execution tokens.
- Verification path: the API Server validates with the public JWKS, so public material can be distributed more widely than the signing key.
- Key storage: the private key should live in a store that workers and DAG authors cannot read, such as a secret the Scheduler mounts alone.
- Rotation effort: plan a rotation procedure that publishes the new public key before the Scheduler starts signing with it.
- Recurring work: key rotation and access reviews recur, while the initial key setup is one-time.
Check that your deployment reads the signing configuration from the Airflow security model and that no worker image or pod template contains the private key.
A shared symmetric secret is simpler to set up because one value signs and verifies tokens. Any process that can verify tokens can also forge them, so the secret must be treated as equivalent to the signing authority itself. This matters most when workers are involved, since a worker that holds the same secret as the API Server can create tokens for other tasks. Teams with a small, single-environment deployment may accept this, but they should document that every holder of the secret sits in the same trust boundary.
- Setup simplicity: one value to create, store and distribute, which reduces the initial configuration steps.
- Blast radius: compromise of any component that reads the secret allows token forgery across the deployment.
- Worker exposure: the secret must not reach standard workers if they are meant to stay outside the control plane.
- Rotation coupling: changing the secret affects every component that validates tokens at the same time.
- Audit story: reviewers will ask who can read the secret, so the answer should come from your Kubernetes RBAC or host access records.
Confirm with your security team whether a symmetric secret is acceptable under your internal key management policy before you adopt it.
Standard workers are the configuration the security model assumes: they receive no database credentials, cannot reach the metadata database directly, and talk to the platform only through the Task Execution API. Network policies enforce that narrow path, letting worker pods reach the Execution API and little else. Secrets needed by a task should arrive through an approved secrets backend or a scoped mount rather than broad credentials. The trade-off is that you must write and test the policies, and any task that needs a new destination requires a reviewed change.
- Reachability: allow traffic from workers to the Execution API endpoint and block the metadata database and signing components.
- Credential scope: give each task only the connections and variables it needs, which limits what a malicious DAG author can read.
- Kubernetes fit: pod-level policies and Pod Security Standards are the natural enforcement points on a cluster.
- Testing effort: verify that denied paths fail as expected, not only that the allowed path works.
- Ongoing cost: every new data source adds a policy change and a review.
Before go-live, test a deliberately blocked connection from a worker pod and confirm the failure is logged.
Secrets reach a task process either as environment variables or as files mounted into the container. Environment variables are easy to configure and are visible to anything that inspects the process environment, including some tooling and crash reports. Mounted files, often from a Kubernetes Secret or an external store, can be permissioned to the process user and rotated without rebuilding images, but they still sit in plain form inside the pod. Neither option removes the need for least-privilege access to the source store, which is where the Kubernetes secrets guidance applies.
- Exposure surface: environment variables appear in process inspection and may leak into logs, so keep them limited to non-sensitive settings where possible.
- File permissions: mounted files can be restricted by ownership and mode, which is easier to audit.
- Rotation: file-based secrets can be updated without rebuilding the image, though the application must reread them.
- Source hardening: Kubernetes Secrets are stored unencrypted in etcd by default, so encryption at rest and tight RBAC on list and watch are prerequisites.
- External stores: the Secrets Store CSI Driver can project values from an external store into mounted files.
Ask your platform team whether etcd encryption at rest is enabled before you decide which delivery method to use for production secrets.
Edge workers are the exception to the isolation model. They must hold the [api_auth] jwt_secret, which means the security model places their hosts inside the control-plane trust boundary rather than treating them as untrusted task runners. This is acceptable only when you control those hosts closely and accept that a compromised edge host can act as a control-plane participant. It is a valid choice for distributed or remote execution, but it should be a documented, reviewed decision rather than a default.
- Trust placement: edge hosts are part of the control plane for the purpose of threat modeling and access review.
- Secret distribution: the
jwt_secretmust reach each edge host, which enlarges the set of places that hold it. - Host hardening: patching, access control and monitoring should match those of control-plane nodes.
- Network design: restrict which networks edge hosts can reach, even though they hold the secret.
- Review trigger: any change to edge host ownership or location should reopen the trust decision.
Confirm the edge executor's current configuration requirements in the Airflow executor documentation before you plan the host build.
How to configure worker isolation step by step
This sequence moves an Airflow 3.3.2 deployment to a state where workers reach only the Task Execution API and never hold metadata database credentials or signing keys. Each step ends with a check you can run before moving on.
Confirm version and metadata database
Confirm the Airflow version is 3.3.2 or a later 3.x patch, and that the metadata database is PostgreSQL in the 14 to 18 range or MySQL 8.0, 8.4 or an Innovation release. Do not use MariaDB or SQLite for this metadata database, since the prerequisites do not support MariaDB and the production guide warns against SQLite. Your team confirms the image tag and database version in the environment that will run Airflow. The step is done when the running versions match the prerequisites and the team has written them down in the deployment record.
Separate the API Server, Scheduler and DAG processor
Run the API Server (started with airflow api-server), the Scheduler and the DAG File Processor as separate components with separate configuration, instead of colocating them in one process. This separation is what lets the signing key and database settings stay on the control-plane components while workers run on their own hosts or pods. Check that each component starts independently and that the worker deployment definition does not import the Scheduler or DAG processor configuration.
Generate and install the asymmetric key pair
Generate an asymmetric key pair for JWT signing and place the private key only in the Scheduler's secret store or file system, where the Scheduler can sign execution tokens. Confirm the exact key format and the configuration keys for your Airflow version in the security model documentation, since this page does not repeat them. The check is that the private key exists on the Scheduler and on no worker, and that its file permissions restrict reading to the Scheduler's service account.
Publish the JWKS to the API Server
Export the public key in JWKS form and make it available to the API Server, which validates tokens against it without being able to sign them. Store the JWKS as a configuration input or mounted file on the API Server only. Confirm with your team which mechanism (mounted file, configuration value or internal endpoint) fits your environment. The check is that the API Server accepts a token signed by the Scheduler and rejects a token signed with a different key.
Remove database settings from worker configuration
Remove the metadata database connection string, the SQL connection options and any signing key material from the worker configuration, environment and secret mounts. Workers should authenticate only with the short-lived execution token they receive. Review the worker's environment variables and mounted volumes, because a database password left in a variable undoes the isolation. The check is a search of the worker's rendered environment and mounts that finds no database host, database user or private key.
Apply network policies that allow only the Execution API
Create network policies, or host firewall rules outside Kubernetes, that let worker traffic reach only the Execution API endpoint on the API Server and block direct connections to the metadata database port and the Scheduler. In Kubernetes, pair these with Pod Security Standards for the worker namespace. Your network team should confirm the allowed endpoint and that DNS and any log shipping still work. The check is that connections from a worker pod to the database port time out while connections to the Execution API succeed.
Verify with a test DAG
Deploy a test DAG to a non-production instance that runs one task on a worker and attempts to open a connection to the metadata database host and port, then logs the result. The task should fail to connect and the run should still complete its work through the Execution API. Run the same DAG with a deliberately wrong token or expired token to confirm rejection. Keep the test DAG and its output as evidence for your change record. This does not prove a malicious DAG author is contained, because the security model says the software guards do not stop a deliberately malicious author.
Security and operational risks to control after go-live
Moving workers onto the Task Execution API removes database credentials from task code, but it leaves a short list of risks that the design does not remove. The cards below cover token behavior, trust boundaries, DAG author access, signing keys, secret exposure and detection, so each one has an owner and a check before go-live.
Non-revocable execution tokens
Execution tokens default to a 10-minute lifetime and refresh automatically while a task runs, and they cannot be revoked. A token stolen from a worker stays usable until it expires, so revoking a worker does not cut off its access immediately. Confirm the token lifetime in your configuration, limit who can reach worker hosts and their logs, and document the expiry window in your incident runbook.
Edge workers inside the trust boundary
Edge workers must hold the [api_auth] jwt_secret, which places their hosts inside the control-plane trust boundary. A remote edge site is therefore not a low-trust location. Decide whether edge hosts can be managed to the same standard as the scheduler and API Server before you adopt the EdgeExecutor, and keep those hosts on a network segment with tight egress rules.
Malicious DAG authors still run code
The DAG File Processor and Triggerer have only software guards, which do not stop a deliberately malicious DAG author. Anyone who can merge DAG code can still run code on workers, so the Task Execution API limits credential exposure but does not sandbox task code. Pair it with mandatory review, protected branches and restricted deployment rights for the DAG repository.
Signing key custody and rotation
The Scheduler holds the private key used to sign tokens, and the API Server validates them against a public JWKS. Whoever reads the private key can mint valid tokens, so restrict its file or secret to the Scheduler's identity only. Ask your team to document who can rotate the key, how the JWKS is republished during rotation, and how old tokens are handled, and test that rotation in staging first.
Environment variables versus files
Secrets passed as environment variables are visible to anyone who can inspect the process, container spec or pod definition. Kubernetes stores Secrets unencrypted in etcd by default, so administrators should enable encryption at rest and restrict list and watch access with least-privilege RBAC, or use an external store through the Secrets Store CSI Driver. Mount secrets as files where the component supports it, and confirm that no worker has read access to the Scheduler's key material.
Monitoring API Server authentication failures
Repeated rejected tokens, expired execution tokens and unexpected callers against the Execution API can signal misconfiguration or misuse. Ship API Server authentication logs to your monitoring or SIEM platform, alert on spikes in failures, and set a baseline during staging so that normal refresh errors are not mistaken for attacks. Confirm which fields your logs expose before writing alert rules.
Questions teams ask before isolating Airflow workers
What does it cost to isolate Airflow workers, and what is one-time versus recurring?
Isolation has two cost layers: the design and build work, which is one-time, and the operating work, which recurs. The one-time part covers mapping which components need which credentials, moving the scheduler and API server onto asymmetric JWT keys, splitting the database and signing keys away from worker pods, writing network policies that allow workers to reach only the Execution API, and testing that a failed worker cannot reach the metadata database. The recurring part covers key rotation, policy review after upgrades, and checking that new DAGs and providers still work under the restricted model. Quotes are driven by how many environments you run, how many worker types you use (Celery, Kubernetes, edge), and whether your Kubernetes and identity platforms already have the controls in place. Ask any partner for the cost split between design, build, verification and retained support, and for a written list of what each line covers.
How long does worker isolation take, and what makes it take longer?
Duration depends mainly on the number of executors and environments in scope, the state of your current network and secret handling, and how many teams write DAGs that rely on direct database access. Airflow 3 already removed direct database sessions from task code, so DAGs that still use them need rework before the restricted model holds. Edge workers add time because they must hold the [api_auth] jwt_secret, which places their hosts inside the control-plane trust boundary, and that boundary needs its own review. Clusters without network policy support or without a working secrets store add prerequisite work. Ask for a timeline tied to a written scope, with the environments, executors and DAG remediation counted separately so you can see what drives the schedule.
What do platform, security and Airflow teams need to provide?
The work needs three groups to decide and provide different inputs. The platform team owns the Kubernetes or VM layer, network policy enforcement, the etcd and Secrets handling, and the deployment pipeline that injects keys. The security team owns the trust model decisions, the signing key lifecycle, the review of which components hold which secrets, and the acceptance criteria for verification. The Airflow owners know which DAGs, providers and connections exist, which workers run which tasks, and which DAG authors need to keep working. Each group should name a reviewer before work starts, and each should confirm access to staging clusters, a current inventory of connections and variables, and a change window for the first cutover.
Can an internal team isolate Airflow workers without outside help?
Yes, an internal team with Kubernetes, Airflow and security skills can do this work, and many do. The questions that decide it are whether the team has run Airflow 3 in production, whether it has tested network policies against worker traffic, and whether someone owns signing key handling end to end. Teams that lack one of these usually face the longest delays in verification, not in configuration. A fixed-scope engagement can cover design, build and verification with knowledge transfer, while a retainer covers continued checks after upgrades. Either way, agree in writing who runs the negative tests that prove a worker cannot read the metadata database.
How does rotating the signing keys affect tasks that are already running?
Execution tokens are short-lived, with a default lifetime of 10 minutes and automatic refresh, so a rotation affects new token issuance first and running tasks only when refresh fails. Tokens cannot be revoked, so the practical control is the lifetime and the order of rollout: publish the new public key in the JWKS served to the API Server, switch the Scheduler to sign with the new private key, and retire the old key after the longest token has expired. Plan rotations outside peak scheduling windows, and test them in staging with long-running tasks. Confirm with your Airflow version how the public key set is loaded and whether any component caches it, because a stale cache is the most common cause of failed refresh during rotation.
Does isolating workers make our Airflow environment compliant?
No. Isolation reduces the blast radius if a worker is compromised, but it does not make an environment compliant on its own. Compliance assessments look at policy, change management, access reviews, logging, recovery and evidence over time, and independent auditors and certification bodies decide whether controls meet a framework. DeployOpen prepares systems, controls and evidence for those assessments but does not issue audit reports or certifications. Also note that the Airflow security model states the DAG File Processor and Triggerer only have software guards that do not stop a deliberately malicious DAG author, so DAG review and repository controls still matter. Ask your assessor which controls they expect to see and map isolation to those controls.
Should we use environment variables or mounted files for worker secrets?
Mounted files with tight file permissions are generally easier to control than environment variables, because environment variables appear in process listings, container inspection output and crash dumps, and they are easy to copy into logs. Files still need restricted permissions, short lifetimes and a source that rotates them. Whichever method you choose, keep database credentials and signing keys out of worker containers altogether, and confirm that task logs and XComs do not echo secret values, since masking covers only certain names and patterns. Verify the choice with a test that inspects a running worker pod, and record the decision so future DAG authors know the rule.
How Kubernetes identity and upgrade planning affect the design
When Airflow runs on Kubernetes, the cluster's own controls decide how far worker isolation can go. The Task Execution API design assumes that workers hold only short-lived execution tokens and never the metadata database credentials or the signing key. Those guarantees hold only if the cluster enforces them too. Start by confirming which identity provider the cluster uses for people and automation, how RBAC grants access to the namespace where Airflow pods run, and who can read Secrets there. A worker pod that can list Secrets in its namespace can undo the separation the Airflow design creates, so the service account bound to each worker should have no Secret read permission at all.
Version planning is the second constraint. Airflow 3.3.2 supports Kubernetes 1.30 to 1.35, and the Kubernetes project currently maintains 1.35, 1.36 and 1.37 according to its release page, so confirm which of those versions your distribution offers before you choose a cluster. The version skew policy requires that kube-apiserver move one minor version at a time, ahead of kube-controller-manager, kube-scheduler and kubelets, and that kubelets stay within three minor versions behind the API server. Plan a cluster upgrade as a sequence of minor steps and re-test the Airflow worker network policies and token flow after each one, not only after the final step.
Backups deserve the same attention as the RBAC rules. Kubernetes stores Secrets unencrypted in etcd by default, so anyone who can read an etcd snapshot can read the Airflow connection and configuration Secrets that the workers were meant to avoid. Confirm that encryption at rest is enabled for Secrets, that etcd snapshots are taken with etcdctl snapshot save, and that the restore path with etcdutl has been rehearsed on a non-production cluster. Ask your Kubernetes provider or distribution vendor to confirm these settings in writing, since the defaults depend on how the cluster was installed.
What changes if you are still on Airflow 2
Airflow 2 reached end of life on April 22, 2026, so a worker isolation design built on it would rest on a line that receives no fixes. The Airflow support policy limits limited-maintenance releases to security and critical bug fixes, and end-of-life releases get none. The Task Execution API, the short-lived execution tokens and the asymmetric JWT key setup described here all belong to Airflow 3, so the isolation work should be scoped as part of the upgrade rather than as a patch to the existing 2.x install. Confirm with your own version inventory which environments still run 2.x, including staging and any team-owned instances, before you set a date for the isolation work.
The Airflow 3 upgrade guide requires being on Airflow 2.7 or later before the jump, and it recommends moving to the latest 2.x release first. Run the Ruff AIR301 and AIR302 rules across every DAG repository early, because they flag code that will break under Airflow 3. Plan the review as a checklist per repository, and record which DAGs need changes so the owners can be scheduled alongside the platform cutover.
The change that matters most for isolation is that task code can no longer use Airflow database sessions or models directly. Tasks must reach Airflow state through the REST API or the Task SDK. This is what allows workers to run without database credentials, because a task that previously opened a session against the metadata database will fail on Airflow 3 instead of quietly needing that access. Audit custom operators, plugins and helper libraries for direct session use, since these are the usual places where workers still depend on database access and where isolation work stalls.
How DeployOpen scopes and delivers worker isolation
DeployOpen plans, builds and hands over Airflow 3 worker isolation inside infrastructure you control, starting from a written scope that names the executor, the network boundary and the secret delivery method. Each step is documented so your own platform team can operate and verify the setup after handover.
How we scope
- Inventory which executors, worker hosts and DAG authors your Airflow 3 deployment uses today.
- Map which components reach the metadata database and which must reach only the Execution API.
- Agree in writing which signing key arrangement, network policies and secret delivery method are in scope.
How we build
- Configure the scheduler as JWT signer and the API server as validator using an asymmetric key pair.
- Apply network policies so worker pods or hosts can reach only the Execution API endpoint.
- Remove database credentials and signing keys from worker environments, then test that tasks still complete.
How we hand over
- Document the token lifetime, refresh behavior and key rotation steps for your platform team.
- Provide runbooks for adding a new executor, worker pool or edge host within the trust boundary.
- Record test evidence showing workers cannot read the metadata database directly from their network segment.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Retesting after Airflow upgrades or executor changes can be included in the written scope.

