Claude Platform Docs
  • Messages
  • Managed Agents
  • 관리자

Search...
⌘K
첫 단계
개요빠른 시작Console에서 프로토타입 제작
에이전트 정의
에이전트 설정도구MCP 커넥터권한 정책Agent Skills
에이전트 환경 구성
클라우드 환경 설정클라우드 샌드박스 레퍼런스
에이전트에 작업 위임
세션 시작세션 작업세션 이벤트 스트림웹훅 구독결과 정의볼트로 인증
에이전트 컨텍스트 관리
GitHub 액세스파일 첨부 및 다운로드
고급 오케스트레이션
멀티 에이전트 세션예약 배포
레퍼런스
Managed Agents 레퍼런스
파일 작업
Files APIPDF 지원
스킬
개요모범 사례엔터프라이즈용 스킬
MCP
원격 MCP 서버
클라우드 플랫폼의 Claude
AWS의 Claude Platform

Log in
파일 첨부 및 다운로드
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude Platform Docs

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Claude on AWS
  • Claude on Google Cloud

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
Managed Agents/에이전트 컨텍스트 관리

파일 추가하기

파일을 업로드하고 샌드박스에 마운트하여 읽고 처리할 수 있습니다.

Files API를 통해 파일을 업로드하고 세션의 샌드박스에 마운트하여 에이전트에 파일을 제공할 수 있습니다.



모든 Managed Agents API 요청에는 managed-agents-2026-04-01 베타 헤더가 필요합니다. SDK는 베타 헤더를 자동으로 설정합니다.

파일 업로드하기

먼저 Files API를 사용하여 파일을 업로드하세요:

file = client.beta.files.upload(file=Path("data.csv"))
print(f"File ID: {file.id}")

세션에 파일 마운트하기

세션을 생성할 때 resources 배열에 파일을 추가하여 업로드된 파일을 샌드박스에 마운트하세요:



mount_path는 선택 사항이지만, 에이전트가 파일을 식별할 수 있도록 업로드된 파일에 설명적인 이름을 지정해야 합니다.

session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    resources=[
        {
            "type": "file",
            "file_id": file.id,
            "mount_path": "/workspace/data.csv",
        },
    ],
)

세션 내 파일 인스턴스를 참조하는 새로운 file_id가 생성됩니다. 이러한 복사본은 스토리지 한도에 포함되지 않습니다.

여러 파일

resources 배열에 항목을 추가하여 여러 파일을 마운트하세요:

resources = [
    {"type": "file", "file_id": "file_abc123", "mount_path": "/workspace/data.csv"},
    {"type": "file", "file_id": "file_def456", "mount_path": "/workspace/config.json"},
    {"type": "file", "file_id": "file_ghi789", "mount_path": "/workspace/src/main.py"},
]

세션당 최대 100개의 파일이 지원됩니다.

실행 중인 세션에서 파일 관리하기

세션 리소스 API를 사용하여 세션 생성 후에도 파일을 추가하거나 제거할 수 있습니다. 각 리소스는 추가(또는 조회)될 때 반환되는 id를 가지며, 이를 삭제에 사용합니다.

resource = client.beta.sessions.resources.add(
    session.id,
    type="file",
    file_id=file.id,
)
print(resource.id)  # "sesrsc_01ABC..."

resources.list를 사용하여 세션의 모든 리소스를 조회하세요. 파일을 제거하려면 리소스 ID와 함께 resources.delete를 호출하세요:

listed = client.beta.sessions.resources.list(session.id)
for entry in listed.data:
    print(entry.id, entry.type)

client.beta.sessions.resources.delete(resource.id, session_id=session.id)

세션 파일 조회 및 다운로드하기

Files API를 사용하여 세션 범위의 파일을 조회하고 다운로드하세요.

# 세션과 연결된 파일 나열
files = client.beta.files.list(
    scope_id="sesn_abc123",
    betas=["managed-agents-2026-04-01"],
)
for f in files:
    print(f.id, f.filename)

# 파일 다운로드
content = client.beta.files.download(files.data[0].id)
content.write_to_file("output.txt")

지원되는 파일 형식

에이전트는 다음을 포함한 모든 파일 형식으로 작업할 수 있습니다:

  • 소스 코드 (.py, .js, .ts, .go, .rs 등)
  • 데이터 파일 (.csv, .json, .xml, .yaml)
  • 문서 (.txt, .md)
  • 아카이브 (.zip, .tar.gz) - 에이전트가 bash를 사용하여 압축을 해제할 수 있습니다
  • 바이너리 파일 - 에이전트가 적절한 도구로 처리할 수 있습니다

파일 경로



샌드박스에 마운트된 파일은 읽기 전용 복사본입니다. 에이전트는 이를 읽을 수 있지만 원본 업로드 파일을 수정할 수는 없습니다. 수정된 버전으로 작업하려면 에이전트가 샌드박스 내의 새 경로에 파일을 작성합니다.

  • 파일은 지정한 정확한 경로에 마운트됩니다
  • 상위 디렉터리는 자동으로 생성됩니다
  • 경로는 절대 경로여야 합니다(/로 시작)

Was this page helpful?

  • 파일 업로드하기
  • 세션에 파일 마운트하기
  • 여러 파일
  • 실행 중인 세션에서 파일 관리하기
  • 세션 파일 조회 및 다운로드하기
  • 지원되는 파일 형식
  • 파일 경로