A customer-support assistant that answers from the policy, looks up orders, handles refunds and cancellations and hands over to a person. The model reads the request and suggests the action; server code checks the customer, applies the policy, asks for confirmation and runs it once.
Safety attempts measuredD2c semantic-safety validation: 30 unsafe proposals, 30 caught by the deterministic guard, 0 executable survivors and 0 executions.
8/8 phases, 6/6 fault classes18 / 18
Operational scenarios passedD2d release gate on the deployed system: concurrency, restart, persistence and injected faults, measured apart from model quality.
100 samples, 82 passed, 18 partial0
Safety failures with live modelsReal-LLM adversarial audit: the 18 partial results are quality warnings. No unauthorized change, skipped confirmation or duplicate effect.
A convincing answer is not permission.
A support assistant that only answers questions can be wrong and cost a reply. One that can refund an order, cancel it or open a ticket can be wrong and cost money. Once an agent can change an account, it becomes a systems problem.
This platform keeps understanding and permission apart. The model reads what the customer wants and proposes an action. It cannot choose which customer it serves, invent an order number, approve its own refund or change account data. Those decisions live in code that can be tested.
Around that runtime sits AgentOps, the console where a support team watches the assistant work, steps in when a customer needs a person and shapes how the assistant behaves, without being able to hand the model more authority.
Built for the support team.
The assistant handles the routine work; the team keeps the hard cases, the knowledge and the rules.
Answer from the policy
Policy and FAQ questions are answered from the knowledge base with hybrid dense and BM25 retrieval. Each answer is checked against its sources and citations, and the assistant says so when the evidence is not enough.
Customers get answers the support team can trace back to a document.
Handle orders end to end
Order and ticket lookups, refunds, cancellations and new support tickets. Consequential actions wait for the customer to confirm, then run once through a typed path.
Routine requests are resolved without a person, and never twice.
Hand over to a person
Sensitive requests go straight to the queue with a priority, a reason and a first-reply deadline. An operator claims the conversation, replies, adds internal notes, resolves it or hands it back to the assistant.
The customer sees one continuous thread, whoever is answering.
Investigate any run
Every run shows what the model proposed, what the control plane decided, what was authorized and what ran, with the evidence behind it. The audit log records who did what and when, for the assistant and the team.
A support lead can answer “why did it do that?” from the console.
Shape and measure it
Knowledge articles, guidance rules, procedures and action modes are edited as published versions. Performance tracks resolution, handoff rate and CSAT, and unanswered questions become new article sections.
The team improves the assistant without touching code or authority.
One refund, interrupted halfway.
The assistant asks the customer to confirm a refund, and the customer answers with a question instead. This is the path the request takes.
Request. The customer asks for a refund. The model proposes the intent; the server resolves which order it means within that customer's scope.
Hold. Policy allows the refund but requires confirmation, so it is saved as one pending action and nothing runs.
Interrupt. The customer replies “Yes, but first, what is your refund policy?”. A yes mixed with a question is a question, so the workflow is suspended, not approved.
Answer. The assistant answers from the refund policy with citations. The answer does not count as approval, and the refund keeps waiting.
Confirm. The customer confirms the same refund. The server checks the order again before anything runs.
Run once. The refund is written through the typed business path under an idempotency key, so a retry cannot apply it twice.
The model proposes. The server decides.
In a typical agent, the order number the model writes goes straight into the tool. Here every step after understanding the request belongs to the server.
The server knows who the customer is before the agent runs. Knowledge and memory help the answer, but only the server's checks can let an action through.
From proposal to permission.
Follow a business-action request. Select a boundary to inspect its controls.
Use the dedicated escalation path. The requested action does not run automatically.
DenyBlocked
Stop. The requested action does not execute.
Inside each boundary
Open the implementation details you need.
RequestCustomer or operator
A chat or console request enters through the HTTP boundary.
Request entry
Identity and customer scope are resolved server-side before any agent work begins.
Customer / Operator
chat or console request
FastAPI
HTTP boundary, resolves principal
Identity & scopeResolved by the server
Authentication establishes the principal. Customer scope comes from the server, never from model output.
Authenticated boundary
Identity and customer scope are resolved server-side before any agent work begins.
Authentication, RBAC
typed principal
ExecutionContext
server-owned identity + scope
actor, customer scope
request + conversation ID
Agent proposalUntrusted model output
The runtime orchestrates a typed semantic proposal. Knowledge and memory can inform it, but cannot authorize an action.
Model proposal
The model proposes semantic intent; the server owns every decision that can lead to a mutation.
LangGraph Runtime
agent orchestration, typed state
LLM Semantic Proposal
untrusted, Pydantic-typed
Knowledge supports answers
Retrieved evidence can support an answer, but it never grants execution authority.
Knowledge Question
FAQ or policy request
Hybrid Retrieval
dense + BM25
Grounding / Citation Validation
bounded evidence
Bounded Answer
abstains when evidence is insufficient
Memory supplies context
Customer-scoped memory enriches context; it cannot approve, widen scope or bypass policy.
Memory = context
consent, TTL, customer scope
Memory ≠ authority
no permission or approval
Deterministic gatesServer-owned decisions
The server compiles the proposal, resolves the authoritative target and validates live business state before policy decides what may proceed.
Checks before permission
The model proposes semantic intent; the server owns every decision that can lead to a mutation.
Deterministic Compiler
provenance and admissibility
Authoritative Target Resolution
authenticated customer scope
Typed / Business Validation
live state and tool arguments
Policy
deterministic, fail-closed
Typed executionAllow or confirmed actions
Only a permitted action reaches the business tool. Required confirmation is bound to the exact pending action and revalidated before execution; idempotency and database invariants protect the effect.
From permission to a durable effect
Allow continues to typed execution; Confirm first requires explicit approval and live-state revalidation. Human follows a dedicated escalation path, and Deny stops the requested action.
Confirmation Boundary
when required, exact pending action
Revalidation
ownership, expiry, live state
Typed Tool
execution authority
server-owned arguments
business effect only here
Idempotency + DB
one business effect
replay protection
state invariants
Projection / Audit
bounded operator evidence
State ownershipDurable state and retrieval stay separate
State ownership
Business state, idempotency receipts, memory and checkpoints are durable; retrieval remains a separate evidence system.
Agent Runtime
context, memory, retrieval
Separate components
PostgreSQL
system of record
business records + receipts
persistent memory
LangGraph checkpoints
Qdrant
versioned hybrid index
immutable snapshots
atomic alias activation
Observation and evaluationEvidence observes; it does not authorize
Observation and evaluation
Telemetry and evaluation observe behavior without becoming authorization inputs.
Separate components
HTTP boundary
safe metadata
Agent runtime
run + tool spans
Separate components
OpenTelemetry / Jaeger
trace inspection
Operator Console
metadata-only projections
Evaluation Harness
deterministic + live suites
Engineering notesContracts, evaluation and deployment limits
Model output is an untrusted proposal: it cannot select an actor, widen customer scope, confirm its own action or override live business state.
Confirmation is durable — pending actions survive restarts and stay bound to actor, actor type, customer scope and conversation.
Policy is revalidated against live state at confirmation time, so a stale proposal cannot execute against changed records.
Request-scoped idempotency keys and database uniqueness keep refunds, cancellations, tickets and escalations to one business effect; a write whose outcome is unknown is never automatically replayed.
Remembered text is contextual evidence only — it cannot authorize work or bypass policy.
The provider boundary is transport-neutral — a structured decision can be produced through a JSON schema or a function-calling contract — so a local model and a hosted one are swapped by configuration without the policy, confirmation or execution layers changing.
Because those layers never move, the canonical evaluation compares decision architectures under one model before it compares model identities: a frozen structured-contract compatibility gate decides which candidates are even eligible, and only qualifying models reach the behavioral matrix.
The current D2c semantic-safety evaluation closed the containment funnel at zero: 30 unsafe semantic proposals, 30 deterministic guard interventions, 0 executable survivors, 0 executions — reached through architectural hardening, not prompt-only tuning.
A separate D2d operational release gate validates the deployed system itself — concurrency, restart/persistence and a 6/6 fault-injection matrix — independent of model behavior; D2c and D2d are deliberately distinct claims.
The current runtime contract is semantic_decision_v3.
These rules hold whatever the model says, so a wrong proposal ends as a refused action rather than a wrong refund.
The model never picks the target
A customer ID or order number written by the model is never trusted because the model wrote it. The server resolves the target within the authenticated customer's scope.
Confirmation is bound to one saved pending action. A mixed message suspends the workflow, workflows can resume or be replaced, and state survives a browser or backend restart.
Business writes and their idempotency receipts commit together. An unknown write outcome is not blindly retried, and database constraints back the critical invariants.
Memory is kept with consent, an expiry and per-customer scope, and adds context only. Retrieved documents shape the answer. Neither can approve an action or grant a role.
The model returns a semantic proposal, not a call to execute. A deterministic compiler combines it with server-owned identity, target, policy and confirmation state; only typed tools can commit an effect.
Recheck before running
A confirmed action is revalidated against current business state before it runs, so an order that changed while the customer was reading cannot be refunded on stale data.
Handoff is a database row
Who owns a conversation lives in PostgreSQL, not in the model's state. While a person owns it the model is not called, and an operator's reply is never read as the customer's confirmation.
Security before routing
Prompt-injection and instruction-override attempts are checked before semantic routing. A denied proposal is recorded with its decision, and nothing is authorized or executed.
Evidence kept apart
Safety, operational, resilience and live-model quality results are reported as separate measurements with their own denominators, never merged into one score.
The operator console.
Every screen below is AgentOps running on the local stack with a live model. Open any screenshot to see it full size.
See how it is doing
Conversations, AI resolution rate, handoff rate and CSAT for the week, with the customers waiting for a person.
Hand over at once
Sensitive requests go straight to the queue with a priority, a reason and a first-reply deadline.
Step in and resolve
An operator takes over, replies and resolves; the customer sees one continuous thread.
Hold for confirmation
A refund stopped at the confirmation boundary: what the model proposed, what the control plane decided, what may run.
Deny an injection
A prompt injection proposes refunding every order. The control plane denies it and nothing runs.
Who did what and when, for the assistant and the team, searchable on the server.
Write the procedure
Each request type is a readable step-by-step procedure, linked to its actions, articles and guidance.
Close knowledge gaps
Questions the assistant could not answer become new article sections.
Publish guidance
Plain-language guidance changes how requests are read, never what is authorized. Every change is a published version.
Measure the outcome
How often the assistant resolves on its own, when people step in, and how customers rate both.
Keep the release evidence
The release gates behind the control plane, each kept as its own measurement.
Measured separately.
Safety, operations, resilience and live-model quality are tested apart, each with its own denominator, so one good number cannot hide another.
Test
Result
What it means
Semantic safety (D2c)
540/540 measured attempts
0 unsafe executable survivors and 0 unsafe executions.
Operational release gate (D2d)
18/18 scenarios, 8/8 phases, 6/6 fault classes
The deployed system across concurrency, restart and injected faults.
Deterministic resilience
28/28 scenarios
Runtime correctness, reported on its own.
Live-model audit
100 samples: 82 passed, 18 partial
Partials are quality warnings. No safety check failed.
Release QA
844 backend, 49 frontend, 6/6 Playwright
Plus an authenticated smoke test.
Across the live-model audit there were no unauthorized changes, skipped confirmations, duplicate effects, memory writes that granted authority or customer-data leaks.
Reference-deployment evidence, released as ready with warnings: the remaining warnings are bounded observability or unverified coverage, not observed safety failures.
Docker Compose starts the API, the console, PostgreSQL, Qdrant and Jaeger. Setup applies the migrations, seeds the demo records and loads the bundled knowledge base.
git clone https://github.com/negativexq/agentic-customer-service-platform.git
cd agentic-customer-service-platform
cp .env.example .env
docker compose up --build --detach
# Open http://localhost:5173
OpenTelemetry traces go to Jaeger, with opt-in Prometheus metrics. Pytest, Vitest and Playwright cover the backend, the console and the operator journeys.
In short
What is Agentic Customer Service Platform?
Agentic Customer Service Platform is a customer-support agent that looks up orders, handles refunds and cancellations, opens tickets and escalates to a human. The language model reads the request and proposes the action; server code owns customer identity, policy, confirmation and execution, so a model mistake does not become an account change.
What problem does Agentic Customer Service Platform solve?
A support agent becomes a systems problem once it can change account state: refund an order, cancel it, open a ticket or escalate a case. A convincing model answer is not permission. This project keeps understanding and permission apart, and tests safety, operational behaviour, resilience and answer quality separately instead of folding them into one score.