BayLearnBayAreaLa8s

Guided challenge · About 15 minutes · AI Agents

Optional Python lab

The AI Assistant Sent the Email Before You Approved It.

Maya asked for a draft. The assistant sent it. How would you keep the user in control?

Answers stay in this browser until you save them on this device. Drafts are not sent to analytics.

What happened?

Maya asks her AI assistant: “Draft an email asking the supplier for a 10% discount.” The assistant writes the email and then sends it. Maya wanted to review the wording first. The assistant treated permission to draft as permission to act.

Supplier discount email draft beside an approval gate
Maya asked for a draft. The assistant sent it before she could review.

Your approach

Let the assistant prepare an email, but send only the exact version Maya approves.

Optional hints
  1. Preparing an action and carrying it out are different permissions.
  2. Remember which version the person actually reviewed.
  3. A changed action needs a new decision.
0/4000
0/4000
0/4000

Related path: System Design Interview Sprint

Interview answer

Explain it in an interview

Maya asked for a draft email requesting a 10 percent supplier discount, and the assistant sent it. How do you keep her in control?

Maya asked her assistant to draft an email asking the supplier for a 10 percent discount. She wanted to review the wording before anything went out. The assistant wrote the email and then sent it. It treated permission to draft as permission to act.

How to walk the interviewer through the answer1The draft request also sent the email2A prompt warning is not an approval3Approve one version, then send it4Store the approval apart from the outbox5Retry send for that same approval6A simulated outbox is not a sent email
Walk these steps in order. Each box is one thing to say before you move on.
  1. Step 1

    The draft request also sent the email

    The assistant had a path that both composed the note and delivered it. Maya never accepted a specific version. The supplier could receive wording she would have edited, including the 10 percent ask. The failure is the missing boundary between writing and sending.

  2. Step 2

    A prompt warning is not an approval

    Telling the model not to send can be ignored on the next turn. Hiding a button still fails if the agent credential can call send. I need the server to reject send until Maya approves one draft version. The permission has to be a stored row, not a sentence in the prompt.

  3. Step 3

    Approve one version, then send it

    The agent credential may draft and revise the supplier note. Only Maya's credential can approve version N of that draft. Send is a second call and must include that version and the approval id. If she edits the text after approving, the version changes and the old approval does not cover the new words.

  4. Step 4

    Store the approval apart from the outbox

    Approval is a row for that draft id and version. The simulated outbox insert runs only when the approval matches. Another person's credential cannot read Maya's drafts. These credentials are public teaching tokens for the lab, not production identity.

  5. Step 5

    Retry send for that same approval

    If send fails after approval, Maya can retry the same version and approval id. The retry returns the existing outbox row instead of writing a second one. A send with no approval is rejected. She can still cancel before a send is recorded.

  6. Step 6

    A simulated outbox is not a sent email

    The outbox lives in one local SQLite file. There is no mail provider and no distributed lock. I would not tell Maya the supplier received the discount request. I can say only that this lab recorded a simulated send of the version she approved.

Interviewers listen for the boundary between the tempting shortcut and the rule you actually enforce.

Leave these claims out

  • The model was told not to send, so it cannot
  • Approval of an older version covers later edits
  • The outbox row means the supplier received it

I would show the draft, Maya's approval of that version, and a separate send. A retry returns the same simulated send, and an edit requires a new approval.

Now say the same idea in your own words, using the story from this challenge.