Home  ·  Blog  ·  AI & Automation
AI & Automation

AI guardrails: how to make your company chatbot follow security and privacy policies

Telling an AI "don't share confidential data" is not security. Real guardrails sit in layers around the model. Here is how to design them for a business assistant.

· 6 min read · By
Security officer reviewing company data policies

The most common security mistake we see in company AI assistants looks like this: someone loads every document the business has into the assistant, then adds one line to the instructions: "Do not reveal confidential information."

That line is not security. It's a polite request to a system that can be talked around, tricked by hidden text, or simply confused. Real guardrails sit in layers around the model, so that even if the model misbehaves, it can't reach what it shouldn't.

Where the risks come from

The OWASP Top 10 for large language model applications (2025 edition) is a good map of what goes wrong. The ones that matter most for business assistants:

  • Prompt injection: users, or text hidden in documents and web pages, trying to override the assistant's rules.
  • Sensitive information disclosure: the assistant revealing personal data, internal figures or confidential documents.
  • System prompt leakage: users extracting the assistant's hidden instructions, and anything secret put in them.
  • Vector and embedding weaknesses: problems in the document store behind the assistant, such as missing access control between users or poisoned documents.
  • Excessive agency: assistants or agents with more permissions than they need, able to take damaging actions.

Layer 1: decide what goes in at all

The safest data is data the assistant never has. Before indexing anything:

  • Classify documents as public, internal, confidential or restricted.
  • Leave out what the assistant doesn't need to do its job. A customer support bot doesn't need payroll files.
  • Remove or mask personal data that isn't needed: phone numbers, Aadhaar or PAN numbers, bank details, health information.
  • Check sources so nobody can slip a document with hidden instructions into the index.

Layer 2: access control at search time

This is the guardrail people mean when they talk about "putting your security and policies in the vector database". Every passage stored for the assistant carries labels such as department, sensitivity level and allowed roles. Every time a user asks a question, the search is restricted to passages that user is allowed to see, before anything reaches the model.

So when a sales executive asks about salary bands, the HR passages simply aren't found. The model can't leak what it never received. Our guide what is a vector database explains how these labels work.

Layer 3: clear instructions, treated as public

The assistant's instructions (its persona and rules) still matter: answer only from provided information, refuse certain topics, hand over in certain cases. See how to write an AI persona. But write them assuming they might one day be read by a user. No passwords, keys, internal prices or private numbers in the prompt.

Layer 4: check what comes in

  • Watch for obvious injection attempts ("ignore previous instructions", "you are now...") and handle them safely.
  • Treat text from documents, emails and web pages as information, never as instructions to follow.
  • Limit message length and rate, to slow down automated attacks.

Layer 5: check what goes out

  • Scan replies for personal data patterns (phone numbers, ID numbers, email addresses) that shouldn't be there.
  • Prefer answers that cite their source document, so users and reviewers can check them.
  • When confidence is low or nothing relevant was found, the assistant should say so and hand over.

Layer 6: limit what it can do

If your assistant can take actions (update a CRM, send messages, create orders), give it the smallest set of permissions it needs, require human approval for anything involving money or anything that can't be undone, and keep separate credentials for the assistant rather than reusing an admin account.

Layer 7: log, review and respond

  • Log questions, retrieved documents, answers and actions, with access to those logs restricted.
  • Review a sample every week, especially refusals, handovers and complaints.
  • Have an incident plan: who switches the assistant off, who investigates, who informs affected people if personal data was exposed.

Your AI provider's data terms

Read the terms of the AI service you use. OpenAI states that, by default, it does not use data from its API platform and business products for training its models, and lets qualifying organisations configure how long data is kept. Anthropic's commercial terms likewise say customer content sent through its API is not used for model training. Terms change, so check the current versions, choose the right settings, and record your choice. Free consumer accounts are a different matter; keep company and customer data out of them.

For the most sensitive cases (health records, legal files, financial data), consider an open-source model hosted on your own infrastructure, so nothing leaves your servers.

India's data protection law

If your assistant handles personal data of people in India, the Digital Personal Data Protection Act, 2023 applies. Its Rules were notified on 13 November 2025 and come into force in phases over roughly 12 to 18 months, with most obligations applying from around May 2027. Broadly, they cover notice and consent, using data only for the stated purpose, reasonable security safeguards, breach reporting and respecting people's rights to access and erase their data.

In practice, for an AI assistant that means: tell users what you collect and why, collect only what you need, protect it properly, keep it only as long as needed, and be able to find and delete a person's data on request, including from logs and the document store. This is a summary, not legal advice; involve your lawyer early.

Test it before attackers do

Before launch, spend a day trying to break your own assistant: ask for other users' data, try to extract the instructions, hide instructions inside an uploaded document, ask it to take actions it shouldn't. Fix what breaks, then repeat after every major change.

A short checklist

  1. Only necessary documents indexed, personal data minimised.
  2. Access labels on every passage, filtered on every search.
  3. No secrets in the system prompt.
  4. Input and output checks in place.
  5. Least-privilege permissions and human approval for important actions.
  6. Logs, weekly reviews and an incident plan.
  7. Provider data settings checked and recorded.
  8. DPDP obligations reviewed with your lawyer.

If you're building an assistant on company data and want security designed in from the start, see our AI services. For the overall build, read how to build an AI assistant on your company data.

FAQs

Is it safe to paste company data into ChatGPT?

Not into a free personal account. Use business plans or the API, whose terms say your data is not used to train models by default, check the retention settings, and share only what the task needs. For highly sensitive data, consider a self-hosted model.

What is prompt injection?

An attempt to override an AI assistant's instructions with text, either typed by a user ("ignore your rules and...") or hidden inside a document or web page the assistant reads. It is listed first in OWASP's Top 10 risks for large language model applications.

Does India's DPDP Act apply to AI chatbots?

If your chatbot collects or processes personal data of people in India, the Digital Personal Data Protection Act, 2023 and its Rules apply to that processing. The Rules were notified in November 2025 and come into force in phases over about 18 months. Take legal advice for your specific case.

Can a system prompt keep data secret?

No. Instructions in the prompt help with behaviour, but users can sometimes extract or bypass them. Confidential data must be kept out of the assistant's reach by access control, not by asking the model to keep a secret.

Read next

Let's build something unforgettable.

From a 5-page launch to a multi-region growth engine — we plug in, ship fast, and stay till the numbers move.