라벨이 Anthropic인 게시물 표시

Harness Engineering in Practice — How Anthropic Designs AI Agents

Harness Engineering in Practice — How Anthropic Designs AI Agents The previous post covered the concept and components of harness engineering. This time, it's the real thing. Drawing on the concrete architecture patterns Anthropic published in their official engineering blog — along with experimental results from the OpenAI Codex team — let's look at how harnesses are actually applied in practice. The Basic Structure of an Agent Loop: The Inner Loop At the heart of every AI agent sits an agent loop . In Claude Code, it's called queryLoop . At its core, it's a while(true) loop. while (true) { 1. Prepare context (plan-mode attachments, task reminders) 2. Call the model (streaming API call) 3. Execute tools (detect tool call → validate schema → check permissions → execute) 4. Decide whether to continue (does the model have more to do?) } Each iteration is one "think, act, observe" cycle. The model thinks, invokes a tool, observes the resul...

하네스 엔지니어링 적용편 — Anthropic은 AI 에이전트를 어떻게 설계했나

하네스 엔지니어링 적용편 — Anthropic은 AI 에이전트를 어떻게 설계했나 이전 글에서 하네스 엔지니어링의 개념과 구성 요소를 다뤘다. 이번에는 실전이다. Anthropic이 공식 엔지니어링 블로그에서 공개한 구체적인 아키텍처 패턴들과, OpenAI Codex 팀의 실험 결과를 바탕으로 하네스가 실제로 어떻게 적용되는지 살펴본다. 에이전트 루프의 기본 구조: Inner Loop 모든 AI 에이전트의 심장에는 에이전트 루프(Agent Loop) 가 있다. Claude Code에서는 이것을 queryLoop 라고 부른다. 본질적으로 while(true) 루프다. while (true) { 1. 컨텍스트 준비 (계획 모드 첨부파일, 작업 리마인더) 2. 모델 호출 (스트리밍 API 호출) 3. 도구 실행 (도구 호출 감지 → 스키마 검증 → 권한 확인 → 실행) 4. 계속 결정 (모델이 더 할 일이 있는가?) } 각 반복이 하나의 "사고 → 행동 → 관찰" 사이클이다. 모델이 생각하고, 도구를 호출하고, 결과를 관찰하고, 다시 생각한다. 도구 실행 흐름 은 이렇다: 모델이 출력에서 도구 호출을 생성 하네스가 도구 호출을 감지하고 텍스트 생성을 중지 입력을 스키마(Zod 검증 JSON Schema)에 대해 검증 권한 파이프라인 실행 (일반 규칙 → 도구별 체크 → 자동 분류기 → 사용자 승인 폴백) 도구 핸들러가 작업 실행 결과가 모델의 컨텍스트에 다시 주입 루프 계속 이것이 Inner Loop다. 대부분의 간단한 작업은 이 루프 안에서 완료된다. 하지만 복잡한 작업, 특히 여러 시간이 걸리는 장기 실행 작업에서는 이것만으로 부족하다. 컨텍스트 윈도우가 가득 차고, 모델의 추론 능력이 저하된다. Outer Loop: Ralph Loop 패턴 Anthropic이 장기 실행 작업을 위해 개발한 것이 Ralph Loop 패턴이다. 아이디어는 단순하다. 모델이 작업을 끝내려고 할...