Task framing for agents

How to turn an idea into a request the agent can carry out and you can review: goal, context, boundaries, expected result, and how to know it is done.

Key idea: the agent cannot read your mind. Before you ask for something, decide what you want to achieve, what must not change, and how you will check that it is right. If you don’t know, the agent doesn’t either.

The problem

Ask “improve the reading utility and add tests” and the agent has to guess almost everything: what “improve” means, which files it may touch, whether it can add dependencies, or how many tests are enough. Sometimes it guesses right. Other times it returns something reasonable that solves a different problem, changes more files than needed, or says it is done without anyone being able to check.

Framing the task means making those decisions yourself, before starting, instead of leaving them to chance.

How it works

A good request answers five questions:

Part Question Example
Goal What result do I want? “Add summarizeReading to src/reading.js.”
Context What does it need to read or know? “Read the README and the src/ folder before editing.”
Boundaries What must it not do? “Do not add dependencies or change the README.”
Expected result What shape does the output take? “Return wordCount and firstSentence.”
Acceptance criteria How do I know it is right? “Three tests that pass with node --test.”

You don’t always need these exact headings. What matters is that no essential decision hides behind a vague phrase like “do it well”. If a requirement can’t be checked, rewrite it until it can: “make it fast” becomes “process a 1 MB file in under one second”.

Acceptance criteria are the most important part and the one most often forgotten. Besides helping you review, they give the agent a way to check its own work before it says it is done.

Practical example

A vague request:

Improve the reading utility and add tests.

The same request turned into a task:

## Goal
Add the summarizeReading function to src/reading.js.

## Context
Read README.md and the files in src/ before editing.
The existing countWords function must keep working the same way.

## Boundaries
Do not add dependencies or modify README.md.

## Expected result
summarizeReading takes a text and returns { wordCount, firstSentence }.

## Acceptance criteria
- At least three tests that pass with `node --test`.
- Cases covered: empty text, repeated spaces, and sentences
  ending in "!" or "?".
- Before finishing, review the diff and say which checks you ran.

This does not guarantee that the agent gets it right. But if it fails, you will know exactly which requirement was not met and can fix the request or the code precisely.

Common mistakes

  • Asking for the “how” instead of the “what”. Describe the result and the boundaries; let the agent propose the implementation unless you have a reason to impose one.
  • Forgetting the boundaries. If you don’t say “don’t touch X”, the agent may touch X with the best of intentions.
  • Criteria that can’t be checked. “Keep the code clean” can’t be verified; “pass the linter with no warnings” can.
  • Huge requests. A task that covers ten different changes is hard to review. Split it into steps you can check one at a time.
  • Turning every question into a form. A quick question needs one sentence. This structure pays off when the task changes code or has visible effects.

When to use it

Whenever you ask for an implementation, a review, or a change with effects. If you find yourself repeating the same context or boundaries in every request, that is a sign the information should live somewhere permanent: that is AGENTS.md.

Next step

You now know what to ask for. The next step, Context engineering, is about what information the agent needs to do it, and how much is too much.

Sources

Accessed on 2026-10-05.

  • Context engineering for agentsTechnique

    What information the agent receives at each moment, why more is not always better, and how to give it just enough: the essentials up front and the rest when it needs them.

    Published
  • Verification and evaluationTechnique

    How to check that the agent did the job right without taking its word for it: give it ways to verify itself, review both the result and the process, and compare setups honestly.

    Published