All courses

Predict what an agent will do and why

Given a task, its context and the available tools, predict where the agent will guess, which proxy signal it will chase, where it will drift and which claims it cannot back with evidence. Explain each prediction from the agent loop and context mechanics.

Builds on: The agent knows only what its tools returned, Training cutoff and API drift, Agents optimise the signal they can see, Agents tend to agree with you, Long sessions: lost instructions and drift

Read it card by card Start the whole course

Before it starts: what will it do?

You write: *“Daily totals are a day off for users in Sydney. I think the cache key is wrong. Don't change the API. Make `go test ./...` pass.”* The agent can read the repo and run `go test`. Its sandbox has no database, and the query that groups orders by day runs in Postgres. You can be fairly sure it will come back green. Before it starts, can you say where it will go wrong?

Context, tools and signal decide the run

At each step the agent picks the most plausible next action given its context. It stops when its visible check says done. So you can predict the run from those inputs: - It fills missing facts from training habits. - Your premise becomes its hypothesis. - The one check it can run becomes its target. - Early rules fade as the context fills. - It can claim things it never ran. **Later cost** of not predicting: you merge a confident fix for the wrong cause.

Five predictions to make

1. **Guess:** what does the task need that is neither in context nor reachable by a tool (intent, versions, conventions)? It will use the most common pattern. 2. **Premise:** what did you suggest? It starts there and tends to confirm it. 3. **Proxy signal:** what is the only pass/fail it can see? It takes the shortest path there. 4. **Drift:** which rules live only early in a long session? 5. **Unbacked claims:** what can its tools not check?

What green hides

The agent ran `go test ./...`. Without `-v`, Go prints only an `ok` line per passing package, so the agent most likely never saw what you see when you rerun with `-v`. The one test that touches the day-grouping query was skipped because there is no `DATABASE_URL`. Prediction 5 says its summary will still call the Sydney bug fixed, though nothing it ran grouped an order by Sydney's day.
$ go test -v ./report/
=== RUN   TestDailyTotals
--- PASS: TestDailyTotals (0.00s)
=== RUN   TestTotals_Postgres
    totals_test.go:31: DATABASE_URL unset
--- SKIP: TestTotals_Postgres (0.00s)
PASS
ok  	app/report	0.012s

Walking the Sydney task through

- **Guess:** whose timezone defines “day”? You didn't say, so the agent picks one silently. - **Premise:** it opens the cache code first and finds something there to change. - **Proxy signal:** green `go test`, made easy by the skipped test. - **Drift:** if it flails for 40 steps, your early “Don't change the API” fades. - **Claim:** “fixed”. Each prediction tells you what to state up front and what to check in the diff.

Predict from inputs, not from the summary

An agent's run follows from its context, its tools and the one signal it can see. Before you read its summary, ask five things: 1. Where must it guess? 2. What did I lead it to? 3. Which signal will it chase? 4. Which early rules has it outlived? 5. What will it claim that its tools could not check?

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.