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

Privilege boundary — 모델이 할 수 있고 없는 것

~14 min · security, privilege

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

Prompt 원칙으로 least privilege

Agent의 blast radius는 tool이 할 수 있는 것의 set. task가 필요한 minimum으로 set 줄여. "이 support agent는 search orders, escalate to humans, write notes 가능"이 "이 agent가 우리 internal API 지원하는 모든 거 가능"보다 훨씬 narrow.

Privilege level

  • Read-only — search, list, fetch. Mutate 못 해.
  • Self-mutating — 자기 state (draft, note) 변경 가능, 외부 state X.
  • External-mutating — system of record에 write 가능. Confirmation 패턴 require.
  • External-actioning — email send, card charge, side effect 있는 API call. 가장 높은 scrutiny.

Per-user scoping

Tool이 user_id (또는 scope token) 받고 데이터 layer에서 ownership enforce. 모델이 "이 user의 order만 보여" enforce 못 trust — tool이 해야.

Code

Per-user scoped tool·python
@tool
def search_orders(customer_id: str, *, _ctx) -> list[dict]:
    # _ctx is injected by the agent runtime
    if customer_id != _ctx.authenticated_user_id and not _ctx.is_admin:
        raise PermissionError("agent cannot access other users' orders")
    return db.orders.find(customer_id)

External links

Exercise

agent의 tool set 감사. 각 tool을 read-only / self-mutating / external-mutating / external-actioning로 reclassify. task 필요보다 broad한 tool 식별.

Progress

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

댓글 0

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

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