mirror of
https://github.com/sanbuphy/claude-code-source-code.git
synced 2026-04-03 11:34:54 +08:00
4.4 KiB
4.4 KiB
언더커버 모드 분석
인터넷에 공개된 자료와 커뮤니티 토론을 바탕으로 정리된 Claude Code v2.1.88 분석 보고서.
언더커버 모드란?
언더커버 모드는 공식 직원이 외부/오픈소스 저장소에서 작업할 때 사용되는 안전 보호 메커니즘입니다. 활성화되면 내부 특화 AI 모델 정보와 저작 표시를 숨겨 제출된 코드가 인간 개발자의 기여와 동일하게 보이도록 합니다. 이는 주로 내부 기밀 및 미출시 모델의 이름이 오픈소스 커뮤니티에 유출되는 것을 방지하기 위함입니다.
출처: src/utils/undercover.ts
활성화 조건
// src/utils/undercover.ts:28-37
export function isUndercover(): boolean {
if (process.env.USER_TYPE === 'ant') {
if (isEnvTruthy(process.env.CLAUDE_CODE_UNDERCOVER)) return true
// Auto: 내부 저장소로 확인되지 않으면 자동 활성화
return getRepoClassCached() !== 'internal'
}
return false
}
주요 특성:
- 내부 전용: 공식 직원(
USER_TYPE === 'ant')만 해당 - 기본 활성화: 내부 허용 목록에 없는 모든 저장소에서 자동 활성화
- 강제 비활성화 불가: "There is NO force-OFF. This guards against model codename leaks"
- 외부 빌드: 번들러에 의해 데드 코드 제거됨; 실행되지 않음
모델에 전달되는 프롬프트
// src/utils/undercover.ts:39-69
export function getUndercoverInstructions(): string {
return `## UNDERCOVER MODE — CRITICAL
You are operating UNDERCOVER in a PUBLIC/OPEN-SOURCE repository. Your commit
messages, PR titles, and PR bodies MUST NOT contain ANY Anthropic-internal
information. Do not blow your cover.
NEVER include in commit messages or PR descriptions:
- Internal model codenames (animal names like Capybara, Tengu, etc.)
- Unreleased model version numbers (e.g., opus-4-7, sonnet-4-8)
- Internal repo or project names (e.g., claude-cli-internal, anthropics/…)
- Internal tooling, Slack channels, or short links (e.g., go/cc, #claude-code-…)
- The phrase "Claude Code" or any mention that you are an AI
- Any hint of what model or version you are
- Co-Authored-By lines or any other attribution
Write commit messages as a human developer would — describe only what the code
change does.
GOOD:
- "Fix race condition in file watcher initialization"
- "Add support for custom key bindings"
BAD (never write these):
- "Fix bug found while testing with Claude Capybara"
- "1-shotted by claude-opus-4-6"
- "Generated with Claude Code"
- "Co-Authored-By: Claude Opus 4.6 <…>"`
}
저작 표시 시스템
저작 표시 시스템(src/utils/attribution.ts, src/utils/commitAttribution.ts)은 언더커버 모드를 보완한다:
// src/utils/attribution.ts:70-72
// @[MODEL LAUNCH]: 아래 하드코딩된 폴백 모델 이름 업데이트
// (코드네임 유출 방지용).
// 외부 저장소에서 인식되지 않는 모델은 "Claude Opus 4.6"으로 폴백.
// src/utils/model/model.ts:386-392
function maskModelCodename(baseName: string): string {
// e.g. capybara-v2-fast → cap*****-v2-fast
const [codename = '', ...rest] = baseName.split('-')
const masked = codename.slice(0, 3) + '*'.repeat(Math.max(0, codename.length - 3))
return [masked, ...rest].join('-')
}
시사점
오픈소스에 대한 영향
공식 직원이 Claude Code로 오픈소스 프로젝트에 기여할 때:
- AI가 코드를 작성하지만 커밋은 사람이 작성한 것으로 표시된다
- "Co-Authored-By: Claude" 저작 표시가 없다
- "Generated with Claude Code" 마커가 없다
- 프로젝트 메인테이너와 커뮤니티는 AI 생성 기여를 식별할 수 없다
- 이는 AI 기여에 관한 오픈소스 투명성 규범을 잠재적으로 위반한다
공식 보호 목적
명시된 주요 목적은 다음의 우발적 유출 방지:
- 내부 모델 코드네임 (경쟁 정보)
- 미공개 버전 번호 (시장 타이밍)
- 내부 인프라 세부 정보 (보안)
윤리적 고려사항
"Do not blow your cover(정체를 들키지 마라)"라는 표현은 AI를 잠입 요원으로 프레이밍한다. 공개 코드 기여에서의 의도적인 AI 저작 은폐는 다음과 같은 질문을 제기한다:
- 오픈소스 커뮤니티에서의 투명성
- 프로젝트 기여 가이드라인 준수 여부
- 영업비밀 보호와 기만 사이의 경계