The interface and the AI pass through the same door: the AI can never exceed the permissions of the person using it — it drafts, but never applies without approval.
The AI Gets No Permissions of Its Own — Only Yours
The most dangerous shortcut in AI-assisted products is opening a separate "super user" path for the model. We do the opposite: every operation has exactly one definition — one schema, one permission, one risk level, one handler. A button in the interface and a tool the AI calls go through the same registry.
Authorization does not care whether the caller is a human or the AI; the AI inherits exactly the permissions and branch scope of the person using it. A risk gate sits on top: reads are free, writes require human approval, critical operations never run autonomously. The approval card carries a hash of the preview it shows, expires, and can be confirmed only by the person who asked.
Identity never comes from the model either. User and business identity are resolved from the server-side session; tool schemas cannot contain identity fields, and a test breaks the build if that rule is ever violated. In the database, every business table is protected by PostgreSQL row-level security (RLS) — even a faulty AI query cannot reach another business's data.
How It Works
- Single door: one operation definition for both UI and AI
- AI as the user's mirror: same permissions, same data scope
- Risk gate: reads free, writes approved, critical never autonomous
- Hashed, time-limited, requester-bound approval cards
- Identity from the session; identity fields banned from tool input
- Business isolation in the database: forced RLS with a coverage test
Why It Matters
Two doors eventually produce two truths: the rules for the same operation quietly drift apart between the interface and the AI. A single door makes that architecturally impossible — change a rule, and it changes for humans and AI alike.
Where We Use It
Operations across Motice's 21 domain modules — bookings, packages, sales, payments — run through this single door, whether triggered from the panel or from Ask Motice.
Bring this technique into your product
Talk to our team about building the same approach into your own system.
Get in Touch