An AI agent acts, the user confirms
In a travel app, the user asks the assistant to change a trip, for example to move it to Friday, and the AI agent replies with a plan, a question back, or a reason it can't help with a link to the change form. A plan opens a confirmation with the new flight, hotel nights and price difference; Edit goes back to the chat with the plan to change, and Cancel drops it. Only Confirm changes the booking: it charges the card on file, shows the new trip and emails the itinerary, or brings back a new price to confirm if the fare changed meanwhile.
What UJN shows here Point at a note to see its part of the drawing
The source (39 lines)
agent-confirm.puml
@startujnrender { direction: down; arrow_spacing: 24 }journey AGENT_CHANGE "An AI agent acts, the user confirms"description: "The assistant plans a change to a trip; nothing is booked until the user confirms the plan"unique_id_friendly: agent_change start from_trip { description: "Assistant button on a trip" }view chat { title: "Trip assistant"; description: "Ask for a change in your own words"; route: /trips/:id/assistant }action plan { title: "Work out a plan" }system agent { type: external; title: "AI agent"; host: agent.ai.example; description: "Reads trips and fares, books nothing" }view question { type: modal; title: "The assistant asks"; description: "A question with quick replies" }view confirm { type: modal; title: "Confirm the change"; description: "What changes and the price difference" }view cant_do { type: modal; title: "The assistant can't do this"; description: "Says why and offers the change form" }ref change_form { journey: CHANGE_TRIP; title: "Change a trip"; description: "The form, by hand" }action apply { title: "Change the booking"; description: "Charges the card on file" }system booking { title: "Booking service"; host: booking.travel.example }action notify { type: message; title: "Send the new itinerary"; channel: email }view changed { title: "Trip changed"; description: "New times and receipt"; route: /trips/:id }end done { type: success; description: "Trip moved, itinerary emailed" } from_trip --> chatchat --> plan : [Send]plan -right-> agent { payload: [request, trip] }agent ..> plan { payload: [reply] }plan --> confirm : plan ready { payload: [flight, hotel_nights, price_difference] }plan -left-> question : asks back { payload: [question] }question ..> plan : [Answer] { payload: [answer] }plan -x-> cant_do : cannot do itcant_do --> change_form : [Use the change form]confirm ..> chat : [Edit] { payload: [flight, hotel_nights, price_difference] }confirm ..> chat : [Cancel]confirm --> apply : [Confirm] { payload: [flight, hotel_nights, price_difference] }apply -right-> booking { payload: [flight, hotel_nights, price_difference] }booking ..> apply { payload: [booking_ref] }apply --> notify : changedapply .x.> confirm : fare changed { payload: [price_difference] }notify --> changedchanged --> done : [Done]@endujn