MAO Prompt Ops 상태 머신 & 권한 매핑
1. Template 상태 머신
Draft ── requestReview ──> Review ── approve ──> Approved ── deploy ──> Active
^ │ │ │
│ └─ reject ─────┘ └─ deprecate ──> Deprecated
| 상태 | 설명 | 허용 액션 |
|---|---|---|
| Draft | 작성 중. Prompt Architect only | Edit, Duplicate, Request Review |
| Review | Reviewer 검토 중 | Comment, Approve, Reject |
| Approved | 배포 준비 완료 | Deploy Canary/Prod, Deprecate |
| Active | 라이브 버전 | Rollback (to previous), View |
| Deprecated | 사용 중단 | View history only |
상태 전이는 API 응답에 포함된 allowedActions를 사용해 UI에서 버튼 노출 여부를 결정한다.
2. Deployment 상태
INITIATED → IN_PROGRESS → { COMPLETED | ROLLED_BACK | FAILED }
│
PAUSED
IN_PROGRESS상태에서 Guardrail 위반 시PAUSED로 전환 후 Ops가ROLLBACK또는RESUME을 선택.
3. 권한 스코프 매핑
| 권한 Scope | 설명 | 허용 기능 |
|---|---|---|
prompt.read | 템플릿 보기 | Prompt Library/Detail 조회 |
prompt.write | Draft 편집 | 신규 생성, 편집, Duplicate |
prompt.review | 리뷰/승인 | Request Review 처리, 코멘트 |
prompt.deploy | 배포 조작 | Deploy/Promote/Rollback |
prompt.experiment | 실험 관리 | Experiments CRUD |
prompt.model | LLM Provider/Model Profile 관리 | Model Profile CRUD, Agent/Environment 바인딩 |
observability.read | KPI/Guardrail 조회 | Observability 화면 |
권한은 Role에 조합으로 부여:
- Prompt Architect: read + write + deploy + experiment + model
- Prompt Reviewer: read + review
- Ops Engineer: read + deploy + observability + model (Provider 제한 해제 권한 보유 시)
- Compliance Reviewer (선택): read + model (가용성/데이터 지역성 감사용)
4. Guardrail 연동
- Guardrail Engine은
policyId,severity,promptVersion을 전달하며, severity ≥metricsGate.guardrailSeverityLimit이면 Deployment 상태를PAUSED로 변경. - UI는
prompt.deploy권한이 있는 사용자에게만Resume/Rollback버튼을 노출한다.
5. 감사 정책
- 상태 전이/권한 관련 모든 행위는 Audit Log에 기록:
actor,action,resourceId,prevState,nextState,scope. - Reviewer가 Reject 시 반드시
comment필드를 채우도록 UI에서 Validation. - Model Profile 수정/바인딩은 Audit 카테고리
LLM_MODEL_CHANGE로 기록하며, Provider/Fallback 변경 diff 포함.
상태/권한 정의는 MAO Prompt Ops 0.1 기준이며, 새로운 상태 또는 Role이 추가되면 본 문서를 우선 갱신한다.