Skip to main content

Staff paste code, contracts and customer lists into your company's approved internal AI assistant. How would you set up data loss prevention for what they send in and for what the model sends back?

AI security · Pro 1

Short answer

Put a gateway between staff and the model. On input, detect secrets and personal data such as API keys, card and Aadhaar numbers, then block, mask or warn by data class. On output, scan for the same patterns and for data the user should not see. Protect the logs, and tune the rules so staff keep using the tool.

Deeper answer

Data leaves through the prompt and can come back through the answer, so DLP sits on both sides. A central gateway gives one place to apply policy and to log. Detection mixes methods: patterns for structured items such as PAN numbers, with checksums where a number format has one, as card numbers do, secret scanners for keys and tokens, and classifiers for unstructured confidential text, which is harder.

The action depends on the class of data. A leaked API key should be blocked. A customer's phone number could be replaced with a token and put back after the model replies. Output scanning matters most when the assistant is connected to internal search, because it can surface a document the user has no right to see. That is first an access control problem, with DLP as the second layer. The prompt logs are sensitive too and need masking and retention limits. Too many false blocks push staff towards unapproved tools. Interviewers listen for both directions, graded actions and usability.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

Guardrails

Practice AI security questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.