Dayward AIWeChat Mini Program
Build Your Own Coding Agent in 21 Days
Week 2 · D13🔒 LockedAbout 4 hours

Ask Before Acting: a Structured Question Tool, a Read-Only Exploration Mode, and Plan Approval

Make the agent spell things out before touching anything: implement a tool that lets the model ask structured clarifying questions, add an exploration mode that only allows read-only tools, then have it produce an approvable plan and switch back to a writable state to execute only after the user approves it.

Today's goals 0/3

Sign in to tick these off and save your progress.

Today's Goals

  1. Implement a structured question tool, and explain how it beats asking clarifying questions inline in prose
  2. Implement a read-only exploration mode, and explain its relationship to the permission rules
  3. Design the plan's output format and approval flow, so approved execution can be checked against it

Yesterday solved what to do when the desk is full; today solves putting less on it in the first place. When you finish, scroll back up and tick the three goals off.

Plain-Language Walkthrough

Say how you will do it, then do it

The new hire can do everything now. So you hand them something: "make divide safer when the divisor is zero." Half an hour later they report it is done. You look: they changed the tests.

They did nothing wrong — "safer" has two readings: throwing is one, returning null and letting the caller decide is another. Under their reading, changing either side turns the tests green.

Rework's cost is not in changing code, it is in re-reading what they changed and pushing them back. And that half hour could have been saved by one sentence: "do you want it to throw, or to return null?"

So today does one thing: make it spell things out before acting. In three parts:

  1. Ask when asking is warranted. Give it a question tool, and force it to work out the available approaches before asking.
  2. Explore read-only first. During exploration nothing may change; write tools and commands are held at the door.
  3. Submit an approvable plan. Which files change, how it is verified, what the risks are; it acts only after you approve, and after approval its work is checked line by line.

The third part is most often built as decoration — many stop at "the model outputs a plan and the user presses enter." What makes the mechanism meaningful is the last half: execution after approval must be checkable. A plan nobody checks afterwards is the same as no plan.

Sign in and link WeChat to read

Sign in, then link your WeChat mini program account on the account page. Linked accounts share one free article per day. Unlock additional articles with rewarded videos in the mini program.

Mini program QR code

Scan in WeChat to open Dayward AI. Open the same course and chapter, choose the rewarded video, then refresh this page after completion.

Interview questions

  • When should an agent stop and ask the user a question? What does asking too much cost, and what does never asking cost?什么时候 Agent 该停下来反问用户?问得太多和不问各有什么代价?
    Common in ChinaCommon overseasBasic#clarification#human-in-the-loop

    🔒 Unlock this chapter to see the answer keys.

  • How would you implement plan mode, and what is its relationship to the permission system?计划模式怎么实现?它和权限系统是什么关系?
    Common in ChinaCommon overseasIntermediate#plan-mode#permissions

    🔒 Unlock this chapter to see the answer keys.

  • After a plan is approved, how do you ensure the execution did not drift from it?批准了一份计划之后,怎么保证执行没有偏离?
    Common in ChinaCommon overseasDeep dive#plan-verification#drift-detection

    🔒 Unlock this chapter to see the answer keys.

Comments