Case study · own product · multi-tenant SaaS

URnexusthe agent uses the same tools as the interface

URnexus is a social publishing platform where the assistant is not a chatbot bolted onto the product: it acts through the same action catalog as the interface's buttons, and the same one used by the MCP connector that lets you operate the platform from an external assistant. One capability declared once, exposed three times.

Role
Product design, UX/UI, development, operations
Context
Own product, in production
Stack
Payload 3 · Next 16 · PostgreSQL · R2
Isolation
17 assertions on the real API
3surfaces, 1 catalogUI · agent · MCP
1,030test cases80 files
12end-to-end tests on the real APIHTTP, no mocks
5languagesfr · en · es · de · it
URnexus dashboard: assistant block on the left with suggested actions, three quick-action cards, monthly quota bar (publications, AI credits, carousels), lists of upcoming publications and drafts to finish.
The dashboard. The assistant sits in the left column with suggestions that are real catalogue actions.

Visit yournexus.fr ↗Explore the tool ↗The site and the tool page, live.

The problem

A bolted-on assistant ends up lying

The common way to add AI to a product is to wire a chat window to a dedicated API written for it. Two code paths then exist for the same capability: the one behind the buttons, and the one behind the assistant.

The cost of duplication

A business rule added on the interface side — a quota, a validation, a forbidden state transition — does not exist on the assistant's side, which keeps accepting what the product refuses. The user gets a confirmation for an action that never happened, or worse: it happens while bypassing the rule.

On a multi-tenant product

The same duplication reaches isolation. Every new route written for the assistant is a chance to forget the filter that stops one tenant from seeing another's data.

The stance taken: declare capabilities once, in a dependency-free module, and route all three surfaces through the same executor.

The structural decision

One action catalog, three consumers

The catalogue describes every action: its name, its input schema, the allowed roles, and its effect class. It is a pure module — no database, no network, no framework import — so it's exhaustively testable without any infrastructure.

Interface

The product's buttons

Buttons and forms call the shared executor. What the user sees is exactly what the catalogue declares.

Embedded agent

Present on every screen

The assistant receives the catalogue as its tool list. It cannot do anything that is not declared in it.

MCP connector

8 tools, one key per tenant

Exposed to an external assistant, with one key per user. The customer drives their platform from their own assistant.

↓ all three go through the same executor, with the same permission and quota checks ↓

What this actually changes. Adding a capability to the product means one entry in the catalog — and it instantly shows up in the interface, in the assistant and in the connector. Adding a business rule means a single place to change. None of the three surfaces can drift from the other two, because none owns its own write path.

The guardrails

Not all actions are equal

An agent that acts needs to be told where to stop. Every action in the catalog carries an effect class, and it is this class — not the model, not the prompt — that decides whether human confirmation is required.

Effect classConfirmationExample
lectureNever, no cost to logViewing publications, reading quotas or the brand guidelines.
ecriture_interneNone — reversible, no outward commitmentSaving a draft, capturing an idea.
effet_externeMandatory — the effect cannot be undoneScheduling a post, spending generation credits.
  1. No delete action, on any of the three surfaces

    An assistant that gets an ID wrong would destroy unrecoverable work. The capability simply isn't declared — it's not a safeguard that can be bypassed, it's an action that doesn't exist.

  2. No immediate publishing, only scheduling

    Publishing on a customer's behalf from a misunderstood instruction is public and irreversible. Scheduling stays allowed: it is a dated draft, reviewable and cancellable before the real send.

  3. State transitions are controlled, and the agent can't bypass them

    A post does not go from draft to published: it goes through scheduled then in progress. A published post never reverts. These rules live in the domain layer, so they apply to the agent exactly as they do to the button — verified by attempting the shortcut, which is refused.

  4. Credits are counted in credits, not images

    The cost of a generation varies sixfold depending on the model: a fast image costs 1 credit, a high-resolution one costs 6. Exposing a quota "in images" would have made billing unreadable at the very first model change.

The product

The assistant is a block, not a panel

A design decision held across the whole product: every screen is a grid of movable blocks, and the assistant is one of them — in the same place on every screen. It does not pop out of a side drawer on some pages and vanish on others: it is always there, in the same spot, which is what makes it a working tool rather than a feature you go looking for.

How I know

Unit tests don't prove isolation

On a multi-tenant product, the question that matters isn't “is my code correct” but “can one customer see another's data.” That question can't be verified with a unit test, where both sides of the comparison are written by the same hand.

Every isolation boundary is therefore tested against the real API, over public HTTPS, authentication and access rules included: 17 assertions covering cross-customer reads, direct access by ID, and privilege-escalation attempts. All pass.

One design detail shows through: access to another tenant's resource returns 404, not 403. Returning “forbidden” would confirm the resource exists, turning the API into a directory of customers.

17isolation assertionson the public API
18collections+ 28 migrations
46API routes1 shared executor
182AI test casesagent, MCP, copywriting
Payload 3Next 16React 19TypeScriptPostgreSQLCloudflare R2StripeMCPSatori + resvgGeminiUnipilesystemd
Takeaways

What this project taught me

Declare a capability in one place, never duplicate it

The hard part of an agent-based product is not getting a model to answer: it is deciding what it is allowed to do, writing that in one place, and proving it cannot step outside it. Three quarters of the useful work sits in the action catalogue and the effect classes — not in the prompts.

The effect class must decide, not the prompt

Leaving the decision to ask for confirmation to a language model is fragile: a prompt can be talked around, a domain rule cannot. Moving that decision into a declarative property of the action makes it verifiable independently of the model in use.

Isolation is proven on the real API, not in a unit test

A unit test where both sides of the comparison are written by the same hand cannot reveal a forgotten filter. Only a suite that hits the public API, with real customer accounts, answers the question that matters on a multi-tenant product.

Delivered

  • Single action catalogue, shared by the UI, the agent and the MCP connector
  • MCP connector, key per user, 8 tools exposed
  • Effect classes governing human confirmations
  • Carousel generation via Satori + resvg
  • 1,030 test cases, 17 isolation assertions on the real API
  • Interface in 5 languages

The product runs continuously: yournexus.fr/outil.