AI Engineering
/

Security & Privacy

Security & Privacy

Defend against injection, data exposure, and excessive agency.

Start topic

Contain prompt injection, prove that a context selector cannot leak data, and threat-model an agent that can reach private systems.

3 questions

Questions

Easy

Easy
Conceptual

1.5 h

Explain why a retrieved document cannot grant itself authority, and name the controls in trusted code that still hold when the model follows an injected instruction.

Medium

Medium
Hands-on

3 h

Implement a context selector that enforces tenant, group, and deletion rules before ranking, then design tests proving that forbidden records and internal notes never reach the model-bound payload.

Hard

Hard
System Design

4 h

Threat-model a multi-tenant assistant that reads private documents, keeps conversation summaries, and sends approved notifications, naming where each control is enforced and what risk remains.

What you will be able to do

  • Identify direct and indirect prompt injection and where untrusted content enters
  • Map the assets and trust boundaries of a private-document assistant
  • Distinguish authentication from authorization, and derive both from trusted context
  • Explain data minimization and why redaction is only one layer
  • Describe why model instructions cannot replace access checks or executor policy
  • Implement a context selector that takes access from trusted identity and enforces tenant, group, and deletion rules before ranking
  • Project only the fields a task needs, so internal notes never reach the model
  • Test the serialized model-bound payload, including retries, fallbacks, and external rerankers, not only the selector's return value
  • Design revocation, cache, and injection fixtures with different principals and known marker provenance

Before you start

Suggested, not required.

Topic boundaries

This topic covers technical attack and exposure controls. Responsible AI & Governance covers oversight, impact, and release accountability.

Related on CodeSnatch