All courses

Choose what to hand to an agent

Judge how well a task fits an agent on four axes: how cheaply the result can be verified, how much unwritten context it needs, how reversible it is and how security-critical it is. Delegate well-specified, checkable, local work. Keep, pair on or split ambiguous, cross-cutting or high-stakes changes.

Builds on: What the agent cannot see, Agents optimise the signal they can see

Read it card by card Start the whole course

Five tickets, one agent

Monday's backlog has five tickets: - add a `--dry-run` flag to an import script - make the dashboard "feel faster" - rename the `email` column to `contact_email` - change who may see invoices - find out why the nightly job got slow in production The agent will take all five and return a green diff for each. Which ones should it get, and in what shape?

Fit depends on what it can see and check

The agent works toward the signal it can see and fills gaps from what it can read. A task fits when that visible signal is close to the real goal and the needed knowledge is in the repo. When it isn't, you get a plausible diff whose error shows up later: data gone, an access hole, a guess about production. The price of a miss matters too. A bad CLI flag costs one revert. A revert can bring back a dropped column, but not the data that was in it.

The four axes

Rate each task: 1. **Verify**: can you confirm the real goal, not just a proxy signal, in minutes by running something? 2. **Context**: is what it needs in the repo, or in heads, production or history? 3. **Reversible**: does `git revert` fully undo it, or does it touch data, released interfaces or sent messages? 4. **Security**: could a quiet miss expose data or grant access? All fine → delegate. One bad → fix it first (write a checkable target, gather the missing facts), or split that part off and keep it or pair on it. Several bad → keep.

Sorting the backlog

- `--dry-run`: a test shows nothing is written. The work is local and a revert undoes it → **delegate**. - "Feel faster": nothing to check yet. You set a target first (dashboard loads under 1 s on the seeded test data, measured by a script), then **delegate**. - Invoice visibility: security-critical, and the rules live in heads → **keep**. The agent may draft tests for you to review. - Slow nightly job: needs production facts → you gather timings, then hand over a narrow reproduction. - Rename: **split** (next card).

The rename hides an irreversible part

Renaming the field across 40 files is good agent work. The type checker and tests catch most missed spots, and a search for the old name finds the ones in SQL strings and templates. As long as the name isn't part of a released interface, a revert undoes it. This Alembic migration is different. `drop_column` deletes every stored email. Tests run on a fresh, empty database, so they stay green. The `downgrade` looks like an undo, but it only restores an empty column. **Later cost:** permanent data loss. Keep this part yourself: use `op.alter_column(..., new_column_name=...)` and try it on a copy of real data.
// Python
+++ b/migrations/0042_contact_email.py
+def upgrade():
+    op.drop_column("users", "email")
+    op.add_column("users", sa.Column(
+        "contact_email", sa.String(255)))
+
+def downgrade():
+    op.drop_column("users", "contact_email")
+    op.add_column("users", sa.Column(
+        "email", sa.String(255)))

Delegate the checkable, keep the risky

Hand over work that is cheap to check, self-contained in the repo, fully undone by a revert and not guarding access. If one axis fails, fix it first by writing a checkable target or gathering the missing facts. Otherwise split off the unclear or risky part and keep it or pair on it. Size is not one of the axes.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.