| Version | Supported |
|---|---|
| 1.x | Yes |
| 0.x | No. Upgrade using docs/MIGRATING.md. |
Report vulnerabilities privately:
- Do not open a public GitHub issue.
- Email clement.tourriere@gmail.com with the subject "devflow security".
- Include a description, steps to reproduce, the potential impact, and a suggested fix if you have one.
You should receive an acknowledgment within 48 hours. The goal is a fix within 7 days of a confirmed vulnerability.
[hooks]commands (setup,switch,teardown) are shell commands run withsh -cin the worktree. They can do anything your user can.- devflow acts only on content you approved. Trust is the SHA-256 of a versioned scope (version 2), stored per project checkout in
trust.tomlwith the version it was made under. The scope is: every hook command with its name and effective timeout (after mergingdevflow.local.toml); the[env]presets and recipe templates, as written (never a generated value or password); and the pitchfork configuration of the project directory,pitchfork.tomland.config/pitchfork.tomlwith their.local.tomloverlays, every field of every daemon (command,dir,env, hooks,cron,watch,boot_start,auto,depends,ready_*, …). Any change to any part needs approval again. Review whatdevflow trustshows. - The approval is kept per project and main checkout, but the digest it holds is compared with the scope of the workspace a command acts on: the project's configuration is read from the main checkout, the pitchfork files from that workspace's own directory. Approving the main checkout therefore does not approve a linked worktree whose pitchfork files differ, and setup, switch and teardown hooks and
[env]recipes in that worktree wait fordevflow trustrun inside it (one approval per project and main checkout means the latest approval is the one on record). An approval stores the digest that was reviewed and nothing recomputed: a file replaced after the check leaves an approval of what was shown, which then no longer matches. - A version 1 approval (hooks only) never authorizes version 2 content: it reads as untrusted with
format_changed. A project with no hook, no[env]and no pitchfork configuration has nothing to approve. - pitchfork files are read read-only (regular files only). At most 1 MiB of a file is parsed; a larger file is not parsed but hashed whole, as a stream, so a change anywhere in it is a change to the scope. A file above 256 MiB cannot be bound to an approval, so the scope is never reported as trusted and approving it is refused. Every component of a file's path is checked for links, a directory link included (
.config -> /elsewhere): a link is followed only inside the project, and one that leaves it is reported and bound by its hash, never shown. A file that cannot be parsed is covered by its hash, and parse errors never quote the file. Only the project directory is read: pitchfork's own user and system configuration and the files of parent directories belong to the user. - Autonomous triggers.
cron,watch,boot_startandautomake pitchfork start a daemon on its own, as soon as a supervisor sees the worktree, with or without devflow.devflow trustand the GUI dialog flag every such daemon explicitly. Approving the scope states that you accept those commands; it does not stop pitchfork from running configuration you did not approve when you run pitchfork directly (see the plan, D4). - Which daemons a command reaches. devflow starts and stops exactly the fully qualified
namespace/nameids of one workspace's own daemons. It never uses pitchfork's--local,--allor--global, which select daemons by scope (--localtakes those of every configuration from the working directory up to the root, so a worktree inside another project would act on that project's daemons), and it refuses to start a daemon whosedependsnames anything outside the workspace's own pitchfork files, because pitchfork starts dependencies by itself. A workspace is attributed daemons only through the namespace its receipt assigned (df-<project8>-<instance8>), never through a namespace a file declares: the files must give that same namespace before devflow shows, starts or stops anything, and otherwise the operation is refused (foreign_namespace;--forcedoes not override it, and a forced removal leaves the daemons running). Only thenamespaceandworktree_labelthat devflow generated are left out of the trust digest, so a file edited to name another workspace's namespace is also unapproved. A start or stop is also verified against the namespace it acted in, read from the rawpitchfork list --jsonand not through the files as they are afterwards: a file pointed at another workspace's namespace whilepitchfork stopruns would otherwise make the daemon that still runs under the assigned one vanish from the report and let a removal go on over it, so a daemon of the captured namespace that still runs, or an attribution that changed during the operation, makes the report not ok. The dependencies judged are those of a daemon's highest-priority definition (pitchfork replaces a daemon defined in several files whole); every layer stays in the approved scope. - Unknown is not nothing. A pitchfork state devflow cannot read (the listing fails or is over the output budget, a pitchfork on
PATHthat does not run, as a mise shim without a version, or lacks a feature devflow calls) is never taken for "nothing runs": starts and stops are refused (state_unknown, ornot_installedwhen pitchfork cannot be used at all), and so is the removal of a workspace that has pitchfork files and a namespace, until--forceaccepts not knowing (which stops nothing it cannot ask and says the daemons may still run). A listing devflow cannot read with confidence is not "nothing runs" either: for a stop or a removal only a daemon in a known stopped state (stopped,errored,failed,available) counts as stopped, and a daemon of the workspace in any other state (unknown, one a later pitchfork adds), with a malformed id, status or pid, or an entry that cannot be read at all, isstate_unknown. A supervisor that is down is not "nothing runs" either: pitchfork's daemons survive their supervisor (a SIGKILLed supervisor leaves them running, reproduced against 2.29.0), so devflow records in the receipt, before every start, the daemons it asked pitchfork to start, and clears the record after a stop it read back with the supervisor up. With the supervisor down and a recorded start, removal anddownare refused (state_unknown, forceable;pitchfork supervisor start, thendevflow down, takes the daemons back and stops them) and a forced removal says the daemons may still be running; with no recorded start they proceed with a warning that processes started outside devflow cannot be checked. A workspace with no pitchfork file and one devflow never set up are not held up. Neither is a machine with no pitchfork onPATHat all: a project that commits apitchfork.tomlmust not make everyone without pitchfork pass--force, which also overrides the dirty and unmerged protections. That is an accepted exception, and it is said: when the workspace has devflow's namespace file or a recorded start, the removal result carries the warning "pitchfork isn't on PATH, so devflow couldn't check this workspace's daemons" and stops nothing. - Bounded commands. Every command whose answer devflow reads (pitchfork's queries and
start/stop,docker compose port, thedockercalls of the container services) runs through one runner: its own process group, ended and reaped at the deadline; at most 4 MiB kept per output stream (beyond it the stream is read and dropped, never blocking the command, and the call is flagged truncated, which pitchfork queries,docker composelookups anddocker exectreat as an error rather than parsing a prefix); and a bounded wait for output after the command exits, one wait for both streams, never longer than 500 ms nor than what is left of the timeout. Processes a command left behind holding its pipes are ended with its group (TERM, then KILL) for queries; those ofpitchfork startandstopare left alone, because the supervisor thatpitchfork startlaunches can be in its group. A process that escaped the group (setsid) cannot be reached: its reader thread is detached and ends when it lets go of the pipe. - Residual risk: the instant before pitchfork reads its files. Approval, namespace and readiness are checked, and the files read again, immediately before every start, stop and removal's stop, and any change since the first look refuses the operation. That includes devflow's own
devflow.toml: theProjecta caller holds is a snapshot, so the last look reloads it and judges readiness (the receipt against the configuration's generations), the scope and the approval on the configuration as it is then; one that cannot be read then refuses the operation (unreadable). What cannot be closed is the interval between that last look and pitchfork itself reading its configuration (it reads its files on its own, and runs a daemon's lifecycle hooks from them): a process that can write the worktree at that moment can still change what pitchfork runs. devflow's guarantee is about the content it checked a moment before; it is not a sandbox, and pitchfork itself, run directly, acts on whatever the files say. - Trust covers the commands, not the scripts they invoke. A trusted
bun run db:migrateruns whateverpackage.jsonsays. [env]recipes and presets put values into the environment of every process that loads.devflow/env, which is a way to run code (NODE_OPTIONS,PATH,BASH_ENV, …). They are therefore applied only for an approved scope (orDEVFLOW_TRUST_HOOKSfor one run): otherwise.devflow/envholds only what devflow generates and the workspace isneeds_attention. Recipes cannot set what devflow generates or reserves (DEVFLOW_*,PG*,DATABASE_URL,COMPOSE_PROJECT_NAME, and the<NAME>_DATABASE_URLof each scratch database).- In
--jsonand--non-interactivemodes, and when stdin or stderr is not a terminal, untrusted hooks are skipped and the workspace is markedneeds_attention.DEVFLOW_TRUST_HOOKS=1(ortrue) trusts for one run; use it only for repositories whose hooks you have read. teardownhooks run ondevflow removeand need the same trust: untrusted teardown hooks refuse the removal, and--forceremoves the workspace without running them.- mise can replace the workspace's database. A command that goes through mise (
mise exec,mise run, a shim) has mise's[env]applied over the variables devflow gives it: a later_.file, amise.local.toml, a plain[env]key (orDATABASE_URL = false), amise.tomlin a subdirectory, an environment-specific file selected byMISE_ENV, a task's ownenv,conf.dor the global configuration can hand a hook the main checkout'sDATABASE_URL. A check made at the root of the worktree cannot establish what a command receives, so the defence is by construction:devflow exec -- CMDsets.devflow/envon the environment last and replaces itself withCMD, and whatdevflow initgenerates goes through it (mise exec -- devflow exec -- CMD, daemonsrun = "devflow exec -- CMD"). A daemon counts as wrapped only when its wholerunis one simple command,devflow exec [options] -- PROGRAM ARGS(behindNAME=valueandexec, redirections allowed), whose program starts no mise:devflow exec -- true; npm run devstarts the app outside the wrapper anddevflow exec -- mise exec -- npm run dev(or throughenv,sudo,sh -c) hands it mise's values after devflow's, so neither skips the check of what mise delivers. The test is conservative about where mise hides: any occurrence ofmiseas a word in what followsdevflow exec --counts, inside a quoted string forsh -c/bash -c/eval(devflow exec -- sh -c 'env -u X mise exec -- bun run dev'), after a wrapper with options (env -u X,sudo -E,timeout 5,nice -n,nohup,xargs,command,exec,time) or in a path ending in/mise, and a command word that is a shell expansion ($TOOL run) is not followed; anything the scanner does not understand counts as not wrapped and not protected. The same holds for a hook (mise exec -- devflow exec -- mise exec -- CMD, or… -- sh -c 'sudo -E mise …', is an unprotected use of mise). For hooks written by hand, devflow checks at run time, before the first setup hook, from the commands: a hook that runsdevflow execinside mise needs no check of the variables; for any other hook that runs mise it runsmise exec -- sh -c …in the worktree with exactly the environment the hook will get (with a timeout, killing the process group, and capped output) and compares the variables the process sees with.devflow/env's (a different value is overridden, a missing one removed); on either, or a failed check, no hook runs and the workspace isneeds_attention.--skip-mise-checkruns the hooks anyway and is recorded in the receipt. A hook the check cannot stand for (cd DIRahead of mise,mise run/mise r/mise tasks run,mise -C/-E, aMISE_*assigned in the command) is not blocked and is named in a warning (its name or index, never its command) recommendingdevflow exec. A command chosen at run time ($TOOL exec), mise started from a script file or from a program's own code, and one that reaches mise through a shim, is not seen, except that a variable in command position afterdevflow exec --makes the daemon not wrapped. Only variable names and file paths are ever logged or returned: no value, and nothing mise prints on failure (a parse error can quote a line);devflow execprints no value either and starts nothing without the workspace's file._.sourcescripts that mise runs while resolving belong to the trusted configuration. - mise trusts a configuration on its own. With mise 2026.10,
mise execandmise runrecord the directory as trusted and run the configuration (_.file,_.source, templates) when they have no terminal, wheremise envrefuses: a hook that runs mise in a worktree whose configuration nobody reviewed would trust it silently. devflow therefore asksmise env(which trusts nothing) before the first hook whenever a setup hook runs mise at all,devflow execinside it or not, and stops withmise trust PATHnamed when mise refuses. devflow never runsmise trustand never edits mise's settings;devflow doctorprints the choices and runs neither:mise trust PATHfor one file, ormise settings add trusted_config_paths DIRfor the worktree directory, which trusts every mise configuration file that will ever appear under it, in every worktree anyone creates there. What a hook the check cannot stand for runs in another directory is mise's own business: itsmise execthere trusts what it reads.devflow inittherefore proposes nomise trusthook: it cannot run before the worktree is stopped. - Replacing a configuration file needs an atomic exchange to be airtight.
devflow init --applyreplaces each file by exchanging a staged copy with it (renamex_npon APFS,renameat2(RENAME_EXCHANGE)on Linux filesystems that support it) and comparing what was displaced with what the plan read: a save that lands in that window is put back or kept next to the file, never lost. Where no exchange exists (other filesystems), a narrow window remains between checking that the file is unchanged and renaming over it, in which a save by rename can be overwritten; the file is hard-linked to a backup before the replacement and the backup is kept when an in-place edit shows in it, but a save by rename in the last instant is not recoverable. On such a filesystem, do not save the files--applyis writing while it runs. - devflow is not a sandbox. Use your agent harness, containers or VMs when you need hard isolation.
- Each project has one PostgreSQL 18 server. The admin (provisioner) role owns every devflow database and the
devflowmetadata database; it can read and change everything in the project. Never give it to a sandbox. - Objects in all branch and snapshot databases of a project belong to one
NOLOGINproject owner role. Each branch has its ownLOGINrole that can connect to its own database only. A branch role cannot connect to sibling branches or snapshots of the same or another project. The login is aSET-only member of the owner (INHERIT FALSE) andSET roles to it at login, so sessions act as the owner; the owner holdsCONNECTon the branch's own databases (and nothing else) so that functions that check it for the current user, such aspg_database_size(current_database()), work inside a branch. The owner is shared, which is why no login may inherit it: the connection check is made for the login beforeSET roleapplies, and a login that inherited the owner would inherit itsCONNECTon every sibling. A consequence: a session can read the size of a sibling's database (pg_database_size('<name>'), a generated name), never connect to it. Branches made by an earlier build are converged by the next operation on the project (devflow db reconcile, or any create, reset or drop): logins stop inheriting first, then the owner is grantedCONNECT. - New databases are created closed (
ALLOW_CONNECTIONS false), have their ACLs normalized, and are opened to the branch login last. Thedevflowmetadata database is closed the same way. Snapshots are not templates, so only the admin can clone them. - Logins and owners have no elevated attributes (no superuser,
CREATEDB,CREATEROLE, replication orBYPASSRLS) and noADMIN OPTION. A session acting as the owner cannot cancel or terminate a sibling branch's sessions. - Scratch databases (
extra_databases: the test and shadow databases of a branch) do not change this model. Each is created empty by the same closed-creation protocol as a branch database (closed,PUBLICrevoked, the owner role grantedCREATE, TEMPORARY, opened,CONNECTgranted last to the login and the owner), owned by the admin, and open to that branch's login only: a sibling's login cannot reach it, and the login keepsNOCREATEDB, so tools use the database they are given instead of creating one. They are separate databases recorded by identity in the metadata database, so no clone, snapshot orREASSIGN OWNEDever reaches them; the login is the branch's own, so rotating its password covers them and its URLs are as secret asDATABASE_URL. A name removed from the configuration leaves the database in place as a recorded orphan; it stays reachable only by that login and is dropped only on request. - On an external server devflow changes only databases it created. Restricting access to every other database on that server (
pg_hba.conf, or revokingPUBLICCONNECT) is the operator's responsibility. A managed server revokesPUBLICCONNECTonpostgresandtemplate1. - Replication machinery (subscriptions, background workers) is outside the cloning contract.
- Roles that cannot be dropped are disabled (
NOLOGIN, no password) and recorded for cleanup. - Branch roles can use the server's resources (connections, disk, CPU). devflow adds no quotas in 1.0.
- Database and role names are generated; devflow never derives ownership from a name.
- Every branch is a container of its own with its own
--requirepass, generated at creation and never inherited: an RDB file carries data, not credentials, so a clone cannot answer to its source's password, and the source cannot be opened with the clone's. The password is on the command line the container starts with, so the server never listens without it; the trade-off is that anyone who can rundocker inspect(root-equivalent on the Docker engine) reads it, and that the host's process list shows thedocker createcommand line for the instant it runs. Do not use the services on a machine with untrusted local users, and do not hand a sandbox the Docker socket, context or SSH key. - The catalog (
<data dir>/services/<project id>.json, mode 0600) holds each branch's password, container id, volume, pinned image digest and port, and the operation journal; the coordinator's per-operation logs under<project id>.logs/are 0600 and redacted. Ownership comes from the catalog: devflow removes or restarts only the container and volume ids and names it recorded, and only if theirdev.devflow.*labels agree with the record: the project, the service and the one branch, snapshot or operation the resource was made for (dev.devflow.branch,dev.devflow.snapshot,dev.devflow.helper). The project's label alone is not enough, so a volume that shares only the project's label (another service's, another branch's, a namesake someone created) is never deleted by a rollback, a reset's cleanup, a drop or a snapshot delete, and is never written into or started on. A resource that does not agree is kept: the operation that wanted to remove it stops there, is not counted as done and stays journaled, anddevflow service NAME reconcilelists it as needing an operator until you remove it yourself (if it is not devflow's) and reconcile again. Docker has no conditional delete, so the labels are read just before the removal by name; a replacement created in that instant is not covered. A container that merely has a name devflow chose, or carries a devflow label without a record, is refused and reported, never adopted or removed. The catalog is bound to the Docker daemon id: another daemon's resources are not this project's, and a catalog opened on a different daemon is refused. - Each branch is published on
127.0.0.1only, on a port allocated once fromhash(project, service, branch)in 20000–39999 and kept (never moved silently). On OrbStack the container also has an identity-suffixed name,<branch8>.<key>.<project>-<project8>.devflow.orb.local, reachable from containers and from the Mac with the same password. Valkey/Redis speak no TLS here: the loopback binding and the password are the protection. - The copy helper runs with no network (
--network none), mounts the source volume read-only and exists only for the copy; it is killed and confirmed gone on a deadline or when its coordinator died. The short-lived read-only helper a recovery uses to check a volume is journaled the same way (its name before Docker creates it, its id right after), so a recovery that is killed leaves a helper the next recovery, drop or reset finds and removes, not one that pins the volume forever. Adocker createwhose client was ended can still be carried out by the daemon later, so every attempt (each has a name of its own) is recorded in the catalog's list of helpers before Docker is asked for it, and the list outlives the operation. Reconcile, a rollback and every volume removal look for the attempts that are not resolved: anydocker createclient of the name (found withps) is waited for and ended after a minute, and the container, if it exists, is removed by its id or by the attempt's name when it carries this operation's helper labels. An attempt is resolved (and dropped from the list) only once its container was made, removed and confirmed gone. One whose outcome is unknown is fenced, not waited out: no id came back and nothing has the name, but the daemon may still hold the request and deliver it after any deadline (the late helper would pin the volume, or, once the volume was removed, recreate it empty), so elapsed time is never taken for completion. The cleanup creates a tombstone under the attempt's exact name: a container made from the helper image already present (never pulled), never started, with no mounts, no network and no published port, labelled as a tombstone of the operation (dev.devflow.tombstone, and deliberately not as a helper). A create of that name that arrives later fails with a name conflict before any volume is touched. If the tombstone's own create conflicts because the real helper appeared meanwhile, the real one (it has no client left) is removed by its labels and the tombstone is created again; a namesake that is neither is left alone and the attempt stays unresolved. Sweeps of several processes (two reconciles, a volume removal, aforget) do not interleave on one attempt: each attempt is handled under a lock of its own (<service>-attempt-<name>.lockin the catalog's lock directory), from the inspect and removal of its container through the tombstone to the catalog write, and it is read again under that lock, so a sweep that read it before another resolved it does nothing. A catalog write for an attempt that is no longer listed is not a success: the tombstone made for it is removed. While aforgethas marked the service, no other sweep makes a tombstone, so none appears behind the one that is removing them. Tombstones are tiny and the late create has no deadline, so none is removed with time: the attempt stays listed with the tombstone's id, every sweep makes the tombstone again if someone removed it, andforgetremoves them last, after its other effects and just before it deletes the entry. A create delivered afterforgetis no longer fenced and can leave an unlabelled empty volume of its own, which no label ties to the project; that window is the cost of leaving no container behind for a service that is gone. Before a branch's or snapshot's volume is removed, the helpers of the list and those that still mount it (this project's, this service's, a helper label) are removed, and while Docker says the volume is in use the sweep and the removal are repeated, a bounded number of times. - A Valkey/Redis source with nothing new to save is cloned from its last save, not from a new one. devflow reads
INFO persistencefirst; whenrdb_changes_since_last_saveis 0, no save is running,rdb_last_bgsave_statusisokand the source volume holds a non-emptydump.rdb, it reflinks that file and asks for noBGSAVE; otherwise it takes theBGSAVEpath. The reasoning: the server replacesdump.rdbby an atomic rename of a complete temporary file, so a reflink sees a whole file; with no change since the last save that file is the live dataset; and a write racing the check has the same point-in-time ambiguity aBGSAVEfork already has. The clone recordscapture_last_saveand the server'srdb_last_save_timeas its capture time, andcapture_exactis cleared if the server saved again while the file was copied. This changes no credential or isolation property: the file is the same kind of data theBGSAVEpath copies, it is read from a catalog-recorded, label-checked volume, and the copy helper is the same. devflow service NAME urlis the one command that prints a container URL with its password.status,listand every other--jsondocument redact it, and the URL is a secret in.devflow/env,[env]recipes and hook output likeDATABASE_URL.- A copy reads only a source volume the catalog records: it must exist (a missing volume is never created by being mounted, and never stands for an empty dataset) and carry this project's, this service's and the branch's or snapshot's labels before it is mounted. A snapshot made by a pre-release build has no snapshot label and is not migrated: a copy from it is refused with the command that removes it, and
snapshot deleteremoves it by the catalog's record and the project and service labels (a missing snapshot label is accepted there; another snapshot's never, and neither is a volume that carries a branch or helper label, whose identity is its own). A rollback is recorded (RollingBack) before anything is removed and is resumable, and a completion after a crash first finds the volume the copy produced, whole and ours, or rolls back instead. - Recovery runs under the locks and is bounded. Whoever takes the locks of a branch or snapshot (a clone or snapshot coordinator,
up,down, a removal) looks again for unfinished operations that touch them: two requests can both pass the check made before locking, and the one that runs second would otherwise run against what a coordinator that died left behind (a stopped source). An abandoned operation is recovered (with the locks released for it) and the locks are taken again, a bounded number of times. A stop is fenced, not waited out. Adocker stopis journaled before it is issued, but the daemon can receive it after any deadline and keeps carrying it out when its client is gone, so no elapsed time proves it over. Unless its client was seen to return success, recovery never reuses the container the stop named: it journals the decision, stops the container itself, removes it by its recorded id (labels checked, absence confirmed) and creates a new one from the managed profile on the same volume, name, port and labels, which it health-checks; a late stop names an id that no longer exists. The container's id changes, its data and endpoint do not. An ordinaryservice downis journaled and fenced the same way. It belongs to no operation, so its stop is recorded in the branch's own catalog record (container id, the time it was asked for, the grace, the caller's pid) before it is issued, and cleared only when the client returns success. If it times out or its caller dies while Docker still holds the request, the record stays; the nextupof the branch (and a workspace's setup or switch, which start it throughup) stops the container it names itself, removes it by that id, confirms it gone and starts a new one on the same volume, name, port and labels, and the nextdownremoves it instead of issuing a second stop at the same id. A record whose container is already gone is cleared.devflow downand removing a workspace stop no service container withdocker stop(a removal deletes the recorded container by id), so they have no stop to fence. Everydockercall of the container services goes through one bounded runner (60 seconds for a query, start or removal, a pull 15 minutes, a stop its timeout plus a minute), and a recovery also passes what is left of its own time (20 minutes) to each call; a daemon that does not answer in time, or a log that cannot be read, is unknown (a typed timeout), never "nothing is going on": the recovery stays pending with its journal intact, and a timeout while verifying a copy does not roll the operation back.forgetis exclusive per service (a lock file in the catalog's lock directory, held from before its marker is set until the entry is deleted or the marker cleared; a secondforgetwaits half a minute and then reports the service busy), so two of them cannot remove and make tombstones behind each other. It persists a marker that makes planners refuse to record anything for the service, and deletes its entry only after reading it again under the catalog lock and finding nothing it did not remove; a fenced attempt counts as removed only while the catalog still names the very tombstone container (by id, not by the attempt's name) that was removed. Helper-attempt lock files are never unlinked on release (a waiter could keep the old inode);forget, once the entry is gone and while still exclusive, removes the files of the attempts that are no longer listed, which nothing can be waiting to act on.reconcilecounts the old container and volume of a reset that is waiting for its cleanup as recorded. - Test hooks (
DEVFLOW_TEST_LABEL,DEVFLOW_TEST_COPY_DELAY_SECS,DEVFLOW_TEST_COPY_TIMEOUT_SECS,DEVFLOW_TEST_NO_REFLINK,DEVFLOW_TEST_STOP_TIMEOUT_SECS,DEVFLOW_TEST_QUERY_TIMEOUT_SECS,DEVFLOW_TEST_RECOVERY_BUDGET_SECS,DEVFLOW_TEST_CREATE_WAIT_SECS) only add a label, slow the copy down, pretend reflinks are refused, shorten the time a MySQL source has to stop, the bounds on Docker calls and the recovery's time, or the waits for a late helper create; they grant nothing and are meant for the Docker tests.
The MySQL engine follows the rules above and adds these. It is marked preview until its review closes.
- Accounts. A branch has MySQL's own accounts,
root@localhostand one application account,app@%, and nothing else. The root password and the application password are generated per branch (32 alphanumeric characters), never inherited, and kept in the 0600 catalog.rootexists only inside the container (there is noroot@%), so it cannot be reached through the published port. The application account has all privileges on its one database. A source that has any other account (mysql.useris audited, including roles) is refused by name: it would keep its source's password in the clone. So is one that grants roles (mysql.role_edges,mysql.default_roles) or proxy privileges beyond the default row ofroot@localhost(mysql.proxies_priv). Nothing of the source's authentication is inherited. The bootstrap sets each managed account's password withcaching_sha2_passwordnamed,REQUIRE NONE, no password expiry, no failed-login lock-out,PASSWORD REQUIRE CURRENT DEFAULTandACCOUNT UNLOCK, thenDISCARD OLD PASSWORD: a plainALTER USER … IDENTIFIED BYleaves a secondary password (RETAIN CURRENT PASSWORD) in place, which would still open the clone with a password its source knew. MySQL's own accounts are locked and have their secondary password discarded. The accounts are then read back with the new root password, and the clone is abandoned (bootstrap, nothing promoted) unless every account has no secondary password (User_attributes), the two managed accounts are exactly as set and the others are locked. What still comes from the source is data: the application account's grants on its database, and any other privilege ofapporrootthat the source's own tables held. - Where the passwords travel. Never on a command line and never in a container's environment or
docker inspect: the container is created with no secret in its arguments or variables. devflow sets and checks passwords withdocker exec -i, and the secret is on the standard input of that command: the SQL of the bootstrap (ALTER USER … IDENTIFIED BY '…') and, for the health check, the first line of the input, which a smallbashscript reads into themysqlclient's own environment (MYSQL_PWD) and nowhere else. Sopson the host showsdocker exec -i … mysql -u appand no password, and thedockerclient's environment holds none. What remains: for the milliseconds amysqlclient runs, its password is in that process's environment inside the container, readable by root in the container (/proc/<pid>/environ). No password is written to a file in the container. A password is masked in every message devflow builds from the client's output. - A clone never listens before its identity is set. The clone's data directory is copied without
auto.cnf(so it gets its own server UUID) and without the TLS and RSA key pairs (so it generates its own). A bootstrap container then starts it with--network none,--skip-networkingand--skip-grant-tables; the only way in is its local socket throughdocker exec. There the version is checked (8.4), the accounts audited, new passwords set and both logins proven. It is stopped cleanly and removed before the container with the published port is created. A bootstrap container's id is journaled before it starts, so recovery removes it. - A clean stop is verified, not assumed. The source is stopped with
docker stopand a generous timeout (5 minutes); the copy proceeds only if the container exited with status 0 and its log since its last start holds InnoDB's shutdown report (Shutdown completed; log sequence number …) and the server's. A server killed after the timeout (status 137) aborts the clone, and the source is started again. A crash-style shutdown is not accepted.innodb_fast_shutdown=2exits 0 and logs both reports yet leaves a data directory that needs crash recovery, so right before the stop devflow, as root over the socket, resets a persisted entry (RESET PERSIST IF EXISTS innodb_fast_shutdown), setsinnodb_fast_shutdown=0and reads it back, and refuses unless it reads 0. The stop's log must also lack InnoDB's very-fast-shutdown notice (this is what judges a source that was already stopped: one stopped with a fast shutdown of 2 is refused, with the command that starts it again). Two more checks do not rely on the proof: the log of the source's next start, and of the clone's first start in the bootstrap, must not containStarting crash recovery; either abandons the clone (a session that asked for a very fast shutdown in the instant between the preflight and the stop is caught there). OtherSET PERSISTsettings are part of the data directory and are inherited by a clone. - Profile file. The generated
my.cnf(<data dir>/services/mysql-profile-v1.cnf, 0644, no secret in it) is bind-mounted read-only into each container. It needs a Docker daemon that can mount devflow's data directory (Docker on Linux, OrbStack, Docker Desktop and Colima with the home directory shared); a remote daemon cannot. InnoDB only. The profile setsdefault_storage_engine=InnoDBanddisabled_storage_engines(MyISAM, MEMORY, BLACKHOLE, ARCHIVE, CSV, FEDERATED, MERGE): MEMORY tables are not supported, because they lose their rows when the server stops, and a clone stops the source. Before it stops a running source, devflow lists its user tables outside InnoDB (information_schema.tables, base tables outsidemysql,sys,information_schemaandperformance_schema) and refuses, naming them, with the source untouched. A source container started before the profile had these settings is covered by that check only: a MEMORY table created in the instant between the check and the stop loses its rows. A source that was already stopped is not queried. - Network. The container is published on
127.0.0.1only. MySQL generates a self-signed certificate and clients may use TLS (ssl-mode=PREFERREDdoes); plain connections are accepted too, so the loopback binding and the password are the protection, as for Valkey and Redis.bind-address=0.0.0.0applies inside the container, which has no other published port (the X protocol is off). - Interruption. A clone of a running MySQL source interrupts it for a few seconds: its connections are closed, running statements (even a long
ALTER TABLE) are cancelled and rolled back, and clients must reconnect. The downtime is measured, recorded and reported bydevflow service status,doctorand the setup output. A stop can outlive its coordinator, and Docker keeps carrying it out after its client has gone. Adocker stopis a client of the daemon in a process group of its own, and its request may reach the daemon late, or reach it and lose its client. The request is therefore journaled before it is issued (the container, itsStartedAton the daemon's clock, the time, the timeout and the coordinator's pid) and its outcome after. That no client is visible proves nothing, so whatever restarts a source an operation stopped (a rollback, recovery, a reset's cutover rolled back) first settles an outstanding stop by time: nothing is restarted, and the source is not called healthy, beforerequested_at + timeout + 30 secondshas passed, when the daemon's stop (SIGTERM, the timeout, SIGKILL) has necessarily finished; adocker stopclient still around is waited for and ended only after the deadline the coordinator would have enforced (killing a client that already reached the daemon would turn a graceful stop into a kill). Thendocker inspectsays whether the container is stopped, started again since (anotherStartedAt) or still in the run of the request (the stop did not take effect), and a shutdown the server logged as begun is waited for; an answer or a log that cannot be had keeps the recovery pending. Only then it starts the source and checks it, and after a short settle period checks again before the rollback is marked done. The cost is that a recovery of a stop whose return was never seen waits up to the stop timeout (5 minutes) plus 30 seconds. A stop that is known to have returned successfully needs none of this.
- Branch URLs contain passwords. They are written to
.devflow/envand to the workspace receipt, both with mode 0600. The URLs of a branch's scratch databases (TEST_DATABASE_URL, …) carry the same password: they are written only to.devflow/env, derived from the receipt's URL (the receipt lists their database names, no password), and masked likeDATABASE_URL. So is every[env]value built from a password (DIRECT_URL = "${DATABASE_URL}", alaravelorspringpassword field, asqlalchemyURI): such a value is secret, written only to the 0600 file, never shown by devflow, and registered as a known secret so hook output and logs mask it whole. The trust scope and its digest contain templates only, never these values..devflow/ignores itself, so it does not appear ingit status; never commit it. - A managed server publishes one fixed port on
127.0.0.1(allocated once in 20000–39999 and recorded inadmin.json, unlessportis set). On OrbStack it is also reachable by name (<service>.<project>-<id8>.devflow.orb.local:5432) from containers and from the Mac; the same credentials are required. - A managed server's superuser password is in
admin.jsonandcompose.yaml(both mode 0600) under<data dir>/postgres/<project id>/; the data dir is$XDG_DATA_HOME/devflow(macOS:~/Library/Application Support/devflow) orDEVFLOW_DATA_DIR. - An external server's admin URL belongs in the git-ignored
devflow.local.tomlor inDEVFLOW_PG_ADMIN_URL, never indevflow.toml. - Command output and
--jsondocuments redact passwords (***) exceptdevflow db url,devflow db branch create,devflow service [NAME] urlanddevflow env list --show-values, which exist to hand out credentials. Do not log their output.db branch create --instance-idrotates the password of an existing branch, which invalidates URLs handed out earlier. devflow db psqlpasses the connection (password included) topsqlthrough its environment, never its command line.- Literal credentials in
[env]recipes.devflow.local.tomlis the one place devflow accepts a literal credential in a recipe (devflow env set APP_PASSWORD VALUE --local); it is written as given.devflow env listand the desktop app show a recipe or a resolved value as***when the variable's name says it holds a credential (a word of the name ends in or containspassword,pass,pwd,passphrase,secret,token,key,credentialordsn, in any case or spelling:devflow_core::redact::is_secret_variable) and the recipe has literal text, and by pattern otherwise (a password in a URL, apassword=assignment). The decision is taken in core on the key and the value together, before a JSON document, a table or a window renders them: a literal such asAPP_PASSWORD = "hunter2"has nothing a text pattern could find, and a serialized{key, template}pair loses the association that masks it by name. A template made only of${NAME}references is shown as written. An edit command (env set,env unset,env preset) answers with recipe keys only and never repeats a value.devflow env list --show-valuesis the one way to print the real templates and resolved values; likedb urlit prints credentials on purpose and its JSON is not redacted, so do not log it. In core the real text is behindRecipeRow::revealandPreviewRow::reveal; neither is serialized or part ofDebug, and neither isFileState::textorApplied::text. The app's edit form opens with the text as written, since it is the editor.devflow truststill lists recipe templates as written, because approving them means reading them.
Redaction guards against accidental disclosure; it is not a secret scanner.
- Guaranteed: every credential devflow knows — generated branch and admin passwords, the password of an attached
--database-urland every[env]value derived from one — is masked by exact match wherever devflow shows hook output: the terminal, the GUI and the persisted setup logs. devflow's own JSON and GUI fields are redacted by structure. Output is masked a line at a time, so a known credential that contains a line break (a password with an encoded%0A, a recipe built on one) is also masked in each of its lines; a line of fewer than four characters is not masked on its own, since that would mask ordinary text. Errors about configuration, receipts,admin.jsonand init plans never quote a value, nor any piece of one ([env]recipes and references,[services.*]fields, hook commands, names and timeouts,extra_databases,worktree.copy, admin URLs, TOML and JSON syntax errors): they name the file, the key path (hooks.setup[2].timeout) or the line and column, and the rule that was broken. A deserializer's own message is never shown or searched for a "safe" part; it is classified and rebuilt from the key path and a fixed description (devflow_core::diag). A bare table key is named; any other key is shown as<key not shown>. The commands of a hook that runs are echoed in its output as written, masked like any hook output. - Best effort: other credentials in hook output are masked by pattern: URL credentials and secret query parameters (
password,%70assword,api_key, …), andKEY=value/KEY: valuewhere the key containspassword,passwd,secret,token,api_keyorapikey(shell exports,envlistings, conninfo strings, YAML, serialized JSON). When unsure where a value ends, more is masked. - Not covered: unencoded spaces inside a URL password,
.pgpasslines, values that span several lines and are not known credentials, other databases' credential formats (for example SQL Serverpwd=), and hooks that deliberately obfuscate what they print. Hooks are trusted code: one that wants to reveal a secret can.
worktree.copypaths must be relative and stay inside both the source and the new worktree:..and symlink escapes are rejected. Entries are staged under a temporary name and renamed into place; existing destination entries are never overwritten.- Worktree paths that already exist are refused, never reused.
- Replacing files you may be editing (
devflow init --apply, and thedevflow hooksanddevflow envedits ofdevflow.tomlanddevflow.local.toml, which validate and compute the trust scope between reading and writing). Checking that a file is unedited and then renaming a temporary file over it would overwrite a save that lands in between. devflow stages the new content in a synced sibling file and atomically exchanges it with the file (renamex_np(RENAME_SWAP)on macOS,renameat2(RENAME_EXCHANGE)on Linux), then hashes what was displaced. If it is not what the plan was made from, the files are exchanged back and the apply or edit stops (aConfigChangederror). If that fails, or the file changed twice, the displaced version is kept next to the file asNAME.devflow-conflict-<timestamp>(its own mode) and the error names both paths: displaced content is never silently lost. A file that did not exist is installed with a hard link, which fails if the name was taken. Where no exchange exists, the file is hard-linked to a backup, checked for a replacement by inode, renamed over and the backup compared; a save by rename in the few instructions between that check and the rename is the one window left, only on such platforms. The permissions of the replaced file carry over. - A compose override file (
compose.override.yaml, …) counts as present when a directory entry of that name exists, whether or not it can be read: a symlink that leaves the repository or dangles is not followed but makes the volume list incomplete, soinitnever proposesdocker compose down -vwhile a file it cannot see may rename a volume to the main checkout's.
- devflow 1.0 has no TLS support. A managed server is published on
127.0.0.1by default. Binding to another address, or using an external server across machines, sends database traffic unencrypted. Use a private network such as Tailscale or WireGuard, and do not expose the port to the internet. - Access to the Docker engine that runs a managed server is superuser access to its database. Do not give sandboxes a Docker socket, context or SSH key for the data host.
- Sandboxes should receive only their branch URL. See docs/guide/remote-data-hosts.md.
The repository's Git hooks and CI scan every commit, commit message and tag for secrets with kingfisher before they are published; see CONTRIBUTING.md.
Dependabot proposes Cargo and GitHub Actions updates, and CI runs cargo audit on every push. To run it locally:
cargo install cargo-audit
cargo audit