AI & Agents · AI ERP & SaaS · Security & Compliance
NexusCall: Multi-Tenant AI Voice Call Center & CRM Platform
By David Gadyan · Published
A multi-tenant SaaS platform for call agencies. AI voice agents make and answer phone calls, qualify leads and book appointments. It also has a CRM, call and email campaigns, and AI-drafted email replies that a person approves before they are sent. Every model call goes through an AI gateway built against the OWASP Top 10 for LLM applications. 16 Python microservices, a Next.js web app, PostgreSQL row-level security per tenant, HashiCorp Vault, Keycloak with MFA, Kubernetes. About 1,400 automated tests.
The problem
An agency that runs phone and email outreach for many clients needs a lot of people to call leads, qualify them, book appointments and answer email. AI voice agents can do much of that work, but they raise new risks. A caller or an email can try to give the agent orders (prompt injection). An agent can say or send something wrong. One client's data can leak to another. Model costs can grow without limit. NexusCall is a call-center platform that uses AI for the routine work and keeps each of these risks under control. The controls run in code outside the model, so they hold even when the model does what an attacker asks.
The product in use
What I built
An AI call center for every client of the agency. Each client gets its own workspace. The dashboard shows calls answered, qualified leads, appointments, AI replies sent and total cost for the last 30 days, with daily charts. The agency's platform console shows all client workspaces, with usage and cost per tenant for telephony, AI and email.
AI voice agents that call, qualify and book. A call comes in through Twilio. Deepgram turns speech into text, Claude decides the next turn through the AI gateway, and ElevenLabs speaks the answer. The caller can interrupt the agent (barge-in). The agent says that it is an AI, asks for recording consent where required, and can hand the call to a person. Outbound campaigns call a CRM segment inside a calling window, at a set pace, and check the do-not-call list again just before each dial. One switch stops every outbound call in a workspace at once.
Every call on record. Each call has its outcome, qualification, talk time and cost, a timeline from creation to hang-up, and the transcript. Phone numbers are masked. Opening a transcript or a recording writes an entry to the audit log with the reader's name and the time.
AI writes the email, a person sends it. Inbound email is classified, and the AI drafts a reply using the client's knowledge base. The draft waits in an approval queue, where urgent and sensitive messages are flagged. A person compares it with the original email, edits it and approves it. Only that exact approved version can be sent. The send endpoint accepts only a draft ID and a version, never a recipient or a body.
Settings each client controls, inside platform limits. A client admin chooses the allowed models, the monthly AI budget and the highest data classification that may reach a model. Some settings are locked by the platform: prompt text is never stored, and AI email always needs human approval.
Also in the product: a CRM with leads, contacts, imports, segments, consent records and suppression lists; a calendar that rejects double bookings; email campaigns that pause on their own when bounces pass 5% or complaints pass 0.1%; analytics with call, email, AI-draft and booking funnels; and three role-based web interfaces (client workspace, client admin, platform admin).
Architecture design
Hover or tap a component to light its path and see what it does.
Security against the OWASP Top 10 for LLM applications
All model traffic goes through one AI gateway. Emails, call transcripts, knowledge documents and tool output always reach the model as untrusted data, and the caller cannot mark them as trusted. Tests run the gateway against a simulated model that obeys injected instructions on purpose. So each test checks what the platform blocked, not whether the model happened to refuse.
| OWASP LLM risk | How NexusCall handles it |
|---|---|
| LLM01 Prompt injection | Untrusted text is wrapped in random delimiters, after Unicode normalisation and removal of hidden characters. Injection signals are only recorded: the decision to run a tool never depends on them. A tool runs only if it was granted to this agent. |
| LLM02 Sensitive information | API keys, tokens and passwords are removed from every input, tool output and answer. Personal data is removed from restricted data. Prompt and answer text is never stored or logged. |
| LLM03 Excessive agency | Tools offered to the model = the tools the agent asked for and was granted. Arguments are checked against a schema. High-impact tools need a human approval stored in the database, which model text cannot fake. Privileged tools are never offered. If the tool registry is down, nothing runs. |
| LLM04 Supply chain | Only registered models can be used, and the provider address comes from configuration, never from a request. Dependencies are pinned by hash. CI runs a Trivy image scan and gitleaks and produces an SBOM. |
| LLM05 Data and model poisoning | Knowledge documents keep their source and are always treated as untrusted. No model is fine-tuned. |
| LLM06 Unbounded consumption | Size limits, output-token caps, monthly budgets as hard caps, rate and concurrency limits, limits on agent loops, a circuit breaker per provider and kill switches at five levels. |
| LLM07 Misinformation | Callers get the real result of each tool call (done, needs approval, denied, failed), never the model's claim. Structured answers must match a schema, or the request fails. |
| LLM08 System prompt leakage | Credentials can never be put in a system prompt. A canary token and an overlap check stop a leak, and streamed answers are released sentence by sentence only after that check. |
| LLM09 Vector and embedding weaknesses | Knowledge search runs with the tenant filter and row-level security inside the vector query. Secrets are never embedded. |
| LLM10 Improper output handling | Answers are cleaned of markdown images used for exfiltration, active HTML, javascript: links and control characters. Model output is never run as code, SQL or shell. |
The adversarial tests also found and fixed three real issues. The Anthropic SDK logged full request bodies at debug level. A 12-word overlap window missed an 11-word leak of the system prompt. A short system prompt could be echoed before the canary appeared in a stream.
Platform security
- Tenant isolation in the database. Each service has its own PostgreSQL database. Every tenant table has row-level security switched on and forced. The runtime role is neither the table owner nor allowed to bypass it. The tenant is set per transaction, so pooled connections cannot leak data between tenants.
- Identity. Keycloak handles single sign-on and asks for MFA again before sensitive actions. A backend-for-frontend keeps access tokens on the server: the browser holds only an HttpOnly session cookie, and every change needs a CSRF token. Support access to a client's data needs a reason, a ticket and MFA, lasts at most 4 hours, and the client owner is told.
- Secrets. Every provider key (Twilio, SES, Anthropic, Deepgram, ElevenLabs, OAuth) lives in HashiCorp Vault. Each service may read only its own paths, databases store references only, and the console shows metadata, never values.
- Webhooks and egress. Twilio and SES webhooks are checked by signature and replay window. Outbound calls to external APIs are limited to an allowlist, and requests to private or cloud-metadata addresses are refused (SSRF).
- Reliable events. Services talk over RabbitMQ with the outbox and inbox pattern, so no event is lost or processed twice. Create, send and book requests take an idempotency key.
- Audit. Sensitive reads and every admin action go to an append-only, hash-chained audit log.
Delivery: a Helm chart with default-deny network policies, restricted pod security, migration jobs and Vault agent injection, Terraform for cluster add-ons, k6 load tests, runbooks and a compliance checklist. About 1,400 automated tests: 1,085 Python tests against real PostgreSQL, RabbitMQ and Redis, and 307 web tests.
The screenshots and the video use a demo workspace with fictional clients and sample data. The security events include prompt-injection attacks sent to the live AI gateway during recording. This is engineering work, not a compliance certification: calling and email laws need legal review in each country where the platform runs.
Related projects
Hybrid AI for Salesforce: Claude, ChatGPT & Private LLMs, One Router
AI & Agents · AI ERP & SaaS · Security & Compliance
Virgil.ai: Agentic Health-Insurance Assistant
AI & Agents · AI ERP & SaaS · Cloud, DevOps & LLMOps · Security & Compliance
Mosaic BI: AI Analyst Team on MoE, RLHF + RLVR and an OWASP AI Gateway
AI & Agents · Data Science & ML · Security & Compliance