Page 7 of 8~120 min topic

Fine-tuning lab

Set data rights and rollback boundaries

Least privilege, negative probes, and a timed rollback beat a security essay about LoRA adapter that keeps support replies in brand voice while facts stay in RAG.

~15 min this pageSafety and operations

1Learn the idea

Read

Least privilege for this lab

Separate runtime and operator roles for LoRA adapter that keeps support replies in brand voice while facts stay in RAG. Runtime may only perform the narrow actions that support ops manager reviewing tone before a seasonal campaign needs; operators get audited break-glass with TTL. Encode a negative probe that denies the privilege trick related to training set includes tomorrow's promo price; model invents it after promo ends.

Read

Data and secret hygiene

Redact prompts/PII at collection. Secrets enter via a manager or workload identity — never source, fixtures, or exception strings. Incident FT-PROMO-LEAK-12 should be impossible if these controls hold. Output allowlists and schema checks stay in force on error paths.

Read

Implementation artifact

Read

Training uploads are retention-sensitive; strip emails and order ids before file create.

clean = re.sub(r"[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,}", "[email]", raw, flags=re.I)

Read

Rollback drill

Rehearse the rollback or kill switch timed against a clock. Record actor, reason, prior revision/secret/flag, and verification query. Invariant reminder: weights never encode store hours or prices; those stay in retrieval docs.

Read

Stage depth

Abuse cases unique to this lab include the privilege path implied by training set includes tomorrow's promo price; model invents it after promo ends. Prove a read-only role cannot mutate. Break-glass tokens expire; leftover tokens fail the drill. Dependency pin/digest story matters when images or models move under you. Document how to rotate the credential that LoRA adapter that keeps support replies in brand voice while facts stay in RAG uses without a full outage window longer than your dual-run plan. Security evidence is part of ship, not an appendix nobody reads.

Read

Field notes for `fine-tuning-lab` / `security-ops`

List network egress destinations and justify each. Ensure debug endpoints are off by default in the shipping config. Verify that error responses do not echo secrets or raw stack frames to clients. For multi-tenant paths, add a cross-tenant probe fixture. Time the rollback drill twice — once with the author, once with a peer. Store the drill transcript beside the threat notes for the incident id. In this chapter the product is LoRA adapter that keeps support replies in brand voice while facts stay in RAG, the human stakeholder is support ops manager reviewing tone before a seasonal campaign, and the incident id you design against is FT-PROMO-LEAK-12. Re-state the oracle in your notes — held-out tone score ≥ 0.82 and factual hallucination rate ≤ 0.05 on 40 gold pairs — and keep the invariant visible: weights never encode store hours or prices; those stay in retrieval docs. Track tone_pass_rate and unsupported_fact_rate as the scoreboard. Surface under change control: POST /v1/fine_tuning/jobs. If you only have forty minutes, finish the fixture for training set includes tomorrow's promo price; model invents it after promo ends before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Go deeper

Before you start

Why this matters

Threat-model LoRA adapter that keeps support replies in brand voice while facts stay in RAG in five minutes: who can change config, who can read secrets, what a malicious payload tries to do. Write one negative probe that must yield deny with zero side effects. Reference FT-PROMO-LEAK-12 as the story you refuse to repeat.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Does deny imply zero side effects?
2. Are secrets absent from logs?
3. Is rollback evidenced with timestamps?

All responses are required.