
7계층 보호를 갖춘 프로덕션 AI 방어: 수학적 제약, 객체-권한(object-capability) 접근, 분산 O2 합의, SVETILO 윤리. 최초의 오픈소스 ThoughtVirus 방어. BSL 1.1.
다층 AI 방어를 위한 연구 프로토타입: C4 설명 가능성, 앙상블 분류기, 난독화 해제, O₂ 보안 엔진, ThoughtVirus 방어 및 SVETILO 가치 정렬. 알파 등급 — 내부 검증 완료, 외부 감사 대기 중.
버전: 1.0.0-alpha | 상태: 연구 프로토타입 | 라이선스: BSL 1.1 (비프로덕션 무료; 프로덕션 → 상용)
저자: I.G. Selyutin. C4-META 모델 공동 저자: N.I. Kovalev.
제품 정체성 (2026-08): Apache-2.0c4protocol기반으로 구축된 더 무거운 다층 C4 방어 스택(앙상블, O₂ 스캐폴딩, 레드팀 랩)의 BSL 연구 / 상용-심층 프로토타입.
아님: 두 번째 오픈 프로토콜. 아님: 인증된 프로덕션 AGI 방어. 아님: "v8 FINAL".
정직성 감사:docs/AUDIT-c4-meta-system-2026-08.md.
프로모션 경로:docs/PROMOTE-FROM-PROTOCOL.md(c4protocol소비/고정; 얇은 SDK에 앙상블 덤프 없음).
GitLab Pages =public/(EN +public/ru/). 오픈 런타임 확인: c4protocol에서make conformance.
C4-META System은 다음을 구현하는 다층 AI 방어용 연구 프로토타입입니다:
Input Sanitization → Semantic Analysis → Behavioral Analysis → Meta-Observer (O₂)
value_verification.py를 통한 7가지 휴리스틱 실 (훈련된 윤리 모델 아님)┌──────────────────────────────────────────────┐
│ LAYER 1: Input Sanitization │
│ Deobfuscation (homoglyphs, leetspeak, etc.) │
├──────────────────────────────────────────────┤
│ LAYER 2: Semantic Analysis │
│ 4-Classifier Ensemble: ONNX_BERT (~50ms) │
│ + RuleBased + Heuristic + LLM_SEMANTIC │
│ Dual classifier OR-logic (BERT+RuleBased) │
├──────────────────────────────────────────────┤
│ LAYER 3: Behavioral Analysis │
│ 16 AoC Defense Modules (11 original + 5 │
│ extended), Pattern matching, Trajectory │
│ anomaly detection, ThoughtVirus defense │
├──────────────────────────────────────────────┤
│ LAYER 4: Meta-Observer (O₂) │
│ Transfer entropy, BFT consensus, │
│ semantic entanglement, causal graphs, │
│ Kill-Switch, SVETILO value verification │
├──────────────────────────────────────────────┤
│ C4 Core Engine (Z₃³) │
│ pipeline_orchestrator.py, event_bus.py │
│ c4_meta_monitor.py — self-awareness deque │
├──────────────────────────────────────────────┤
│ Defenses: Anti-Deadlock, Anti-Emergence, │
│ Anti-Hijack, Circuit Breaker, O₂ Kill-Switch│
├──────────────────────────────────────────────┤
│ Red Team Lab: AOC scenarios, experiment │
│ runner, LLM client, adapters │
├──────────────────────────────────────────────┤
│ Routing: Smart Router, Quarantine, │
│ Antifragile Scoring (capped growth) │
└──────────────────────────────────────────────┘
4개 분류기 투표:
이중 분류기 OR-로직: BERT + RuleBased가 OR 폴백이 있는 기본 게이트로 작동합니다 — 둘 중 하나라도 입력을 플래그하면 방어 계층으로 진행됩니다. 단일 분류기가 병목이 되지 않습니다.
c4-meta-system/
├── v4_1/
│ ├── core/
│ │ ├── pipeline.py # Main entry points (re-exports)
│ │ ├── __main__.py # HTTP server entrypoint for Docker
│ │ ├── pipeline_stages.py # Individual processing stages
│ │ ├── pipeline_orchestrator.py # Main orchestration (thread-safe)
│ │ ├── result_factory.py # Standardized C4v4Result factory
│ │ ├── event_bus.py # Organic event bus (atexit cleanup)
│ │ └── c4_meta_monitor.py # Z³ self-awareness (deque bounded)
│ ├── security/
│ │ ├── o2_engine.py # O₂ defense (kill-switch self-DoS fixed)
│ │ ├── explainable_o2.py # O₂ explainability (sampling inverted)
│ │ ├── o2_shared.py # Window structures (@mention comms)
│ │ ├── semantic_detector.py # Concept graphs (normalized entanglement)
│ │ ├── secure_debug_endpoints.py # Debug endpoints (UTC + rate limits)
│ │ ├── hardening.py # Model signing / admin token verification
│ │ ├── behavioral_profiler.py # Drift detection (thread-safe singleton)
│ │ ├── distributed_o2.py # SQLite/Redis backend (BEGIN IMMEDIATE)
│ │ ├── swarm_orchestrator.py # Anti-virus swarm
│ │ └── ...
│ ├── defenses/
│ │ ├── anti_deadlock.py # Resource deadlock prevention
│ │ ├── anti_emergence.py # State convergence (async release fixed)
│ │ └── ...
│ ├── redteam/
│ │ ├── orchestrator.py # Main orchestrator (target_callback parsing)
│ │ ├── scenario_manager.py # AOC scenarios management
│ │ ├── adapters/ # LLM backend adapters
│ │ ├── experiment_executor.py # Async execution (FPR logic fixed)
│ │ ├── experiment_services.py # Service locator
│ │ ├── experiment_runner.py # Web UI + REST API
│ │ ├── llm_client.py # Async-safe LLM client (empty choices guarded)
│ │ └── ...
│ ├── classifiers/ # 4-classifier ensemble
│ ├── config/ # Configuration management
│ ├── access/ # Access control
│ ├── explainability/ # C4 explainability
│ ├── learning/ # Learning loop
│ ├── plugins/ # Plugin system
│ ├── quarantine/ # Quarantine management
│ ├── router/ # Smart routing
│ ├── scoring/ # Antifragile scoring
│ └── tests/ # 240 tests (19 test files)
├── formal/ # TLA+ specifications
├── models/ # ONNX model + tokenizer
├── archive/Dockerfile.prepared # Multi-stage production build (archived)
├── Dockerfile.distroless # Distroless-ready builder pattern
├── archive/docker-compose.yml.prepared # Full stack (Ollama + UI + Monitoring) (archived)
├── .dockerignore # Security-hardened exclusion list
├── infra/k8s/ # Kubernetes manifests (hardened)
└── README.md # This file
이 시스템은 환경 인식 구성을 갖춘 컨테이너화를 위해 완전히 준비되어 있습니다.
# Full stack (C4-META + Ollama + UI)
docker compose --profile experiment up -d
# Build image
docker build -t c4-meta-system -f archive/Dockerfile.prepared .
# Run with local Ollama
OLLAMA_BASE_URL=http://host.docker.internal:11434 docker run -p 8080:8080 c4-meta-system
# Red Team runner
docker build -t c4-redteam -f redteam/Dockerfile.redteam.prepared .
docker run -p 8081:8081 c4-redteam
8080에서 GET /health8081에서 GET /healthpip install -r requirements.txt
# Optional Docker deps
pip install -r requirements-docker.txt
python -m v4_1.core
# or explicitly
python -m v4_1.core.__main__
python -m v4_1.redteam.experiment_runner --web --port 8080
o2_engine.py는 O2가 비활성화되었을 때 더 이상 모든 트래픽을 차단하지 않습니다.ThreadPoolExecutor는 이제 atexit을 통해 정리됩니다; 비동기 콜백은 run_coroutine_threadsafe()를 사용합니다.explainable_o2.py는 이제 1 - sample_rate 대신 sample_rate 비율을 올바르게 샘플링합니다.o2_shared.py는 완전 연결 클리크 대신 명시적 @agent 멘션만 기록합니다.semantic_detector.py는 임계값 비교 전에 개념 수를 정규화합니다.blocked/quarantined를 올바르게 파싱합니다.C4 방어 파이프라인의 4개 데이터셋 및 2000개 적대적 변형에 대한 전체 벤치마크 결과.
전체 보고서는 c4protocol/BENCHMARK_RESULTS.md에서 확인하세요.
참고: 분산 O₂는 프로덕션에서 Redis 클러스터가 필요합니다. 개발용 단일 노드 모드 사용 가능 (배포 가이드 참조).
C4-META의 방어는 강력합니다 — 하지만 완벽한 시스템은 없습니다. 앙상블 분류기, AoC 방어 모듈 또는 O₂ 엔진을 우회하는 프롬프트를 찾으면 저희에게 알려주세요.
우회 사례 신고:
필요한 정보: 우회 프롬프트, 예상 응답, 그리고 실패한 방어 계층. 모든 신고자는 보안 명예의 전당에서 인정받게 됩니다.
C4-META v1.0.0-alpha — 다층 AI 방어 연구 프로토타입. 내부 검증 완료. 외부 감사 대기 중.
access/capabilities.py와 security/hardening.py 모두 bcrypt 및 SHA256을 지원합니다.ModelIntegrityVerifier는 C4_MODEL_SIGNING_KEY가 설정되지 않은 경우 RuntimeError를 발생시킵니다.explainable_o2.py 데드락 제거 (더 이상 이벤트 루프 스레드를 차단하지 않음).distributed_o2.py 정규식이 실제로 로컬호스트 전용 Redis URL을 강제하도록 수정되었습니다.process_message()에서 _active_threat 읽기가 이제 잠금으로 보호됩니다.save_to_file / load_from_file는 이제 잘못된 접두사 검사 대신 안전한 기본 디렉터리를 기준으로 경로를 해석합니다.phase3.py는 항상 두 피연산자를 해시하여 길이 분기에서 타이밍 부채널을 제거합니다.experiment_reporter, decision_logger, orchestrator, experiment_runner 및 hardening.py의 모든 JSON/JSONL/텍스트 쓰기가 임시 파일 + 원자적 이름 변경을 사용합니다.archive/Dockerfile.prepared는 이제 K8s runAsUser와 일치하도록 UID/GID 1000에서 사용자/그룹을 명시적으로 생성합니다.deployment.yaml은 API 키 주입을 위해 c4-meta-api-keys 시크릿을 참조합니다; secrets.yaml에 예제 매니페스트 추가.disable() 및 reenable()는 CIRCUIT_BREAKER_AUTH_TOKEN 해시를 요구합니다.vote_debug()는 상수 시간 비교로 C4_ADMIN_TOKEN_HASH를 검증합니다.SentimentExtractor는 더 이상 단어를 중복 제거하지 않습니다; ComplexityExtractor는 [0, 1]로 클램프합니다._goal_history 제거; OmegaPrioritizer는 O(1) 축출을 위해 deque(maxlen=1000)을 사용합니다.ConvergenceMonitor와 PhiAttractorCalculator 사이의 중첩 잠금 제거.o2_shared.py는 순진한(naive) datetime 대신 datetime.now(timezone.utc)를 사용합니다._regenerate_session 프라이빗 메서드 제거.{"status": "simulated"} 대신 실제 공격 구현으로 디스패치합니다._active_threat는 이제 창 분석이 안전할 때 해제됩니다; 첫 탐지 후 영구적으로 고정되지 않습니다.vote_result.is_dangerous=True는 이제 ALLOW로 빠지는 대신 차단 결과를 반환합니다.anon_anonymous를 통한 교차 사용자 상태 오염 제거.get_access_controller()는 이제 초기화 시 경쟁 조건을 방지하기 위해 이중 확인 잠금(double-checked locking)을 사용합니다.get_learning_loop()는 이제 초기화 시 경쟁 조건을 방지하기 위해 이중 확인 잠금을 사용합니다.pending_operations 및 approved_operations가 threading.Lock으로 보호됩니다.pending 딕셔너리가 threading.Lock으로 보호됩니다./chat/completions 대신 /v1/chat/completions로 수정.time.time() 대신 time.monotonic()을 사용합니다.asyncio.get_event_loop()에 대한 폴백 제거._analyze_window()에서 _last_result 쓰기가 이제 잠금으로 보호됩니다._compile_*_regex()는 이제 전달된 patterns 매개변수를 무시하는 대신 사용합니다.filter_attack_prompt()는 이제 통계를 이중 계산하는 대신 단일 필터 호출을 수행합니다._get_lock()은 asyncio.Lock 생성 시 경쟁을 방지하기 위해 스레딩 잠금을 사용합니다.snapshot_cognition()은 변경 가능한 참조 대신 C4Coordinate의 복사본을 저장합니다.transition_to()는 참조를 유지하는 대신 들어오는 C4Coordinate를 복사합니다._save_results()는 경로 해석 전에 순회를 확인하고 경로가 기본 디렉터리 내에 유지되도록 보장합니다.create_session()은 기존 세션 ID를 반환하기 전에 사용자 소유권을 확인합니다.retryable_exceptions가 (Exception,)에서 (ConnectionError, TimeoutError, OSError)로 변경._audit_log는 이제 무제한 증가를 방지하기 위해 deque(maxlen=10000)을 사용합니다.revoke_all_for_subject()는 일관된 잠금 순서(revoked → used)를 사용합니다.verify_admin_token()은 검증 시 토큰 소진을 방지하기 위해 consume_single_use=False를 전달합니다.reach_consensus()가 이제 threading.Lock으로 보호됩니다.generate_random_string()은 random 대신 secrets.SystemRandom()을 사용합니다._describe_z_state()가 T=-1을 올바르게 처리합니다.reset_threat_state()는 이제 실제로 manual_quarantine 및 긴급 상태를 해제합니다.unquarantine_agent()는 에이전트가 실제로 격리되었을 때만 감사합니다.build_report()는 control_metrics와 동일한 패턴으로 빈 treatment_metrics를 방어합니다.antifragile_growth가 1,000,000.0으로 제한됩니다.| 메트릭 | 값 |
|---|
| 적대적 탐지율 | 80.3% |
| 견고성 점수 | 1.25 |
| 정상 탐지 (AoC) | 70.9% |
| 오탐률 | 14.6% |
| LLM C4 차단율 | 96.7% |
| GPT-4o-mini ASR 감소 | 10.7% → 0.7% (93.2%) |
| Mistral 7B ASR 감소 | 22.5% → 0.5% (97.6%) |
| 메트릭 | 값 |
|---|
| 버전 | 1.0.0 FINAL |
| 상태 | 연구 프로토타입 (내부 검증 완료) |
| 테스트 | 240개 테스트 (19개 테스트 파일) |
| 분류기 | 4개 (ONNX_BERT, RuleBased, Heuristic, LLM_SEMANTIC) |
| 방어 계층 | 4개 (입력 정화 → 의미 → 행동 → 메타 옵저버) |
| AoC 방어 | 16개 (기본 11개 + 확장 5개) |
| ThoughtVirus | 2계층 방어 (정규식 + C4 궤적) |
| SVETILO | 7개 실 통합 |
| 버그 수정 | 감사 라운드에 걸쳐 60+건 해결 |
| Docker 빌드 | 통과 (멀티스테이지, distroless 준비) |
| K8s 매니페스트 | 준비 완료 (secretKeyRef로 강화) |
| 라이선스 | BSL 1.1 |