에이전트 정의하기

에이전트 정의하기 (Define your agent)

에이전트는 페르소나와 기능을 정의하는, 재사용 가능하고 버전이 관리되는 구성이에요. 모델, 시스템 프롬프트, 도구, MCP 서버, 스킬을 하나로 묶어서 세션 중에 클로드가 어떻게 행동할지를 결정해 주죠. 에이전트를 한 번 만들어 재사용 가능한 리소스로 두고, 세션을 시작할 때마다 ID로 참조하면 돼요. 버전이 관리되기 때문에 많은 세션에 걸쳐 관리하기도 훨씬 쉬워요.

출처: 문서

본문

에이전트는 페르소나와 기능을 정의하는 재사용 가능하고 버전이 관리되는 구성이에요. 세션 중 클로드의 행동을 결정하는 모델, 시스템 프롬프트, 도구, MCP 서버, 스킬을 한 데 묶어요.

에이전트를 재사용 가능한 리소스로 한 번 만들고, 세션을 시작할 때마다 ID로 참조하세요. 에이전트는 버전이 관리되며 많은 세션에 걸쳐 관리하기가 더 쉬워요.

Agent configuration fields

Field Description
name Required. A human-readable name for the agent.
model Required. The Claude model that powers the agent. Accepts a model ID string or an object, for example {"id": "claude-opus-5"}. Claude 4.5 and later models are supported. The object form also accepts speed, effort, and inference_geo fields; see the tips under Create an agent, Effort levels, and Pin the inference geo.
system A system prompt that defines the agent's behavior and persona. The system prompt is distinct from user messages, which should describe the work to be done.
tools The tools available to the agent. Combines pre-built agent tools, MCP tools, and custom tools.
mcp_servers MCP servers that provide standardized third-party capabilities.
skills Skills that supply domain-specific context with progressive disclosure.
multiagent A coordinator declaration listing the agents this agent can delegate to. See Multiagent orchestration.
description A description of what the agent does.
metadata Arbitrary key-value pairs for your own tracking.

단일 세션에 한해 model, system, tools, mcp_servers, skills를 에이전트를 바꾸지 않고 오버라이드할 수도 있어요. 세션별 model 오버라이드 안에 설정한 effort 레벨은 적용되지 않아요. 또한 오버라이드는 에이전트의 model 객체를 통째로 대체하므로, model 오버라이드로 만든 세션은 모델의 기본 effort 레벨로 실행돼요. 특정 effort 레벨로 실행하려면 에이전트에 effort를 설정하고 그 세션에서는 model을 오버라이드하지 마세요. 자세한 내용은 Override agent configuration for a session를 참고하세요.

Create an agent

다음 예시는 클로드 Opus 5를 사용하고 미리 빌드된 에이전트 도구세트에 접근하는 코딩 에이전트를 정의해요. 이 도구세트는 에이전트가 코드를 작성하고, 파일을 읽고, 웹을 검색하는 등의 일을 할 수 있게 해요. 지원되는 도구 전체 목록은 agent tools reference를 참고하세요.

예시는 curl, ant CLI, 또는 SDK 중 하나를 사용해요. 아직 설정하지 않았다면 quickstart에서 설치와 클라이언트 설정을 다룹니다.

```bash cURL agent=$(curl -fsSL https://api.anthropic.com/v1/agents \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d '{ "name": "Coding Assistant", "model": "claude-opus-5-5", "system": "You are a helpful coding agent.", "tools": [{"type": "agent_toolset_20260401"}] }')

AGENT_ID=$(jq -r '.id' <<< "$agent") AGENT_VERSION=$(jq -r '.version' <<< "$agent")


<MultiFileExample language="cli" label="CLI">
  ```bash CLI
  ant apply coding-assistant.md
  ```

  <File filename="coding-assistant.md">
    ```markdown
    ---
    name: Coding Assistant
    model: claude-opus-5-5
    tools:
      - type: agent_toolset_20260401
    ---

    You are a helpful coding agent.
    ```
  </File>
</MultiFileExample>

```python Python
agent = client.beta.agents.create(
    name="Coding Assistant",
    model="claude-opus-5-5",
    system="You are a helpful coding agent.",
    tools=[
        {"type": "agent_toolset_20260401"},
    ],
)
const agent = await client.beta.agents.create({
  name: "Coding Assistant",
  model: "claude-opus-5-5",
  system: "You are a helpful coding agent.",
  tools: [{ type: "agent_toolset_20260401" }],
});
var agent = await client.Beta.Agents.Create(new()
{
    Name = "Coding Assistant",
    Model = BetaManagedAgentsModel.ClaudeOpus5_5,
    System = "You are a helpful coding agent.",
    Tools =
    [
        new BetaManagedAgentsAgentToolset20260401Params
        {
            Type = "agent_toolset_20260401",
        },
    ],
});
agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{
	Name: "Coding Assistant",
	Model: anthropic.BetaManagedAgentsModelConfigParams{
		ID: anthropic.BetaManagedAgentsModelClaudeOpus5_5,
	},
	System: anthropic.String("You are a helpful coding agent."),
	Tools: []anthropic.BetaAgentNewParamsToolUnion{{
		OfAgentToolset20260401: &anthropic.BetaManagedAgentsAgentToolset20260401Params{
			Type: anthropic.BetaManagedAgentsAgentToolset20260401ParamsTypeAgentToolset20260401,
		},
	}},
})
if err != nil {
	panic(err)
}
var agent = client.beta().agents().create(
    AgentCreateParams.builder()
        .name("Coding Assistant")
        .model(BetaManagedAgentsModel.CLAUDE_OPUS_5_5)
        .system("You are a helpful coding agent.")
        .addTool(
            BetaManagedAgentsAgentToolset20260401Params.builder()
                .type(BetaManagedAgentsAgentToolset20260401Params.Type.AGENT_TOOLSET_20260401)
                .build()
        )
        .build()
);
$agent = $client->beta->agents->create(
    name: 'Coding Assistant',
    model: 'claude-opus-5-5',
    system: 'You are a helpful coding agent.',
    tools: [
        BetaManagedAgentsAgentToolset20260401Params::with(
            type: 'agent_toolset_20260401',
        ),
    ],
);
agent = client.beta.agents.create(
  name: "Coding Assistant",
  model: "claude-opus-5-5",
  system_: "You are a helpful coding agent.",
  tools: [{type: "agent_toolset_20260401"}]
)
[`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply) creates the agent from `coding-assistant.md`, prints its ID, and records it in `claude-lock.json`. Commit `claude-lock.json` so the next `ant apply` updates this agent instead of creating a second one.

응답은 여러분의 구성을 그대로 반영하고 id, type, version, created_at, updated_at, archived_at 필드를 추가하며, 생략한 model 필드(예: effort)에는 기본값을 채워 넣어요. version은 1에서 시작하며, 업데이트가 에이전트를 변경할 때마다 1씩 증가해요.

{
  "id": "agent_01HqR2k7vXbZ9mNpL3wYcT8f",
  "type": "agent",
  "name": "Coding Assistant",
  "model": {
    "id": "claude-opus-5-5",
    "effort": { "type": "high" },
    "speed": "standard"
  },
  "system": "You are a helpful coding agent.",
  "description": null,
  "tools": [
    {
      "type": "agent_toolset_20260401",
      "default_config": {
        "permission_policy": { "type": "always_allow" }
      }
    }
  ],
  "skills": [],
  "mcp_servers": [],
  "multiagent": null,
  "metadata": {},
  "version": 1,
  "created_at": "2026-04-03T18:24:10.412Z",
  "updated_at": "2026-04-03T18:24:10.412Z",
  "archived_at": null
}

도구세트의 default_config는 여러분이 별도로 구성하지 않는 한 적용되는 기본 permission policyalways_allow를 보여줘요.

To use Claude Opus 5.5, Claude Opus 5, or Claude Opus 4.8 with [fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode), pass `model` as an object, for example: `{"id": "claude-opus-5", "speed": "fast"}`. See the fast mode page's [supported models](https://platform.claude.com/docs/en/build-with-claude/fast-mode#supported-models). To set the model's effort level, pass `model` as an object, for example: `{"id": "claude-opus-5", "effort": "high"}`. The `effort` field accepts a level string (`low`, `medium`, `high`, `xhigh`, or `max`) or an object such as `{"type": "high"}`. See [Effort levels](https://platform.claude.com/docs/en/build-with-claude/effort#effort-levels) for what each level does.

Pin the inference geo

speedeffort처럼 inference_geomodel의 객체 형태를 통해 설정해요: model을 객체로 전달하고 id와 함께 inference_geo를 지정하세요. 이 필드는 "us" 또는 "global"을 받아요. 설정하지 않으면 각 모델 요청은 서빙 시점의 워크스페이스 기본 추론 지리(geo)를 따릅니다. 워크스페이스 수준의 geo 제어와 가격은 Data residency를 참고하세요.

다음 예시는 에이전트를 미국 추론(US inference)에 고정하고, 에이전트의 model 객체에서 inference_geo 값을 출력해요:

```bash cURL agent=$(curl -fsSL https://api.anthropic.com/v1/agents \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d '{ "name": "Geo-pinned assistant", "model": {"id": "claude-opus-5-5", "inference_geo": "us"}, "system": "You are a helpful assistant." }')

echo "Inference geo: $(jq -r '.model.inference_geo' <<< "$agent")"


<MultiFileExample language="cli" label="CLI">
  ```bash CLI
  ant apply geo-pinned-assistant.md
  ```

  <File filename="geo-pinned-assistant.md">
    ```markdown
    ---
    name: Geo-pinned assistant
    model:
      id: claude-opus-5-5
      inference_geo: us
    ---

    You are a helpful assistant.
    ```
  </File>
</MultiFileExample>

```python Python
agent = client.beta.agents.create(
    name="Geo-pinned assistant",
    model={
        "id": "claude-opus-5-5",
        "inference_geo": "us",
    },
    system="You are a helpful assistant.",
)

print(f"Inference geo: {agent.model.inference_geo}")
const agent = await client.beta.agents.create({
  name: "Geo-pinned assistant",
  model: { id: "claude-opus-5-5", inference_geo: "us" },
  system: "You are a helpful assistant.",
});

console.log(`Inference geo: ${agent.model.inference_geo}`);
var agent = await client.Beta.Agents.Create(new()
{
    Name = "Geo-pinned assistant",
    Model = new BetaManagedAgentsModelConfigParams
    {
        ID = BetaManagedAgentsModel.ClaudeOpus5_5,
        InferenceGeo = "us",
    },
    System = "You are a helpful assistant.",
});

Console.WriteLine($"Inference geo: {agent.Model.InferenceGeo}");
agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{
	Name: "Geo-pinned assistant",
	Model: anthropic.BetaManagedAgentsModelConfigParams{
		ID:           anthropic.BetaManagedAgentsModelClaudeOpus5_5,
		InferenceGeo: anthropic.String("us"),
	},
	System: anthropic.String("You are a helpful assistant."),
})
if err != nil {
	panic(err)
}

fmt.Printf("Inference geo: %s\n", agent.Model.InferenceGeo)
var agent = client.beta().agents().create(
    AgentCreateParams.builder()
        .name("Geo-pinned assistant")
        .model(
            BetaManagedAgentsModelConfigParams.builder()
                .id(BetaManagedAgentsModel.CLAUDE_OPUS_5_5)
                .inferenceGeo("us")
                .build()
        )
        .system("You are a helpful assistant.")
        .build()
);

IO.println("Inference geo: " + agent.model().inferenceGeo().orElseThrow());
$agent = $client->beta->agents->create(
    name: 'Geo-pinned assistant',
    model: BetaManagedAgentsModelConfigParams::with(
        id: 'claude-opus-5-5',
        inferenceGeo: 'us',
    ),
    system: 'You are a helpful assistant.',
);

echo "Inference geo: {$agent->model->inferenceGeo}\n";
agent = client.beta.agents.create(
  name: "Geo-pinned assistant",
  model: {id: "claude-opus-5-5", inference_geo: "us"},
  system_: "You are a helpful assistant."
)

puts "Inference geo: #{agent.model.inference_geo}"

inference_geo 고정은 에이전트가 저장될 때, 에이전트로 세션이 만들어질 때, 그리고 세션이 서빙하는 매 턴마다 워크스페이스의 allowed_inference_geos에 대해 검증돼요. 워크스페이스 허용 목록이 좁아져 고정값이 더 이상 허용되지 않으면 에이전트로 새 세션을 만들 수 없고, 실행 중인 세션은 추가 턴을 거부해요. 고정값은 예외 처리되지 않아요. 워크스페이스가 컴플라이언스와 데이터 상주(residency)를 위해 여기에 의존하기 때문이죠.

지리적 추론 고정을 지원하지 않는 모델에 inference_geo를 설정하면 400 에러가 반환돼요. 지원하는 모델 목록은 Model availability를 참고하세요. multiagent 구성에서는 코디네이터의 고정값과 모든 로스터 멤버의 고정값이 모두 같은 값이거나 모두 설정되지 않아야 해요. 자세한 내용은 Multiagent orchestration을 참고하세요. 나중에 고정값을 바꾸거나 지우려면 에이전트의 model 객체를 업데이트하세요. Update semantics에 설명된 대로 inference_geo 없이 model을 제공하면 고정값이 지워져요.

Update an agent

에이전트를 업데이트하면 구성이 바뀔 때 새 버전이 생성돼요. version 필드는 선택 사항이에요: 낙관적 동시성(optimistic concurrency)을 위해 제공하면(불일치 시 409 반환), 또는 무조건 적용하려면 생략할 수 있어요(마지막 쓰기가 이김). 보관된 에이전트에 대한 업데이트는 거부돼요.

CLI에서는 에이전트 파일을 편집하고 ant apply를 다시 실행하면 돼요. apply가 version을 자동으로 채워 줘요.

```bash cURL updated_agent=$(curl -fsSL "https://api.anthropic.com/v1/agents/$AGENT_ID" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- <echo "New version: $(jq -r '.version' <<< "$updated_agent")"


<MultiFileExample language="cli" label="CLI">
  ```bash CLI
  ant apply coding-assistant.md
  ```

  <File filename="coding-assistant.md">
    ```markdown
    ---
    name: Coding Assistant
    model: claude-opus-5-5
    tools:
      - type: agent_toolset_20260401
    ---

    You are a helpful coding agent. Always write tests.
    ```
  </File>
</MultiFileExample>

```python Python
updated_agent = client.beta.agents.update(
    agent.id,
    version=agent.version,
    system="You are a helpful coding agent. Always write tests.",
)

print(f"New version: {updated_agent.version}")
const updatedAgent = await client.beta.agents.update(agent.id, {
  version: agent.version,
  system: "You are a helpful coding agent. Always write tests.",
});

console.log(`New version: ${updatedAgent.version}`);
var updatedAgent = await client.Beta.Agents.Update(agent.ID, new()
{
    Version = agent.Version,
    System = "You are a helpful coding agent. Always write tests.",
});

Console.WriteLine($"New version: {updatedAgent.Version}");
updatedAgent, err := client.Beta.Agents.Update(ctx, agent.ID, anthropic.BetaAgentUpdateParams{
	Version: anthropic.Int(agent.Version),
	System:  anthropic.String("You are a helpful coding agent. Always write tests."),
})
if err != nil {
	panic(err)
}

fmt.Printf("New version: %d\n", updatedAgent.Version)
var updatedAgent = client.beta().agents().update(
    agent.id(),
    AgentUpdateParams.builder()
        .version(agent.version())
        .system("You are a helpful coding agent. Always write tests.")
        .build()
);

IO.println("New version: " + updatedAgent.version());
$updatedAgent = $client->beta->agents->update(
    $agent->id,
    version: $agent->version,
    system: 'You are a helpful coding agent. Always write tests.',
);

echo "New version: {$updatedAgent->version}\n";
updated_agent = client.beta.agents.update(
  agent.id,
  version: agent.version,
  system_: "You are a helpful coding agent. Always write tests."
)

puts "New version: #{updated_agent.version}"

앞의 예시는 생성 응답에서 version을 가져와 제공하므로, 읽은 이후 다른 무엇이 에이전트를 변경하지 않은 경우에만 업데이트가 적용돼요. 무조건 적용하려면 요청에서 version을 생략하세요:

```bash cURL updated_agent=$(curl -fsSL "https://api.anthropic.com/v1/agents/$AGENT_ID" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d '{ "description": "Writes and reviews code." }')

echo "New version: $(jq -r '.version' <<< "$updated_agent")"

</CodeGroup>

### Update semantics

* **`version`** is optional and must be at least 1 when supplied. When supplied, the request returns a 409 if it doesn't match the agent's current version, even when the fields you send already match the stored values; re-read the agent and retry. When omitted, the update applies unconditionally and the most recent update silently replaces any concurrent one, with no error to either caller. Supplying `version` is the recommended default for interactive callers, and omitting it fits declarative apply loops, such as a CI job that syncs checked-in agent definitions, where the loop owns the agent.

* **Omitted fields are preserved.** You only need to include the fields you want to change.

* **Scalar fields** (`model`, `system`, `name`, `description`) are replaced with the new value. `system` and `description` can be cleared by passing `null`. `model` and `name` are mandatory and cannot be cleared. Within a `model` object you supply, `effort` is the sole exception: if the model `id` is unchanged, omitting `effort` leaves the stored effort level unchanged. If you change the model `id`, an omitted `effort` resets to the new model's default. Other `model` fields are replaced along with the object: supplying `model` without `inference_geo` clears the agent's inference geo pin.

* **Array fields** (`tools`, `mcp_servers`, `skills`) are fully replaced by the new array. To clear an array field entirely, pass `null` or an empty array.

* **`multiagent`** is replaced as a whole, including its `agents` roster. Pass `null` to clear it.

* **Metadata** is merged at the key level. Keys you provide are added or updated. Keys you omit are preserved. To delete a specific key, set its value to `null`.

* **No-op detection.** If the update produces no change relative to the current version, no new version is created and the existing version is returned.

* **Coordinator rosters are not updated.** Coordinators that reference this agent in their `multiagent.agents` roster keep the version that was pinned when the coordinator was created or last updated, even if the reference omits `version`. To delegate to the new version, [update the coordinator](https://platform.claude.com/docs/en/managed-agents/multiagent-orchestration#configure-the-coordinator) so its roster references it.

## Agent lifecycle

| Operation         | Behavior                                                                                            |
| ----------------- | --------------------------------------------------------------------------------------------------- |
| **Update**        | Generates a new agent version when the configuration changes.                                       |
| **List versions** | Returns the full version history so you can track changes over time.                                |
| **Archive**       | Makes the agent read-only. New sessions cannot reference it, but existing sessions continue to run. |

### List versions

에이전트가 시간에 따라 어떻게 변했는지 추적하기 위해 전체 버전 기록을 가져와요. 결과는 페이지로 나뉘며, SDK 예시는 자동으로 모든 페이지를 가져와요.

<CodeGroup>
```bash cURL
curl -fsSL "https://api.anthropic.com/v1/agents/$AGENT_ID/versions" \
  -H "x-api-key: $ANTHR...KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  | jq -r '.data[] | "Version \(.version): \(.updated_at)"'
ant beta:agents:versions list --agent-id "$AGENT_ID"
for version in client.beta.agents.versions.list(agent.id):
    print(f"Version {version.version}: {version.updated_at.isoformat()}")
for await (const version of client.beta.agents.versions.list(agent.id)) {
  console.log(`Version ${version.version}: ${version.updated_at}`);
}
var versions = await client.Beta.Agents.Versions.List(agent.ID);
await foreach (var version in versions.Paginate())
{
    Console.WriteLine($"Version {version.Version}: {version.UpdatedAt:O}");
}
iter := client.Beta.Agents.Versions.ListAutoPaging(ctx, agent.ID, anthropic.BetaAgentVersionListParams{})
for iter.Next() {
	version := iter.Current()
	fmt.Printf("Version %d: %s\n", version.Version, version.UpdatedAt.Format(time.RFC3339))
}
if err := iter.Err(); err != nil {
	panic(err)
}
for (var version : client.beta().agents().versions().list(agent.id()).autoPager()) {
    IO.println("Version " + version.version() + ": " + version.updatedAt());
}
foreach ($client->beta->agents->versions->list($agent->id)->pagingEachItem() as $version) {
    echo "Version {$version->version}: {$version->updatedAt->format(DateTimeInterface::ATOM)}\n";
}
client.beta.agents.versions.list(agent.id).auto_paging_each do |agent_version|
  puts "Version #{agent_version.version}: #{agent_version.updated_at.iso8601}"
end

Archive an agent

보관은 에이전트를 읽기 전용으로 만들며 되돌릴 수 없어요. 기존 세션은 계속 실행되지만, 새 세션은 에이전트를 참조할 수 없어요. 응답은 archived_at을 보관 시각으로 설정해요.

```bash cURL archived=$(curl -fsSL -X POST "https://api.anthropic.com/v1/agents/$AGENT_ID/archive" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01")

echo "Archived at: $(jq -r '.archived_at' <<< "$archived")"


```bash CLI
ant beta:agents archive --agent-id "$AGENT_ID"
archived = client.beta.agents.archive(agent.id)

print(f"Archived at: {archived.archived_at.isoformat()}")
const archived = await client.beta.agents.archive(agent.id);
console.log(`Archived at: ${archived.archived_at}`);
var archived = await client.Beta.Agents.Archive(agent.ID);
Console.WriteLine($"Archived at: {archived.ArchivedAt:O}");
archived, err := client.Beta.Agents.Archive(ctx, agent.ID, anthropic.BetaAgentArchiveParams{})
if err != nil {
	panic(err)
}
fmt.Printf("Archived at: %s\n", archived.ArchivedAt.Format(time.RFC3339))
var archived = client.beta().agents().archive(agent.id());
IO.println("Archived at: " + archived.archivedAt().orElseThrow());
$archived = $client->beta->agents->archive($agent->id);

echo "Archived at: {$archived->archivedAt->format(DateTimeInterface::ATOM)}\n";
archived = client.beta.agents.archive(agent.id)
puts "Archived at: #{archived.archived_at.iso8601}"

Next steps

Configure tools available to your agent. Attach reusable, filesystem-based expertise to your agent for domain-specific workflows. Create a session to run your agent and begin executing tasks. Event types, self-hosted worker CLI flags, supported MCP server types, rate limits, and branding guidelines for Claude Managed Agents.

더 알아보기 (Learn more)

  • Start a session — 에이전트로 세션 만들고 작업 실행하기
  • Tools — 에이전트에 사용할 도구 구성하기
  • Skills — 도메인별 워크플로를 위한 스킬 연결하기
  • Reference — 이벤트 종류, CLI 플래그, 속도 제한, 브랜딩 가이드라인