Cartwise
A shop that accepts its customers' own AI agents: an agent signs its user in, shops within the session that the shop verified, and the customer can end it.
ApplicationDraft
This page is a draft. The code exists, and not all of it has been run for this page yet. The page says what was checked. The code is in
server/examples/poppy today.Scenario
A customer tells their personal agent: "Order more coffee from Example Shop." The agent has never seen this shop. It reads the shop's discovery document, signs the customer in, and receives a session. Each request of the agent carries that session, and the shop verifies it before it shows an order or takes one.
People and agents
| Who | Role in the application | Identity in LumoAuth |
|---|---|---|
| Customer | Owns the personal agent. | A user of the shop. |
| Personal agent | Shops for the customer. | A client that identifies itself with a metadata document. Not registered in advance. |
| Example Shop | The Company of the protocol. | The organization, with the protocol turned on. |
Flows
| Flow | What happens | What LumoAuth does |
|---|---|---|
| Discover | The agent reads poppy.json on the shop's domain. | Built the document. The shop serves it. |
| Sign in | The customer signs in, directly or with a code on a phone. | Hosted sign-in, then a session for this agent and this customer. |
| Shop | The agent lists orders and places one. | The shop sends the session header to LumoAuth and receives the verified agent, customer and account. |
| Tasks | The agent asks what it can do here. | Serves the task list. |
| End | The customer ends the session on the account page. | The next request of the agent is refused. |
Parts
| Part | Built with | Job |
|---|---|---|
| Shop API | Express, poppySession() | Orders, behind session verification. |
| Test agent | Node.js | A personal agent for the walkthrough. |
What the seed script creates
- The protocol turned on.
- A confidential application with the scope
poppy:verify. - A test customer.
Walkthrough
- Start the shop.
- Run the test agent, and sign in as the customer.
- Place an order.
- End the session, and run the agent again.
Before you run it
- Mediated Sign-In and a hosted conversation endpoint are not available.
- LumoAuth does not enforce a spending limit for each customer. The shop decides what a session may buy.
Where the code is today
company.mjs and personal-agent.mjs in the folder examples/poppy of the server repository. The catalog version uses the SDK helper for verification.