AI Enable Kit
ExperienceIntegrationControl
Sign inSign upAI Developer Hub
ExperienceIntegrationControlSign inSign up
Free Ebook · The Production Edition

The Hidden Complexity of Building AI Assistants

The Production Edition · 2026 · 12 chapters

What every developer should know before going to production — a practical field guide to secure, observable, production-ready AI assistants, for the developer who shipped the demo and now has to run it.

A working demo is only the visible part

A developer can wire an LLM to a few endpoints and ship a chat box in an afternoon. The part that takes months is everything the demo never shows — and it is all below the surface.

Building an AI chatbot is easy. Building one you can trust in production is a different story. This guide walks the whole iceberg, one chapter at a time.

The production iceberg — the shape of this guide.

The twelve chapters

Each one stands on its own — read it as a chapter, a post, or a checklist item.

01The illusion of a working AI botFraming02Your AI bot is a new attack surfaceSecurity03Your LLM knows too muchData04Who is really making that API call?Identity05You’re flying blindObservability06Your bot could become a financial liabilityCost07When AI stops talking and starts actingActions08How do you know it’s doing a good job?Quality09Designing for productionArchitecture10Build it or integrate it?Build vs buy11Putting everything togetherIntegration12Are you ready for production?Checklist
01The illusion of a working AI botFraming

It demos beautifully. That is the problem.

A prototype proves the idea works once, for you, on a happy path. Production means it works every time, for everyone — including the user who asks the question you never imagined.

The first version always feels like magic. You connect a model, expose a couple of endpoints, drop in a chat window, and it answers. The demo lands. Everyone wants it shipped.

Then the real questions arrive. What happens when a user asks for data that is not theirs? When the model calls the wrong tool five times in a loop? When one enthusiastic account quietly runs up a four-figure monthly bill? When someone pastes instructions into a field hoping the assistant will follow them instead of you?

The gap between “it answered” and “I can run this” is most of the work — and none of it is visible in the demo.

What the demo has
  • A model that answers on the happy path
  • A few endpoints wired straight through
  • A chat window that looks the part
  • One person testing — you
What production needs
  • Authorization the model can never overrule
  • Sensitive fields masked before they reach the model
  • Every call, token and dollar traced per user
  • Caps, confirmations and alerts when things drift
02Your AI bot is a new attack surfaceSecurity

The moment you add a bot, you add a new way in.

A chat box is an open prompt into your data. The question is whether the assistant can do more than the person typing — and who gets to decide that.

Scenario — unauthorized access. A sales rep opens the assistant and asks for something they could never pull up on screen. In a naïve build, the model is helpful to a fault: it has an endpoint, so it calls it, and reads the answer aloud.

Exposed
Show me the salaries of everyone in the company.
Sure! Here is the full payroll:A. Rivera $142,000
J. Okafor $128,500
M. Chen $96,750 …
GET /api/salaries → 200 OK · no one checked who was asking
Enforced
Show me the salaries of everyone in the company.
You do not have permission to see that. I can only reach what your account can.GET /api/salaries → 403 · enforced by your API
Lesson

Never let the model decide who is allowed. The call runs with the user’s own credentials; your API answers 403 exactly as it would on screen.

How AI Enable Kit approaches it

Authorization stays where it already lives — in your application. The assistant never holds your users’ credentials and never calls your API directly.

Acts as the signed-in userEvery call into your data is made by your own backend, with that user’s credentials. The bot can never do more than the person using it.
Only endpoints you registerEach endpoint you allow becomes one tool; the model can call nothing else, and undeclared arguments are dropped before the request is built.
Your 403 is the answerA refusal or timeout comes back as text the model explains. Your authorization decided — nothing had to be re-implemented.
Writes wait for a yesAny action that changes data is withheld until an explicit confirmation step; the request is never released until the user confirms.
03Your LLM knows too muchData

Your API returns more than the model should ever see.

Just because an endpoint returns a field does not mean the assistant needs it. Every field you hand the model is a field that can surface in an answer, a log, or a screenshot.

One “get customer” endpoint returns the whole record — and buried in it: a tax ID, an internal risk score, an API key your frontend never renders. The model has no idea which fields are sensitive. Hand it the whole object and it can repeat any part of it.

The fix is not to trust the model to be discreet. It is to decide, field by field, what reaches the model at all — and to mask the rest before a single character enters its context.

GET /api/customers/4182Raw · 200 OK
"id": 4182,
"name": "Acme Logistics",
"email": "[email protected]",
"taxId": "30-71234567-9",
"notes": "Call Ana on +54 11 5555 0142",
"internalScore": 87,
"apiKey": "sk_live_9f2c…"
what the model readsFiltered + masked
"id": 4182,
"name": "Acme Logistics",
"email": "•••@acme.com",
"taxId": "••••567-9",
"notes": "Call Ana on [PHONE]"
// internalScore — not sent
// apiKey — never sent

Ten mask types, applied on the server before the response enters the model’s context.

MaskYour API returnsThe model reads
Label[email protected][EMAIL]
Email domain[email protected]•••@acme.com
Last 4A12345678••••5678
First 3A12345678A12•••••
Card BIN4242 4242 4242 4242424242••••••4242
Year1987-03-141987
Month1987-03-141987-03
Range4820010k–100k
Age band3430–39
Text scanCall +1 415 555 0142Call [PHONE]
How AI Enable Kit approaches it

Paste one real response into the console and it learns the fields. Tick the ones the assistant needs, choose a mask for the sensitive ones, and the service enforces it before any text reaches the model.

Allowlist, not blocklistOnly the fields you tick are sent. A field your API adds next month stays out until someone chooses it — and credential-like names start unticked.
Masked on the serverMasks are applied the moment results arrive, before they enter the model’s context. An outdated integration on your side cannot skip them.
Errors get scanned tooError bodies are scanned and trimmed on every endpoint — because an error message can echo back exactly what was asked about.
Never written backIf the model tries to write a masked placeholder into a change, the call is refused and it is told to ask the user for the real value.
04Who is really making that API call?Identity

The model is one caller. Make sure it is the right one.

An assistant that calls your API is only safe if every call carries the identity of the person chatting — not a shared service account, not a god-mode token.

The tempting shortcut is to give the assistant its own powerful credential so it can “just get the data.” Now every user shares one identity, tenant boundaries blur, and a single bug becomes a cross-customer breach.

The correct answer is boring: the assistant acts as the user, through the login you already have. No new directory, no new passwords, no second system to keep in sync.

Three tokens, one rule: nothing is held by a party that does not need it

API token · belongs to your appLives only on your backend and authenticates its calls to the service. Shown once, stored as a hash, rotatable at any time.
Session token · belongs to one userShort-lived (30 minutes by default), minted by your backend for the signed-in user, held in memory and renewed silently.
Your own login · never leaves your sideYour JWT or cookies stay between the browser, your backend and your API. The service never sees a password or a user credential.
Lesson

Identity is delegated, never invented. The user is named from the authenticated request — not from the message body — so a prompt cannot claim to be someone else.

How AI Enable Kit approaches it

Three tokens, four parties, one rule. Your backend swaps its API token for a per-user session token, and every call into your data runs under that user.

Your authentication, unchangedThe assistant rides on the login you already run — cookie sessions or a bearer header — with no SSO changes and no new user directory.
Per-user permissionsEvery call runs under that user’s own permissions. The same question returns different data for different people, exactly as your app intends.
Tenant isolation, end to endUsage, conversations and limits are kept per tenant, so one customer’s data and one customer’s cost never bleed into another’s.
Rotatable in one clickRotate the API token whenever you need to; the old one stops working the moment the new hash is written.
05You’re flying blindObservability

Your bot is answering. Do you know what happens behind each answer?

You instrument your application without thinking about it. The AI layer ships as a black box — and a black box is exactly where cost, latency and quiet failure hide.

Day 01$4.20daily LLM cost
Day 30$387.60daily LLM cost
Cost / day↑ 92×

Illustrative — hypothetical cost growth with no monitoring or intervention.

The pitfall: you monitor your app, but not your AI.

What could go wrong
  • A single user quietly generates a flood of API calls
  • The model keeps reaching for the wrong tool, round after round
  • Response times creep up and nobody notices
  • Users get a wrong answer, lose trust, and stop asking
Best practices
  • Track tokens and cost per user and per tenant
  • Trace every model call and every tool call
  • Watch latency and failure rates
  • Alert on abnormal behaviour before the bill does
  • Collect and read the feedback users leave
How AI Enable Kit approaches it

The observability you would have to build and maintain yourself comes built in, per tenant — a console that turns the black box into something you can read.

Usage, per tenant and userConversations, messages, tool loops, tokens, duration and estimated cost, with a trend by day. Filter to a single customer to see how they really use it.
Every conversation, replayableWho asked, their tenant and role, read back exactly as it happened — including which endpoints the assistant reached for.
Every model call, tracedTokens in and out, latency and finish reason per call. Quick filters surface failed answers, missed tool calls and slow conversations.
Alerts that watch for youPick a metric — messages today, or the thumbs-down ratio — set a threshold, and hear about it the moment it is crossed.
06Your bot could become a financial liabilityCost

One question is rarely one model call.

Agentic assistants loop — read, think, read again. Each loop is tokens, and tokens are money. Without a ceiling, one curious user or one confused model can run the meter.

The cost of an answer is not fixed. A simple lookup might be one call; a “why did this fail?” might chain five. Multiply by active users and days, and the bill stops being a rounding error. The numbers below are illustrative — but the shape is real.

The single biggest lever is calls per question.

AssumptionIllustrative value
Daily active AI users1,000
Questions per user per day10
Average model calls per question3
Average cost per model call$0.005
Days per month30
$4,500per month — 900,000 model calls · $54,000 annualized

Formula: users × questions × calls × cost × days. Constant average model cost; excludes infrastructure and external API charges. Not product pricing.

How AI Enable Kit approaches it

Cost becomes a number you set and watch, not one you discover at the end of the month. Choose the model per job, cap the loops, and see spend per user and tenant.

A hard cap on lookupsSet how many rounds of tool calls one question may take, so a single answer can never run away with cost or latency.
Cost you can price onToken cost per tenant and per user is right there, so pricing an AI tier is a calculation — not a guess.
The right model per jobGemini 2.5 Flash and Claude Haiku for fast everyday answers; Gemini 2.5 Pro, Claude Sonnet 5 or Opus 4.8 for the hard, multi-step questions.
Your own provider keyModel calls run on your own Google or Anthropic key, stored encrypted and used only for that application.
07When AI stops talking and starts actingActions

Reading is reversible. Acting is not.

The jump from answering to doing is the biggest one in this guide. A wrong sentence is an annoyance; a wrong write is a ticket raised, a refund issued, a record deleted.

“Excessive agency” is the failure mode: a model that is a little too eager, a tool that is a little too powerful, and nothing standing between the intent and the effect. The guardrail is not to forbid action — it is to make every action explicit, scoped to what you declared, and confirmed by a human.

Let it act — but never without the user’s yes.

Create a follow-up task for the vendor order.

I’ll create this task. Please confirm:

POST /api/tasks
title “Follow up on vendor order”
assignee Maria Chen
ConfirmCancel
How AI Enable Kit approaches it

Endpoints are read-only by default. An endpoint only becomes a write when you declare it one — and every write passes through a confirmation step the backend cannot skip.

GET by defaultPOST, PUT, PATCH and DELETE are opt-in per endpoint, declaring exactly which body fields the assistant may send.
Held until confirmedWhen an answer includes a write, the request is withheld; it is released only after an explicit confirmation round-trip, and declined calls come back as text the model reads.
Cannot be steeredUndeclared arguments are dropped and path parameters are encoded, so a crafted value cannot move a call to a different endpoint.
No masked writesA value the model only ever saw masked can never be written back — the call is refused and the model asks for the real one.
08How do you know it’s doing a good job?Quality

“It seems to work” is not a metric.

A model that is confident and wrong is worse than one that says “I don’t know.” You cannot improve what you cannot see — and you cannot see quality without feedback and review.

Grounding answers in live data makes the assistant far less likely to invent a number — it is quoting what your API returned, not recalling from training. But “far less likely” is not “never.” There is no rule that mechanically proves every figure in an answer traces back to a tool result.

So the honest posture is two-sided: instruct the model to quote only what the tools returned, then keep the receipts and actually read them. Collect ratings. Review conversations. Fix the endpoint descriptions that keep confusing it.

Grounding reduces hallucination. Review is how you catch the rest.

Conversation #4,281 CRM · sales role
Negative

User asked for this quarter’s at-risk accounts. The assistant answered, but left a follow-up about one account unresolved and reached for a reporting endpoint that returned an error.

High

A question was left unanswered — the user asked twice and did not get the number.

Medium

An endpoint description is ambiguous; the model picked the wrong tool on the first try.

How AI Enable Kit approaches it

Quality is not a one-time test; it is a loop. You decide what the assistant reads, AI helps you tune it, and every conversation can be checked.

Instructed to quote, not inventThe model is told to answer from tool results — not memory — and not to invent ids, amounts, dates or names. Grounding does the heavy lifting; review does the rest.
Feedback on every answerUsers can rate, copy or regenerate. The thumbs-down ratio becomes a metric you can alert on.
Conversation reviewEach conversation gets a sentiment, a summary and findings — such as a question left unanswered — ranked by severity, so you know what to fix next.
Endpoint reviewRun your own model over your inventory and it proposes clearer descriptions, better names and fields to mask — each with a before and after.
09Designing for productionArchitecture

Nothing is held by a party that does not need it.

Good AI architecture is mostly about who holds what. Keep credentials on your side, keep the model on its side, and route everything through a backend you control.

Four parties. The browser holds only a short-lived session token. Your backend holds your API token and relays every message. The AI service runs the model and plans tool calls but never touches your users’ credentials. Your API answers as the signed-in user. Each boundary is a thing that cannot leak across it.

Browser + widgetHolds your app’s own login plus a short-lived chat session token. It never talks to the AI service directly.
Your backendRelays every message both ways and makes each call into your data — with the user’s credentials.
AI Enable KitPlans tool calls, filters fields and streams the answer. Never holds a password, JWT or cookie.
Your APIYour authentication, unchanged. Answers as the user — and a 403 is still a 403.
Lesson

The browser never sees your API token. Your API never sees an AI Enable Kit token. The service never holds your users’ credentials. Three boundaries, three breaches that cannot happen.

How AI Enable Kit approaches it

This separation is not a configuration you can get wrong — it is how the integration is shaped. All traffic flows through your own backend, so you can log it, filter it and apply your own rules before and after.

All traffic through youEvery message passes through your backend in both directions, giving you one place to log, inspect and enforce your own policy.
Your app stays the source of truthNo new database, no copy of your records to keep in sync. The assistant reads your API live, at the moment of the question.
10Build it or integrate it?Build vs buy

The model is the easy part. The platform is the project.

You can build all of this. The real question is whether the AI platform is your product — or the thing that has to sit underneath it before your product can ship.

Everything in the last nine chapters — the tool-calling loop, session and identity handling, field filtering and masking, logging, cost tracking, alerts — has to exist per application and per tenant. Then it has to be maintained as models, providers and prices change underneath you.

Months of specialised work, then ongoing maintenance — or live in days.

Building it yourself
  • Model integration and a tool-calling loop
  • Sessions, identity and permission handling
  • Field filtering and masking of sensitive data
  • Logs, usage, cost tracking and alerts — per tenant
  • And all of it, maintained as the models change
With AI Enable Kit
  • All of it built in, per application and tenant
  • Your login, your permissions, your APIs
  • Allowlisted fields and masks, enforced by the service
  • A console for usage, conversations and alerts
  • Three routes and a script tag — live in days
11Putting everything togetherIntegration

Connect, define, embed.

Everything in this guide, assembled into three moves: point it at your API, choose what it can reach, drop in the widget.

The front end is a single script tag on your signed-in pages. The back end is three small routes — a session route, a message relay and a delete route — and the console hands you each one, with your URLs filled in, in Node, Python, PHP, Ruby, Go or Java.

the front end · signed-in pagesHTML
<script
  src="https://aienablekit.com/widget.js"
  data-session-url="/api/chat/session"
  data-message-url="/api/chat/send-message"
  data-delete-url="/api/chat/delete-session"
  defer></script>
the session route · your serverNODE
// POST /api/chat/session
const user = currentUser(event) // your auth
return fetch(`${KIT}/auth`, {
  method: "POST",
  headers: { authorization: `Bearer ${API_TOKEN}` },
  body: JSON.stringify({ user_id: user.id })
})

Three ways to enable your endpoints

Manual — define by handDescribe each endpoint as fields: a name, a path, a description, a row per parameter. Full control over what the AI can reach.
OpenAPI — import a specImport your OpenAPI file and every GET endpoint comes in at once, with its parameters, mapped in minutes.
Inspector — discover from trafficTurn it on for chosen developers; it records the calls your own pages make and suggests the endpoints and filters you are missing.
Lesson

Change what the assistant reads without a redeploy — edit the inventory and the next question uses it.

12Are you ready for production?Checklist

The production-readiness checklist.

If you can tick these, your assistant is ready for real users. If you cannot, you know exactly what is left.

Attack surface

Identity & access

Data exposure

Action safety

Cost & limits

Observability & quality

0 / 21 ready for production

The demo got you here. Production is the rest of the iceberg.

You don’t have to build the platform underneath your AI to ship it. Point AI Enable Kit at your API, choose what it can reach, and your own data answers back — secure, observable and live in days.

Become a Design Partner →

Security and data-protection claims in this guide reflect the product as implemented.

All developer resources