shift-camouflage
정보
시프트-캐모플라지 기술은 개발자가 서로 다른 소비자에게 다른 API와 동작을 제공하는 적응형, 다형성 인터페이스를 가진 시스템을 구축할 수 있게 합니다. 이 기술은 컨텍스트 인식 기능 노출, 공격 표면 축소, 인터페이스 수준에서 기능 플래그나 점진적 롤아웃 구현에 사용됩니다. 이 접근법은 시스템이 핵심 로직을 변경하지 않고도 외부 노출 방식을 동적으로 조정할 수 있게 합니다.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/shift-camouflageClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Shift Camouflage
Implement adaptive surface transformation — polymorphic interfaces, context-aware behavior, dynamic presentation — inspired by cuttlefish chromatophores. System's surface adapts to environment while core stays stable. Reduces attack surface, optimizes interaction with diverse observers.
When Use
- System must present different interfaces to different consumers (API versioning, multi-tenant, role-based)
- Reduce attack surface by exposing only what each observer needs see
- Implement feature flags, progressive rollouts, or A/B testing at interface level
- System needs adapt behavior to environmental context without core changes
- Protect internal architecture from external coupling (observers couple to surface, not structure)
- Complement
adapt-architecturewhen surface change is sufficient and deep transformation unnecessary
Inputs
- Required: System whose surface needs adaptation
- Required: Observers/consumers and their different interface needs
- Optional: Current interface design and limitations
- Optional: Threat model (what should be hidden from which observers?)
- Optional: Feature flag system or progressive rollout infrastructure
- Optional: Performance constraints (dynamic surface generation has overhead)
Steps
Step 1: Map Observer Landscape
Identify who interacts with system, what each observer needs see.
- Catalog all observers:
- External users (end users, API consumers, partners)
- Internal services (microservices, background jobs, admin tools)
- Adversaries (attackers, scrapers, competitors)
- Regulators (auditors, compliance checks)
- For each observer, define:
- What they need to see (required interface surface)
- What they should not see (hidden surface)
- What they expect to see (compatibility surface — may differ from what they need)
- How they interact (protocol, frequency, sensitivity)
- Create the observer-surface matrix:
Observer-Surface Matrix:
┌──────────────┬────────────────────────┬─────────────────┬──────────────┐
│ Observer │ Required Surface │ Hidden Surface │ Threat Level │
├──────────────┼────────────────────────┼─────────────────┼──────────────┤
│ End users │ Public API v2, UI │ Internal APIs, │ Low │
│ │ │ admin endpoints │ │
├──────────────┼────────────────────────┼─────────────────┼──────────────┤
│ Partner API │ Partner API, webhooks │ Internal logic, │ Medium │
│ │ │ user data │ │
├──────────────┼────────────────────────┼─────────────────┼──────────────┤
│ Admin tools │ Full API, debug │ Raw data store │ Low │
│ │ endpoints │ access │ │
├──────────────┼────────────────────────┼─────────────────┼──────────────┤
│ Adversaries │ Nothing (minimal) │ Everything │ High │
│ │ │ possible │ │
└──────────────┴────────────────────────┴─────────────────┴──────────────┘
Got: Complete observer landscape with surface requirements per observer. Drives all subsequent camouflage design.
If fail: Observer identification incomplete? Start with two extremes: most privileged observer (admin) and most restricted (adversary). Design surfaces for these two, interpolate for observers between.
Step 2: Design Chromatophore Mapping
Create mapping between observer context and surface presentation — the "chromatophore" layer.
- Define context signals:
- Authentication identity → determines privilege level
- Request origin → geographic, network, or application context
- Feature flags → enables/disables specific surface elements
- Time/phase → deployment stage, business hours, maintenance windows
- Load/health → degraded mode may present reduced surface
- Design the surface generation rules:
- For each combination of context signals, define which surface elements are:
- Visible: included in the response/interface
- Hidden: excluded entirely (not even error messages reveal their existence)
- Transformed: present but modified for this observer (different schema, simplified data)
- Decoy: deliberately misleading surface elements for adversarial contexts
- For each combination of context signals, define which surface elements are:
- Implement the chromatophore layer:
- A thin middleware/proxy that sits between the core system and observers
- Evaluates context signals on each request
- Applies the appropriate surface configuration
- Never modifies core behavior — only filters and transforms the surface
Chromatophore Architecture:
┌──────────────────────────────────────────────────────┐
│ Observer Request │
│ │ │
│ ↓ │
│ ┌─────────────────┐ │
│ │ Context Extract │ ← Auth, origin, flags, time │
│ └────────┬────────┘ │
│ ↓ │
│ ┌─────────────────┐ │
│ │ Surface Select │ ← Observer-surface matrix lookup │
│ └────────┬────────┘ │
│ ↓ │
│ ┌─────────────────┐ │
│ │ Core System │ ← Processes request normally │
│ └────────┬────────┘ │
│ ↓ │
│ ┌─────────────────┐ │
│ │ Surface Filter │ ← Remove/transform/add elements │
│ └────────┬────────┘ │
│ ↓ │
│ Observer Response (adapted surface) │
└──────────────────────────────────────────────────────┘
Got: Chromatophore mapping translates observer context into surface config. Mapping explicit, auditable, separate from core logic.
If fail: Mapping becomes too complex (too many context combinations)? Simplify to role-based surfaces: define 3-5 surface profiles (public, partner, admin, internal, minimal), map every observer to one profile.
Step 3: Implement Behavioral Polymorphism
Make system's behavior adapt to context, not just surface appearance.
- Identify context-dependent behaviors:
- Response detail level (verbose for admin, minimal for public)
- Rate limiting (generous for partners, strict for unknown callers)
- Error messages (detailed for internal, generic for external)
- Data freshness (real-time for premium, cached for standard)
- Feature availability (full for beta testers, stable-only for general)
- Implement behavioral variants:
- Each variant is a complete, tested behavior path
- Context determines which variant executes
- Variants share core logic but differ in presentation and policy
- Feature flag integration:
- Feature flags control which behavioral variants are active
- Progressive rollout: expose new behavior to a percentage of observers, increasing over time
- Circuit breakers: automatically revert to safe behavior if the new variant causes errors
Got: System's behavior adapts to observer context — same core logic produces appropriate responses for different audiences. Feature flags enable progressive rollout of new behaviors.
If fail: Behavioral polymorphism creates too many code paths? Consolidate to pipeline model: core logic → policy layer → presentation layer. Polymorphism lives in policy and presentation layers only, keeping core logic singular.
Step 4: Reduce Attack Surface
Minimize what adversaries can observe and interact with.
- Apply the principle of least surface:
- Each observer sees only what they need — nothing more
- Unauthenticated observers see the minimum possible surface
- Error messages never leak internal structure (no stack traces, no internal paths, no version numbers)
- Implement active surface reduction:
- Remove default pages, headers, and endpoints that reveal technology stack
- Randomize non-essential response characteristics (timing jitter, header order)
- Disable unused API endpoints entirely (not just hidden — actually off)
- Deploy pattern disruption:
- Vary response characteristics to defeat fingerprinting
- Introduce controlled unpredictability in non-functional aspects
- Ensure that functional behavior remains deterministic while surface characteristics vary
- Monitor for reconnaissance:
- Detect patterns of requests that probe for hidden surface (enumeration attacks)
- Alert on repeated access to non-existent endpoints (path fuzzing)
- Track and correlate reconnaissance patterns across sessions (see
defend-colony)
Got: Minimal attack surface — adversaries cannot easy determine system's technology stack, internal structure, or hidden capabilities. Reconnaissance attempts detected and tracked.
If fail: Surface reduction breaks legitimate consumers? Observer-surface matrix incomplete — legitimate needs hidden. Review Step 1, update matrix. Randomization causes issues? Reduce randomization to non-functional aspects only (timing, headers), keep functional responses deterministic.
Step 5: Maintain Surface Coherence
Ensure dynamic surface stays consistent, debuggable, maintainable.
- Surface testing:
- Test each observer profile explicitly (does admin see admin surface? does public see public surface?)
- Test surface transitions (what happens when an observer's context changes mid-session?)
- Test surface failure modes (what surface appears if the chromatophore layer fails?)
- Surface documentation:
- Document each observer profile and its surface configuration
- Document the context signals and their effects on surface selection
- Keep documentation in sync with actual behavior (test documentation against reality)
- Debugging support:
- Admin/debug mode reveals which surface profile is active and why
- Logging captures which surface configuration was applied to each request
- Ability to replay a request through a specific surface profile for debugging
- Surface evolution:
- Adding new surface elements: add to the appropriate profiles, test, deploy
- Removing surface elements: deprecation warning period, then removal
- Changing surface behavior: feature flag controlled, progressive rollout
Got: Maintainable, testable, well-documented surface adaptation system. Dynamic nature does not compromise ability to debug, document, or evolve interfaces.
If fail: Chromatophore layer becomes debugging nightmare? Add transparency: every response includes trace header (visible only to admin/debug profile) showing which surface profile applied and which context signals determined it.
Checks
- Observer landscape mapped with surface requirements per observer
- Chromatophore mapping translates context to surface config
- Behavioral polymorphism adapts responses to observer context
- Attack surface minimized for adversarial observers
- Each observer profile explicitly tested
- Surface failure mode presents safe default (minimal surface)
- Debug/admin mode can inspect active surface config
- Surface docs match actual behavior
Pitfalls
- Surface complexity explosion: Too many observer profiles with too many variations. Consolidate to 3-5 profiles max. Most observers fit broad categories
- Core contamination: Letting surface adaptation logic leak into core business logic. Chromatophore layer must be separate — adding if-statements about observer type in core code? Architecture wrong
- Security through obscurity alone: Surface reduction defense-in-depth layer, not replacement for proper security controls. Hidden endpoint still needs auth and authz
- Inconsistent surfaces: Observer A sees version 1 of response, observer B sees version 2 — but supposed to see same thing. Test surfaces explicit, keep observer-surface matrix authoritative
- Forget failure surface: When chromatophore layer itself fails, what surface does observer see? Default must be safe (minimal surface) not open (full surface)
See Also
assess-form— surface adaptation may resolve pressure identified in form assessment without requiring deep transformationadapt-architecture— deep structural change for when surface adaptation insufficientrepair-damage— surface adaptation can mask damage during repair (caution — never hide real problems)defend-colony— attack surface reduction defense layer; reconnaissance detection feeds into defensecoordinate-swarm— context-aware behavior in distributed systems needs coordinated surface adaptationconfigure-api-gateway— API gateways implement many chromatophore layer functions in practicedeploy-to-kubernetes— Kubernetes services and ingress enable network-level surface control
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
