Skip to content
Courses/AI security and evaluation/Privacy, Logs, and Sensitive Data

Privacy, Logs, and Sensitive Data

Privacy breaks down in very ordinary places: saved prompts, overly complete logs, screenshots, vectors containing personal data, forwarded emails, or tools with broad permissions.

  • Reduce data before sending it to the model.
  • Separate useful logs from dangerous logs.
  • Design retention, anonymization, and review for educational or SMB apps.

What should not go into logs without thinking

  • Full prompts containing personal data.
  • Responses with contracts, invoices, or records.
  • Tokens, API keys, cookies, or headers.
  • Complete retrieved documents.
  • Original user audio when there is no clear need.

Minimum secure log

Terminal
{
  "request_id": "req_20260703_001",
  "user_role": "soporte",
  "tenant_id_hash": "6f2a...",
  "route": "/api/chat",
  "model": "qwen3:8b",
  "risk_flags": ["pii_detected", "rag_used"],
  "retrieved_document_ids": ["doc_123", "doc_456"],
  "answer_length": 842,
  "refused": false,
  "latency_ms": 1840
}

Filter before the model

Dataset and permission audit

Before indexing documents or training with internal data, create an inventory. The question is not only “do we have this data?”, but “may we use it for this purpose?”.

Terminal
data_inventory:
  dataset: "support_tickets_2026"
  contains_pii: true
  usage_basis: "internal support"
  allowed_for:
    - "classification"
    - "drafts with review"
  forbidden_for:
    - "training without anonymization"
    - "sharing with external APIs"
  retention_days: 90
  owner: "operations"
Terminal
def redact(text):
    text = text.replace("API_KEY=", "API_KEY=[REDACTED]")
    # In production, use more robust detectors for emails, phone numbers, national IDs, and secrets.
    return text

safe_prompt = redact(user_prompt)
response = model.generate(safe_prompt)
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue