DEV Community

Cover image for From Kathmandu to Junction: we built a door AI agents can't sneak milk through
Shuvam Pandey
Shuvam Pandey

Posted on AI-assisted

From Kathmandu to Junction: we built a door AI agents can't sneak milk through

In Valio Aimo's product file, 1,485 of the 4,178 products labelled "lactose-free" still contain milk. Both labels are correct, because lactose-free isn't milk-free. A chef knows that. An AI agent ordering at machine speed for a wedding guest with a milk allergy doesn't.

We flew from Kathmandu to Finland on a golden ticket, spent 48 hours at Junction 2026 building a door that AI agents must pass through before they can order food, and finished 11th of 105 teams in the Valio Aimo challenge. Here's what we built, what broke at 1 a.m., and what a tired mentor taught us about trust.

This is a submission for the MLH x DEV Writing Challenge

What I Built

How a team from Nepal ended up in Espoo

We won JunctionX Kathmandu, and the prize was a golden ticket to the main event: Junction in Espoo, Finland, one of Europe's biggest hackathons. We're Team 2083, named after the current year in Nepal's calendar. (Yes, we're from the future.)

On site we became four. Sandip Shrestha and I came from Nepal. Afaf Driouech and Valeria E. had made their lives in Finland, though neither is Finnish. We were a small international team with 48 hours and one problem.

The challenge

Valio Aimo supplies Finland's professional kitchens: restaurants, caterers, hotels. Their challenge, Trusted Trade Agents, asked what happens when AI agents start ordering from them. Who decides what an agent may buy? Who approves it? How does anyone trust the result?

We got the brief on Friday evening and walked straight to the Valio booth. One line from their AI lead shaped everything we built:

"There shouldn't be two milks and a carrot."

The point: when an agent asks you to choose, the options must make sense. Trust comes from the quality of what the agent shows you, not from a friendlier chat window.

Later that night we stood in a queue of five or six teams, all waiting for one mentor. The mentor told us the real users are kitchens that design their own menus, like lunch restaurants and caterers. And an empty allergen list, they said, doesn't mean "no allergens". It means "we don't know." We went back and counted. In Valio's file, 58.9% of products have an empty allergen list.

Lupa: a permission door, not another chatbot

Lupa is Finnish for permission. It sits between any AI agent and Valio, and every order goes through it. You type:

"I want catering for spaghetti bolognese for 100 people."

You can write it in English, Finnish or Swedish. Lupa prices every line live from Valio's API, shows its working (100 portions × 120 g = 12 kg of mince), keeps every diet group on its own lines, and asks for one approval on your phone.

How It Works

 any AI agent (Claude, Gemini, …)  ──MCP / OpenAPI──▶  LUPA'S DOOR  ──▶  Valio price & availability API
                                                         │
                       1. model reads the words → a typed brief (and nothing else)
                       2. code plans: packs, portions, diet groups, live prices
                       3. diet gate (code) has the last word on every line
                       4. kitchen's signed rules: agents, approvers, per-order / per-week limits
                       5. one approval on a phone → ES256 signature over the exact reasons + the week
                       6. numbered receipt, chained → checked offline in the browser, no AI involved
Enter fullscreen mode Exit fullscreen mode

The model reads, code decides. Claude only turns the sentence into a typed brief. Everything after that is plain TypeScript, so every decision can be tested, repeated and explained.

The diet gate. This is where most of our arguments ended. It's seven lines:

export function dietStanding(diet: string, product: Pick<GateProduct, "claims" | "allergens">): DietStanding {
  const req = requirementOf(diet)
  if (req === null) return "free"
  if (req.kind === "unsupported") return "unsupported"
  if (req.kind === "claim") return hasClaim(product.claims, req.claim) ? "free" : "no_claim"
  const fact = factOf(product.allergens, req.code)
  return fact === "declared_free" ? "free" : fact === "contains" || fact === "may_contain" ? fact : "unknown"
}
Enter fullscreen mode Exit fullscreen mode

Only a product that declares milk absent counts as safe for a milk allergy. "Lactose-free" is a different claim, so it can't satisfy an allergy. An empty field falls through to "unknown", never to "free". When a line comes back unknown for someone it could hurt, Lupa takes it out of the order and says why in plain words.

The kitchen signs its own rules. The manager decides which agents may order, who may approve, and the limits per order and per week. One weekly limit counts every agent the kitchen runs, from any vendor. The door recomputes it from every order it has accepted, so no agent can claim it didn't know.

One approval, cryptographically bound. The approval is an ES256 signature (WebCrypto) over the exact reasons on screen and the week's running total. Take one reason out after signing, or let the week grow past it, and the door refuses the order.

Answers leak, so the door never gives a number. Agents ask all day. If the door returned exact stock figures, an agent polling it could rebuild a supplier's daily sales. In our simulation that worked for 198 of 200 products. Lupa's door signs a band instead: covered, partly covered, not covered, unknown. The same agent could then read 42 of 200. That's smaller, not zero.

What we measured

  • The same Claude agent placed 90 orders from 30 synthetic kitchen requests. With Lupa's checks off, it broke a kitchen rule 6 times. Through Lupa: 0.
  • We tried 30 kinds of attack with valid signatures, 50 tries each: 0 of 1,500 got through. That includes two agents splitting one order to slip under the weekly limit.
  • Single-character edits of a signed order: 0 of 82,074 accepted.
  • Prompts it had never seen, scored strictly: 23–25 of 40 judge-style requests and 16 of 40 hard dishes. Not perfect, and that's the honest number.

Demo

  1. Valio's own data: the lactose-free trap, and the stock-leak simulation dropping from 198 to 42.
  2. A real request, priced live from Valio's API, with the working on every line.
  3. Approval on a phone, then the offline check: Accepted. Remove one reason: Refused.
  4. An agent connecting over MCP: the first order is placed, and the next is held because the week's limit is reached.

What It Can't Do Yet

We'd rather tell you than have you find out:

  • It doesn't place real orders. Valio has no order API yet, so an approved order is prepared with Lupa's receipt and a person forwards it.
  • The door's key is a stand-in. In production, Valio would run the door with its own key.
  • The kitchens are synthetic: the rules, approvers and order history, plus the stock-out that triggers a substitute. Valio's API was their hackathon mock, which is live but not production.
  • The stock band still leaks. 42 of 200 is better than 198, but it isn't zero.
  • The Gemini agent run was recorded, not live on stage.
  • The code is private because it works with partner data. Happy to walk anyone through it in the comments.

Partner Technologies

Google Gemini API. A permission door that only works for one AI vendor isn't a door; it's a feature. So we ran a second, independent buyer agent on Gemini, connected through the same MCP and OpenAPI interface as our Claude agent.

Then we set up the scenario Valio worried about most: two agents from two vendors, ordering for the same kitchen.

  • Each order alone was within the rules and went through.
  • Together they pushed the kitchen past its signed weekly limit, so the second order was held for a person.

Neither agent knew about the other, and neither had to. That's when the design clicked for us: safety has to live in the door, not in any one agent's prompt. Gemini also composed the score for our project film.

The rest of the stack is TypeScript, React, Hono, WebCrypto and three.js.

Hackathon Experience

Junction fills an arena in Espoo with hackers, partner booths and mentors for a whole weekend. Coming from Kathmandu, the scale hit me the moment we walked in.

What I'll keep:

  • The mentor queue on Friday night. Five or six teams lined up for one tired Valio mentor, all asking versions of the same questions. Listening to the other teams taught us as much as the answers did. It showed us what everyone else would build, and it pushed us to go deeper, not wider.
  • 1 a.m., the cut-off bug. Our app kept telling caterers their order deadline had "passed" for deliveries weeks away. Valio's availability API only answers for its earliest delivery day, and we were applying that day's cut-off to every date. Finding the real cause at that hour is oddly one of my favourite memories of the weekend.
  • A team across two countries. Half of us came from Kathmandu, and the other half had built a life in Finland. We argued about "trust" from very different angles, and Lupa is better for it.

We didn't win a prize. We finished 11th of 105 in the Valio Aimo track, on a golden ticket that started in Kathmandu. Representing Nepal in that room is something none of us will forget.

The rule I brought home and now use everywhere: let the AI propose, let code decide, and make every decision checkable by anyone.

Thank you to my teammates Sandip, Afaf and Valeria, to the JunctionX Kathmandu organisers who sent us, to the Junction crew, and to the Valio Aimo team for a challenge with real teeth. 🇳🇵 🇫🇮


A note on how this was written: I used an AI assistant to help structure and edit this post. The project, the numbers and the story are ours.

Top comments (0)