Skip to content
TrustHappens
AI & Automation

How to Build a Private AI Assistant for Your Business

A practical build plan for a private AI assistant: what private should mean, deployment options, architecture, access control, evaluation and pitfalls.

TrustHappens Editorial TeamPublished 7 min read
Illustration for AI & Automation
On this page

Most businesses do not need a new foundation model. They need an assistant that answers questions from their own documents, respects who is allowed to see what, and keeps company data where the company decides it should be. That is a "private AI assistant", and it is mostly an engineering and governance project rather than a research one.

This article walks through what "private" should mean in practice, the deployment options, the architecture, a step-by-step build plan, the security controls that matter and the mistakes that sink most first attempts.

Define what "private" means for you

"Private" is used loosely in vendor material. Before choosing tools, write down which of these properties you actually require. Each has a different cost.

  • No training on your data. Prompts, documents and outputs are not used to train or improve anyone else's models. Most enterprise model APIs offer this contractually; confirm it in the terms, not the marketing page.
  • Data location. Where prompts, indexes and logs are processed and stored: a specific region, your own cloud account, or your own hardware.
  • Access control. The assistant only uses content the asking user is already allowed to read.
  • Retention and deletion. How long prompts and answers are kept, by whom, and how a document is removed from the assistant's knowledge.
  • Auditability. You can see who asked what, which sources were used and which model answered.
  • Network isolation. For the strictest cases, no traffic leaves your network at all.

Choose a deployment model

There are three broad options. Many organisations mix them, routing sensitive workloads one way and everything else another.

OptionWhat it looks likeGood fitTrade-offs
Hosted model API with enterprise termsYou call a provider's API; your retrieval layer and data stay in your systemsMost internal knowledge assistantsPrompts and retrieved passages leave your network for each request
Models in your own cloud accountManaged model endpoints or open-weight models running in your cloud tenancyData residency requirements, existing cloud controlsYou operate more infrastructure; model choice may be narrower
On-premises or air-gappedOpen-weight models on your own hardware, no external callsDefence, critical infrastructure, strict regulatory isolationGPU capacity, patching and model upgrades are all yours

Decide on the data path first, then choose models that can run on it. Choosing a favourite model first and then trying to make it private is how projects stall in security review.

The reference architecture

A private assistant has five parts. Keeping them separate lets you swap models or add sources without rebuilding everything.

  1. Identity. Users sign in with your existing identity provider. Every request carries who the user is and which groups they belong to.
  2. Knowledge layer. Connectors pull content from approved sources, parse and clean it, split it into chunks, redact secrets and personal data where policy requires, and store chunks with their source and access permissions in a search index.
  3. Retrieval and orchestration. For each question, the system searches the index, filters results by the user's permissions, picks the best few passages and builds the prompt.
  4. Model access. A single gateway in front of one or more model providers holds the API keys, enforces budgets and routing, and logs usage.
  5. Observability and audit. Every answer is logged with the user, the passages used, the model and the latency, so you can investigate complaints and measure quality.

A request flows through those parts like this:

user (signed in)
  -> assistant API: question + user identity
  -> retrieval: hybrid search over index
  -> permission filter: drop chunks the user cannot read
  -> prompt: instructions + top passages + question
  -> model gateway: route to approved model, log tokens
  -> answer with citations
  -> audit log: user, question, chunk ids, model, latency

The permission filter is the step most often skipped in prototypes and the one that matters most. Apply it before passages reach the model, not as a post-processing step on the answer.

Build it step by step

1. Pick one job

Start with a single, well-defined use case with an owner who cares about it: answering questions about HR policy, helping support agents find product answers, or letting engineers search runbooks. A narrow scope gives you a clear source list, a clear audience and a clear way to judge success.

2. Inventory sources and owners

List every source the assistant will read, who owns it, how often it changes and who may see it. Flag duplicates and outdated material now. If two documents give different answers, the assistant will too, and users will blame the assistant.

3. Build ingestion with privacy built in

Parse documents with their structure intact: headings, tables and code blocks carry meaning. Chunk along that structure rather than at fixed character counts. Run secret and personal-data detection before indexing, and record each chunk's source URL, last-modified date and access groups.

4. Enforce permissions at retrieval

Mirror source permissions into chunk metadata and filter on them for every query. Re-sync permissions when they change in the source system; a revoked share should stop appearing in answers on the next sync.

5. Ground and constrain the answers

Instruct the model to answer only from the supplied passages, cite them, and say clearly when they do not cover the question. Keep the number of passages modest. Liu et al. found that language models use information at the start and end of a long context more reliably than information in the middle, so sending a few relevant passages tends to work better than sending many loosely relevant ones.

6. Build an evaluation set before launch

Collect real questions from the target users, with the correct answer and the document that supports it. Include questions the assistant should decline. Measure retrieval (did the right document come back?) separately from generation (was the answer faithful to the passages?). The RAGAs framework describes reference-free metrics for exactly this split, including faithfulness to the retrieved context and the relevance of the answer and of the context.

7. Pilot, then widen

Run a pilot with a small group who agree to flag bad answers. Fix sources and retrieval before tuning prompts; most errors trace back to missing, outdated or badly chunked content. Widen access only once the evaluation results and pilot feedback are stable.

8. Operate it

Assign an owner for the knowledge base, a schedule for source reviews, budgets per team or key, and a process for model upgrades that reruns the evaluation set before switching.

If you would rather adopt a platform than assemble these parts yourself, look for one that offers cited answers, private deployment and tenant isolation.

Security controls that matter

The OWASP Top 10 for LLM Applications is a useful checklist. Three of its risks dominate private assistant projects.

Prompt injection. Instructions hidden in user input or in retrieved documents can try to override your system prompt. OWASP distinguishes direct injection from indirect injection via external content, and the second is the one that catches knowledge assistants out: any indexed page, email or ticket can carry text aimed at the model. Treat retrieved content as untrusted data, keep the assistant's privileges minimal and do not let it take actions on the strength of retrieved text alone.

Sensitive information disclosure. The assistant can reveal data the user should not see if permissions are not enforced, if secrets were indexed, or if logs are widely readable. Redact at ingestion, filter at retrieval, and restrict who can read prompt and answer logs, which often contain the most sensitive text in the system.

Excessive agency. A read-only assistant that answers questions has a much smaller blast radius than one that can send emails, update tickets or run queries. Start read-only. If you later add actions, require a person to confirm anything that writes or sends.

Measure whether it works

Track a small set of numbers from day one:

  • Retrieval hit rate on the evaluation set: how often the supporting document appears in the passages sent to the model.
  • Faithfulness: how often answers make claims not supported by the cited passages.
  • Correct declines: how often the assistant says it does not know when the sources really do not cover the question.
  • User feedback: thumbs up or down with an optional comment, reviewed weekly by the knowledge owner.
  • Cost and latency per request and per team, from the gateway logs.

Rerun the evaluation set whenever you change the model, the prompt, the chunking or the retrieval settings. Small changes in any of them can move quality noticeably.

Common pitfalls

  • Starting with the model. The model is the easiest part to change later. Sources, permissions and evaluation are the hard parts.
  • Indexing everything. More content means more contradictions and more permission risk. Add sources deliberately.
  • No owner for content. When answers go wrong, someone must fix the document, not just the prompt.
  • Ignoring declines. An assistant that always answers will sometimes invent. Reward "I could not find this" in your evaluation.
  • Leaving logs open. Prompts and answers are sensitive records. Apply retention limits and access control to them.

Frequently asked questions

Do we need to host our own model for the assistant to be private?

Not necessarily. Many organisations use a hosted model API with enterprise terms that exclude training on their data, while keeping documents, the index and logs in their own systems. Self-hosting is warranted when policy forbids sending any content outside your network.

Should we fine-tune a model on our documents?

Usually not for knowledge. Retrieval keeps answers current, cited and permission-aware. Fine-tuning is better suited to shaping format or behaviour once retrieval is working.

How do we stop the assistant revealing documents a user cannot open?

Store each chunk's access groups as metadata, filter search results by the signed-in user's groups before building the prompt, and re-sync permissions from the source systems on a schedule.

How long does a first version take?

It depends mostly on source quality and permission complexity rather than on model work. Scoping to one use case with a few well-owned sources is the fastest route to a useful pilot.

References

  1. OWASP Top 10 for LLM Applications 2025
  2. OWASP GenAI Security Project, LLM01:2025 Prompt Injection
  3. OWASP GenAI Security Project, LLM02:2025 Sensitive Information Disclosure
  4. Liu et al., Lost in the Middle: How Language Models Use Long Contexts (arXiv:2307.03172)
  5. Es et al., RAGAs: Automated Evaluation of Retrieval Augmented Generation (arXiv:2309.15217)

Share this article

Stay Ahead of What Matters.

Practical guides on ai & automation and more, delivered to your inbox.