C.W.K.
Stream
Lesson 09 of 10 · published

Audit trail — 나쁜 일 일어났을 때

~12 min · security, audit, logging

Level 0수련생
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

새벽 2시에 필요할 log

incident hit하면 — leaked credential, unauthorized action, 모델이 invent한 refund amount — log가 유일한 ground truth야. 없으면 추측이야.

request당 log할 것

  • Request id (unique, support 위해 user한테 surface).
  • Authenticated user id (session token만 X).
  • Prompt version, model, sampler param.
  • Full input (정책에 맞는 PII handling).
  • Retrieved chunk / tool call / tool return.
  • Reasoning trace (가능한 곳).
  • Final output, output filter flag.
  • 취해진 downstream action (idempotency key 가지고).

Storage와 retention

Log이 investigate할 만큼 길게 retain되고 privacy comply할 만큼 짧게. Encrypt at rest. Raw log은 incident responder만 access; aggregate metric은 broadly available.

Code

Audit log shape·json
{
  "request_id": "req_abc123",
  "user_id": "u_456",
  "prompt": "support.draft@7",
  "model": "claude-opus-4-7",
  "sampler": {"temperature": 0.2, "max_tokens": 1024},
  "input_redacted": "...",
  "retrieved": ["chunk:manual-3.4", "chunk:faq-12"],
  "tool_calls": [{"id": "call_xyz", "name": "search_orders", "args": {"customer_id": "..."}}],
  "output_flags": [],
  "actions": [{"name": "send_email", "id": "act_pqr", "idem_key": "..."}],
  "created_at": "2026-05-04T12:34:56Z"
}

External links

Exercise

Endpoint 한 개의 audit-log schema sketch. 오늘 missing field (prompt version, retrieved chunk, idempotency key) 식별. 추가.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.