A reliable AI-native backend surrounds probabilistic model behavior with deterministic software boundaries. Code authenticates users, authorizes data, builds approved context, constrains outputs, controls tools, records evidence, and enforces budgets. Models interpret or propose; the application validates and decides what may affect durable business state or the outside world.
The shell owns invariants. A model may classify ticket intent, but code decides allowed labels. A model may propose a refund, but code verifies policy and requires approval. A model may draft a query, but code never grants arbitrary database access.
Use deterministic code for exact arithmetic, permissions, identity, schema validation, database constraints, state machines, and rules with stable inputs. Use a model where language ambiguity or fuzzy classification creates value and an error can be detected, contained, or reviewed.
Score a candidate feature:
Persist an application-owned record with tenant, user, feature, model/provider, prompt version, schema version, input references, retrieval references, status, latency, token/cost usage, safety outcome, trace ID, error category, and timestamps. Respect privacy: store references or redacted content when raw prompts are unnecessary.
Observability asks, “What happened in this request?” Evaluation asks, “Was the output good enough?” You need both. Low latency can deliver a wrong answer quickly; a strong offline score cannot explain a production timeout.
Design ticket classification into billing, bug, access, or other. Include the model boundary, validated schema, confidence policy, human fallback, evaluation dataset outline, and durable run record.
Acceptance criteria: invalid labels cannot enter ticket state, a model outage does not lose the ticket, and you can measure both classification quality and runtime health.