A ticket comes in: some users get logged out after about fifteen minutes, even while they're actively clicking around. You paste the stack trace and the auth middleware into an AI chat. The answer is tidy. The refresh token expires before the client gets around to renewing it, so raise the access token lifetime from 15 to 60 minutes and the problem goes away. It even explains why.
It sounds right. It might be right. The useful question before you touch the config is the old one: how do we know?
A clean answer is still a claim
Checking an AI answer has nothing to do with distrusting AI. It's the same thing we already do with each other's work. We merge a teammate's code because it's tested and reviewed, even when we think they're brilliant. We run a migration after a dry run and with a rollback plan, however clean the SQL looks.
Simon Willison put it in one line in December 2025: "Your job is to deliver code you have proven to work." He's direct about the reason, too: "If you haven't seen the code do the right thing yourself, that code doesn't work" (Your job is to deliver code you have proven to work). An AI answer is a draft of that proof. You still have to run it.
Size the test to the cost of being wrong
Not every answer deserves a staging run. If AI rewrites your meeting notes, reading it against the original is enough. If it tells you an index will fix a slow production query, you want the query plan on real data before anyone ships it. The rule of thumb: the test grows with the cost of being wrong.
| What the AI claimed | If it's wrong | Smallest test that could catch it |
|---|---|---|
| A rewrite of your notes or a summary of a doc | A misquote, a lost detail | Read it next to the source once |
| How a library or API behaves | Code built on a method that doesn't exist in your version | Open the official docs or changelog for the version you run |
| "Install this package" | You install a name someone registered to catch exactly this mistake | Check the registry page, the repo and the maintainer before you install |
| A bug diagnosis | Half a day fixing the wrong layer | Reproduce it, then write a test that fails for that reason |
| A performance fix | Slower writes, same slow reads | Run the query plan on production-shaped data, measure in staging |
| Anything touching money, auth or personal data | An incident | All of the above plus a second human reviewer |
The package row deserves a moment. In a study presented at USENIX Security 2025, researchers generated 576,000 code samples with 16 models and found that the average share of suggested packages that don't exist was at least 5.2% for commercial models and 21.7% for open-source ones, with 205,474 unique made-up names (Spracklen et al.). An attacker only needs to register one of those names. Checking a package page takes thirty seconds.
The test has to happen outside the model
"Are you sure?" is a fair thing to ask a model. It's not a test. Researchers have tested this directly: when models tried to correct their own reasoning with no outside feedback, they struggled, and sometimes the answer got worse after the "correction" (Huang et al., ICLR 2024). The model tends to restate the same plausible pattern, often more confidently.
Asking the model to list its assumptions is still worth doing, because it tells you what to check (there's a whole post on that: asking AI to name its assumptions). The checking itself has to come from somewhere the model can't reach: your logs, your data, the docs for your exact version, the person who owns the business rule.
A three-step habit
Here's how that plays out with the logout ticket.
- Name the claim in one plain sentence. "Users get logged out because the refresh token expires before the client renews it."
- Name what breaks if it's wrong. If you raise the token lifetime and the cause is something else, users still get logged out, and you've also made stolen tokens useful for four times longer.
- Pick the smallest test that could prove the claim wrong. Pull the token timestamps for a few affected sessions from the logs. Reproduce the flow in staging with a short lifetime. Write a test around expiry that fails today.
Now say the logs show something the chat never saw: the affected users all had two tabs open. Both tabs refreshed at the same moment, the server rotated the token twice, and the slower tab ended up holding a token that was already revoked. The AI's fix would have hidden that for a while. The actual fix is to share one refresh between tabs, and the failing test you wrote in step 3 now has a better name.
Willison has a good check for that last step: the test "should fail if you revert the implementation." If it still passes without your fix, it isn't testing the claim.
Leave a trace for the team
Verification gets lighter when it's part of the workflow, so nobody has to remember it alone. A few lines in the PR description go a long way:
AI-assisted: diagnosis + first draft of the fix
Checked: token timestamps for 6 affected sessions (logs),
reproduced in staging with a 1-minute lifetime
Tests: added concurrent-refresh test (fails on main)
Not sure yet: behavior on Safari with storage partitioning
Your reviewer now knows where to look and what you didn't get to. The same idea works outside code. A product note can keep AI-drafted options apart from what customers actually said. A support macro can link the source paragraph behind a suggested reply.
There's a bonus. When you test an answer, you learn which assumption held and where the real boundary of the system sits. Skip the test and you get the task done without the understanding, which makes the next bug in the same area harder.
Try this week
- Next time you act on an AI answer, write the claim down in one sentence before you change anything.
- Use the table above to pick the test size. Money, auth and personal data always get the big one.
- Before installing any package an AI suggested, open its registry page and repo.
- Add an "AI-assisted / checked / not sure yet" note to one PR and ask your reviewer if it helped.
Testing tells you whether an answer holds. Why the polished ones are so easy to wave through is its own story: the cost of trusting a fluent AI answer.