Skip to content
In the news TRM Labs × Finray — audit-ready crypto transaction monitoring for banking
Finray

How to write tasks for AI coding agents, with acceptance criteria a person can check

An AI coding agent works to the task it is given, so the task has to say what done means before work starts. A task template with the outcome, acceptance criteria, files involved, what must not change and the test that proves completion, with a CSV to copy.

By
Finray
Published
Reading time
7 min

How do you write tasks for AI coding agents with acceptance criteria?

Write each task so that a person can check the result without asking the agent what it meant. That takes one outcome, acceptance criteria written as checks someone can run, the files involved, what must not change and the test that will prove completion. Record the task before work starts and have a person approve it. Finray works this way: each engineering task is recorded in Pync, Finray’s project system, with its acceptance criteria and a plan before the work starts.

An agent will produce something for almost any instruction. The risk is a confident answer to the wrong question, or the right change plus edits nobody asked for. A precise task limits both, and it gives the reviewer and the approving person one fixed list to check the result against.

This note gives a task template, shows how to write acceptance criteria that can be checked, and follows one synthetic task from the template to approval. The template is available as a CSV to copy.

What goes into an agent-ready task?

What goes into an agent-ready task?
FieldWhat to writeWhy it matters
OutcomeOne sentence on the behaviour that should exist after the changeKeeps the task to one result a person can check
ContextWhy the change is needed and who asked for itLets the agent choose between two valid readings of the outcome
Acceptance criteriaA list of observable checks, each true or falseDefines done before work starts
PlanThe intended approach in a few stepsLets a person catch a wrong approach before any code exists
Files involvedWhere the change should happenKeeps the change small enough to review
What must not changeBehaviour, files or interfaces that stay as they areRules out side effects the criteria do not mention
Proof of completionThe test that fails before the change and passes after itTurns done into something the checks can show
ApproverThe person who approves the task and, later, the resultKeeps the decision with a person

Most of these fields come from the path Finray publishes for its own changes on how we build. A task is recorded with its acceptance criteria and a plan. A written brief then sets out the scope, the files involved, what must not change and how completion will be proven. The context and approver lines are additions that make the template usable on its own.

How do you write acceptance criteria a person can check?

Each criterion should describe something a person or a test can observe: an input, an action and the expected result. Words such as “works”, “secure”, “clean” or “properly” give the agent room to decide what you meant, and they give the reviewer nothing to check. Edge cases belong in the list. A reviewer who finds a case the task never mentioned has to decide whether it was in scope, and writing it down beforehand settles that question.

The examples use the synthetic task worked through below: a password reset link in a customer portal.

How do you write acceptance criteria a person can check?
VagueCheckable
Reset links are secureOpening a reset link that has already been used shows “This link has already been used” and no new-password form
Handle old linksA reset link opened after its validity period shows the existing expired-link message
Do not break anythingThe existing sign-in and password reset tests still pass

A criterion can also say what must not happen. “The reset email text is unchanged” is a check, and it stops an agent from tidying up a template nobody asked it to touch.

How should work be split into tasks?

Give each task one outcome that a person can see working. Splitting a feature into “add the database column”, “add the API field” and “show it on the screen” produces three changes, none of which a person can check from the outside until all three are done. “Show the customer’s VAT number on the invoice” is one task with one visible result, and its criteria can say what happens when the customer has no VAT number.

If a task needs two outcomes, write two tasks, each with its own criteria and its own test.

Why does the test come first?

At Finray a test that fails is written before the code that makes it pass, and an AI agent then implements the change in an isolated workspace. The failing test does two jobs. It shows that the criterion is real and that the test can detect the missing behaviour. After the change, the same test passing is the evidence the approving person looks for.

The “proof of completion” field names that test before work starts. Every change to Finray’s product code then goes through secret scanning, dependency and vulnerability scanning, static analysis and the test suite, so the test runs again with every later change.

Who writes the task, and who approves it?

People decide what is built. A person writes the task or approves it before the agent starts, and in Finray’s case the approved task, criteria and plan sit in Pync.

An agent can draft a task. In Pync, when an agent creates an issue, it applies at once, is marked as created by AI and not yet valid, and lands in Pync’s Review queue for agent changes. A person accepts it, or rejects it and the issue is removed. The note on AI agent approval workflows covers how that review should work.

Who closes the task?

A person. In Finray’s path, a different AI model family from the one that wrote the change reviews it, and its findings go back to the same workspace to be re-checked in the next review. The change is then tested live on a dedicated test environment with synthetic data, and a person approves the exact version that was reviewed and tested. Any later change restarts review.

The acceptance criteria written at the start become the approving person’s checklist at that point. Each line is either shown by a test or a review finding, or it is not, and the task is done only when every line is.

A worked example

The task is synthetic, for a customer portal.

A worked example
FieldEntry
OutcomeA password reset link can be used once
ContextA security review found that a reset link stays usable until it expires, even after it has been used
Acceptance criteria1. Opening a reset link that has already been used shows “This link has already been used” and no new-password form. 2. A link that has set a password once cannot set it again, even within its validity period. 3. An unused, valid link still sets a new password. 4. An expired link still shows the existing expired-link message. 5. The existing sign-in and password reset tests still pass.
PlanRecord the time a link is used; refuse a link that has a recorded use; add tests for each criterion
Files involvedThe reset-link handler and its tests
What must not changeThe reset email text, the link validity period and the sign-in screen
Proof of completionA test that opens the same link twice and expects the second attempt to be refused; it fails before the change and passes after
ApproverThe engineering lead for the customer portal

The agent writes the test from the proof-of-completion line and shows it failing, then implements the change. Suppose the reviewing model points out that criterion 2 must also hold when two requests with the same link arrive at the same moment. That finding goes back to the same workspace, a test for it is added, and the next review re-checks it. The engineering lead then approves the exact version, checking the five criteria against the tests and the review findings.

Download the template

agent-ready-task-template.csv has one row per field, a column saying what to write, the synthetic example above, and who writes and who checks each field. The rows are generic, with no real names. Adapt the fields to your own process; the layout is editorial and is offered as a starting point.

Where to read more

The note on managing AI coding agents in a team puts the task into the whole cycle of one change, and Building bank-grade software with AI agents maps each step to a control. For the tracker side, see an issue tracker for AI coding agents and the Pync platform page. The glossary entry on human-in-the-loop approval explains the approval pattern in general.

Frequently asked questions

What makes a task ready for an AI coding agent?
One outcome, acceptance criteria written as checks that are either true or false, the files involved, what must not change, and the test that will prove completion. If a person can check the result against the task without asking the agent what it meant, the task is ready.
Who should write the acceptance criteria?
A person decides what is built, so a person writes or approves the criteria before work starts. An agent can draft them. At Finray, engineering tasks are recorded in Pync with their acceptance criteria and a plan before the work starts.
How big should a task for an AI agent be?
There is no reliable number. A practical test is that the task has one outcome a person can see working and check in a single review. If the criteria describe two separate results, split the task.
Should an AI agent close its own task?
The decision that the work is done belongs to a person. In Finray's path, a different AI model family reviews the change first, and then a person approves the exact version that was reviewed and tested. Any later change restarts review.
Why write a failing test before the code?
A test that fails before the change shows that it can detect the missing behaviour, and the same test passing afterwards is the evidence that the criterion is met. Finray writes the failing test first and then has an AI agent implement the change in an isolated workspace.

Sources

Read next

Discuss how this applies to your institution with the Finray team.

Book a briefing

All notes

Certificate of Registration NQA · UKAS Management Systems
ISO/IEC 27001:2022 Certificate of Registration issued by NQA to Finray Technologies Ltd, certificate number 215646, valid 21 October 2025 to 21 October 2028
Search
Type to search across Finray, products, company, and journal.

    Press Esc to close · ↵ to open the highlighted result.

    Book a briefing Step 1 of 3

    What you need

    Which platforms are in scope.

    For example a licence application, an audit or a ledger build-out.

    What happens after you book

    • A team member will respond within one business day with availability windows.
    • Corebanq runs as Cloud SaaS, Private SaaS or an Enterprise Licence.
    • After the briefing, the full Corebanq and XZiel API references are issued with test-environment access.
    • Due-diligence documents, such as a summary of the April 2026 independent penetration test, are available under NDA.