Letting a coding agent run Supabase backups: what the skill pins down, and what it leaves to you A developer working on the Tessl registry's supabase-backup skill documented how the skill pins the backupdrill CLI to version 2.10.1 and directs agents to install libpq@17 so pg_dump output matches Supabase's Postgres 15–17 range, after testing showed a drill run with pg_dump 18.4 against a Postgres 17.12 source passed only because the sandbox used postgres:18-alpine. The skill also keeps connection strings and bucket keys in a git-ignored .env.backupdrill file created with umask 077, instructs the agent never to print the file or request keys in chat, and runs every command in a subshell that unsets DATABASE_URL and BACKUDRRILL_* variables. The writeup notes that the default postgres login is used because pg_dump fails under row-level security without BYPASSRLS, which requires superuser privileges on Supabase. Ask a coding agent to "back up my Supabase project" and nothing else, and you've left it to pick the connection string, the pg dump binary and where the dump goes. A drill can pass on Postgres 18 even when the server you plan to restore to runs 17. A skill lets you specify the commands and configuration up front. It's a Markdown file with a name and a description: the description tells the agent when to load it, and the body is the instructions it works from. The one I work on is the supabase-backup skill on Tessl https://tessl.io/registry/backupdrill/supabase-backup . It backs up the project's Postgres database to your bucket and includes Storage files if you supply their S3 keys. It runs restore drills in Docker and can restore the backed-up data into a new Supabase project. Version 1.0.2 pins the MIT-licensed CLI it drives to npx -y backupdrill@2.10.1 . For this post I ran the skill's commands with that version against two throwaway Postgres 17.12 containers, one as the source and one as the restore target, plus a SeaweedFS container standing in for S3. A drill can run without me. For a real restore, the skill tells the agent to wait until I give it the target project's ref. With a bare npx backupdrill , two drills a month apart can pick up different CLI versions. If the second one fails, a CLI upgrade is one more thing to rule out. The pin removes it. The pg dump on your PATH can be newer than your restore target. On my Mac, Homebrew's plain libpq package is 18.4, while the skill puts Supabase at Postgres 15 to 17. The skill asks for version 17 brew install libpq@17 , has the agent write its path into BACKUPDRILL PG DUMP , and warns that 18's dumps can contain SQL that Postgres 17 rejects. The pg dump docs say the same thing in general terms: "it is not guaranteed that pg dump's output can be loaded into a server of an older major version". I tried to make that fail and couldn't. A schema with inheritance tables, a table with two parents and a NOT NULL added after INHERIT , dumped with pg dump 18.4, loaded into 17.12 with pg restore 18.4 without an error. I then pointed BACKUPDRILL PG DUMP at 18.4, backed up the 17.12 database and ran a drill. It pulled postgres:18-alpine for the sandbox and passed, with this line among the checks: ✓ sandbox version — restored into PostgreSQL 18 source is 17 : output of pg restore 18 is only guaranteed to load into PostgreSQL 18 or newer; restoring into a newer major version is supported So with 18 tools, a green drill only tells you the dump loads into Postgres 18. With the 17 tools my drill ran on postgres:17-alpine , the same major version as my 17.12 test target. The skill keeps the connection string and bucket keys in .env.backupdrill . The agent first makes sure Git ignores that file and isn't already tracking it. If the file doesn't exist, it creates it with umask 077 , writes placeholders and asks you to fill it in your editor. It's told never to open or print the file and never to ask for a key in the chat. The shell loads the values for the CLI. The Tessl page points out that a hosted model provider receives what the agent reads, including command output. The skill's template uses the default postgres login because pg dump fails if its role is subject to a table's row-level security. A read-only role usually hits that limit on Supabase, where granting BYPASSRLS requires superuser privileges. The default login can also drop or rewrite the tables it owns in public . The same goes for GitHub secrets. The agent copies a workflow into .github/workflows/ and lists the secrets it needs, and then you add them in the repository settings or run gh secret set in your own terminal. Every backupdrill command in the skill also runs inside a subshell like this one: set +x; unset DATABASE URL $ env | sed -n 's/^\ BACKUPDRILL A-Za-z0-9 \ =. /\1/p' set -a; . ./.env.backupdrill 2 /dev/null || { echo ".env.backupdrill could not be loaded" &2; exit 1; }; set +a npx -y backupdrill@2.10.1 backup The unset looked like paranoia until I tested what it prevents. I put spaces around the = on the first line of the file BACKUPDRILL DATABASE URL = '...' and exported a different BACKUPDRILL DATABASE URL in the parent shell, pointing at a host called prod-host . bash 3.2, zsh 5.9 and sh all treat that line as a command, fail with "command not found" and carry on with the next line, so the variable from the parent shell survives. I ran the skill's command with the unset taken out. The 2 /dev/null hid even the "command not found", and the next thing on screen was ✗ getaddrinfo ENOTFOUND prod-host . Had that URL pointed at a reachable database with a valid password, the CLI would have backed up the wrong one. I then put the unset back in and moved the broken line to the middle of the file. The CLI stopped at ✗ Missing required config: - databaseUrl BACKUPDRILL DATABASE URL . You can't count on an agent noticing a stray variable in a shell it inherited, so the command has to handle it. For a database restore, the CLI rejects the backup's source and any target schema that already contains user objects. Before writing to the target database, it requires --confirm-target with the project ref for Supabase or the hostname for plain Postgres. The skill adds a dry run first. Mine printed ✓ target identity: distinct from source , ✓ target schemas public are empty and ✓ dry run passed — nothing was written; re-run with --confirm-target to execute . In an earlier attempt, where both containers were on 127.0.0.1 with the same postgres user, it reported target identity: SAME AS SOURCE and blocked the run until I gave the target its own role. Then I ran the real restore without the confirmation: ✗ restore writes to target "127.0.0.1" — confirm by re-running with --confirm-target 127.0.0.1 use --dry-run first to preview all checks without writing . That message is written for a person, who then has to type the ref. An agent reads the same message and gets the answer handed to it. The flag only works as a safeguard if the value comes from you, so the skill tells the agent to run the real restore only after you ask for it and give it the target ref, and to pass exactly the ref you gave plus the snapshot timestamp from the dry run. That way a backup that lands in between can't change what gets restored. I ran the same restore again without clearing the target: ✗ target schema s public contain 4 existing object s — restore only writes into an empty target. Create a fresh Supabase project or empty these schemas and retry. "Or empty these schemas" is sensible advice for a person who knows the database is scratch. For an agent that's trying to finish the task, it reads like the next step, and on the wrong target that step loses data. The skill's restore steps send the agent to a new, empty project, and none of its steps have the agent drop or delete anything. The CLI itself has no code path that deletes objects in your bucket. Old snapshots go away through lifecycle rules you set on the bucket. The skill doesn't set up a Supabase access token either. A backup uses the database string and the bucket keys, plus the Storage S3 keys if you back up files. A restore adds the target's connection string and, for Storage, the target's service-role key, and you put those in the file yourself. A paused project has to come back before a backup can connect, and the skill sends you to the Supabase dashboard to resume it. In a Supabase discussion about a Free project stuck in COMING UP https://github.com/orgs/supabase/discussions/51807 , the owner reported three failed attempts, with every service showing UNHEALTHY until the project went back to INACTIVE after about 15 minutes. A commenter later said support had helped with their own project. The drill is the part I'm happiest to hand over. It downloads the latest snapshot, restores it into a temporary Postgres container, runs its checks and removes the container. It never connects to the Supabase project. On my test database of 2,000 customers and 8,000 orders: ✓ archive integrity — sha256 matches 47d5e5bdaae3… ✓ pg restore — completed in 0.3s 2 parallel jobs ✓ post-data objects — all post-data objects restored ✓ table count — restored 2, manifest 2 ✓ no missing tables — all manifest tables present ✓ populated tables came back — no populated table restored empty ✓ API grants — access for anon, authenticated and service role set as it was at backup time on 5 object s ✓ Drill PASSED — snapshot 2026-11-22T11-27-30-346Z, 2 tables / 10,000 rows restored in 0.3s Then I cut the dump in the bucket from 70,940 bytes down to 40,000 and ran it again: ✗ archive integrity — sha256 MISMATCH — got 4e2c41016394…, manifest 47d5e5bdaae3… The checksum only says that the file in the bucket isn't the one the manifest recorded. I knew why because I'd cut it short myself. An agent looking at a real bucket doesn't know, and the skill tells it to quote the failing check exactly as printed and not guess at a cause. For this run, I'd copy the snapshot and the result from the JSON report into a restore drill log template on Tally https://tally.so/templates/database-restore-drill-log/mZBx5m and tick the checks that match. The restore step took 0.3 seconds, and the form asks for minutes. "Who ran the drill?" gets a person's name, someone who can answer questions about the run later. I'd also note that row-level security went untested, because a --check-cmd test connects as superuser. "Passed with issues" is for a drill where the data only came back after someone fixed something by hand. The template's filled-in example is one of those, a restore that needed a missing role created first. I work on BackupDrill. I used AI to help draft this post.