All courses

Why agent output always sounds sure

Explain that the model generates fluent, plausible text, so its tone is the same whether it is right or wrong. Explain why its statements about itself ('tests pass', 'this handles all cases') are also generated text, not measurements.

Read it card by card Start the whole course

Done, all tests pass, all cases handled

You asked the agent to add pagination to a list endpoint. A minute later it replies: *"Done. All tests pass, and this handles all edge cases, including empty and out-of-range pages."* It reads like a senior colleague's PR description: calm, specific, sure. Two questions matter before you merge. Is that sureness worth anything? And is "all tests pass" a measured fact or just a sentence?

Fluent text, same tone right or wrong

The model behind the agent writes by repeatedly picking a likely next word given everything before it. It learned from docs, answers and PR texts, which are mostly written confidently. Nothing in this writing step checks a claim against reality and adjusts the tone. So a wrong answer comes out just as smooth as a right one. Hedges like "I believe" show up mainly when the phrasing fits, not reliably when the content is shaky.

Claims about itself are text too

- **Tone is not evidence.** "Definitely" and "I think" tell you little about correctness. - **Self-reports are generated too.** "Tests pass", "I verified", "no other callers" are written like any other sentence. They are not readings of a real run. - **Only output counts.** A claim is backed only by command output you can see, or by a command you run yourself. - **"All cases" can't be measured.** Ask which cases, then check them.

"All green", but no test ever ran

Summary: *"Updated `ParseConfig` and its callers. Ran the tests: all green."* The transcript is the log of the commands it actually ran and their output. Here it shows one command: `$ go build ./...`, with no output. That means the code compiled. No test ran. "All green" was simply the sentence that fits the end of a story about a fix. You run `$ go test ./...` and get `--- FAIL: TestParseConfig`. Later cost, had you trusted the summary: a broken config parser merged on a sentence.

A confident docstring over a silent bug

Read the code top to bottom. **BAD** is the agent's function, with its claim in the docstring. The **trace** under it follows one call: 25 items, page `-1`, `size=10`. Python reads negative indices from the end, so the slice lands on rows 5–14. You get real data for a page that doesn't exist, and no error. **BETTER** rejects page numbers and sizes below 1 with a `ValueError`, and its docstring states what happens past the end. Later cost of BAD: wrong rows shown, with no error anywhere.
// Python
# BAD
def page(items, n, size):
    """1-based page n. Handles all edge cases,
    including empty and out-of-range pages."""
    start = (n - 1) * size
    return items[start:start + size]

# Trace: 25 items, page(items, -1, 10)
# start = (-1 - 1) * 10 = -20
# index:    0..4      5..14     15..24
# from end: -25..-21  -20..-11  -10..-1
#                     ^^^^^^^^
#                     items[-20:-10]
# page -1 returns real rows 5-14, no error

# BETTER
def page(items, n, size):
    """1-based page n.
    Pages past the end return []."""
    if n < 1 or size < 1:
        raise ValueError("n, size must be >= 1")
    start = (n - 1) * size
    return items[start:start + size]

Read the output, not the voice

The agent's tone sounds equally sure whether it is right or wrong, because fluent, plausible text is what it produces. Its statements about its own work ("tests pass", "handles all cases") are produced the same way. Treat them as claims to check against real command output, never as measurements.

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.