Agent harness plugins
기준일: 2026-07-26
공식 기준: Agent harness plugins
Agent harness plugins 문서는 OpenClaw 공식 문서(plugins/sdk-agent-harness)를 한국어로 정리한 가이드입니다. Experimental SDK surface for plugins that replace the low level embedded agent executor 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
Experimental SDK surface for plugins that replace the low level embedded agent executor
한국어 가이드 범위: plugins/sdk-agent-harness 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- When to use a harness
- What core still owns
- Harness-owned auth bootstrap
- Verified setup runtime artifacts
- Request-transport contract
- Register a harness
- Delegated execution
- Selection policy
- Provider plus harness pairing
- Tool-result middleware
- Terminal outcome classification
- Agent-end side effects
- User input and tool surfaces
- Native Codex harness mode
- Runtime strictness
- Native sessions and transcript mirror
- Tool and media results
- Terminal tool outcomes
- Settled tool finalization
- Current limitations
- 관련 문서
상세 내용
본문
An agent harness is the low level executor for one prepared OpenClaw agent turn. It is not a model provider, not a channel, and not a tool registry. For the user-facing mental model, see Agent runtimes.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
When to use a harness
Register an agent harness when a model family has its own native session runtime and the normal OpenClaw provider transport is the wrong abstraction:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- a native coding-agent server that owns threads and compaction
- a local CLI or daemon that must stream native plan/reasoning/tool events
- a model runtime that needs its own resume id in addition to the OpenClaw
What core still owns
Before a harness is selected, OpenClaw has already resolved:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- provider and model
- runtime auth state, unless the harness declares that it owns auth bootstrap
- thinking level and context budget
- the OpenClaw transcript/session file
- workspace, sandbox, and tool policy
- channel reply callbacks and streaming callbacks
- model fallback and live model switching policy
Harness-owned auth bootstrap
By default, core resolves provider credentials before calling a harness. A trusted harness that can authenticate through its own native runtime may set authBootstrap: "harness" on its static AgentHarness registration. Core then skips its generic provider credential bootstrap and missing-credential failure for every attempt claimed by that harness.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Verified setup runtime artifacts
A local harness that can supply inference for first-run setup must attest the implementation that completed the probe. When params.captureRuntimeArtifact is true, return an opaque result.runtimeArtifact with a stable id and content fingerprint. Register a matching runtimeArtifact.validate(...) capability that rechecks that binding without loading a different harness or scanning unrelated plugins.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
runtimePlan.tools.normalize(...)andruntimePlan.tools.logDiagnostics(...)runtimePlan.transcript.resolvePolicy(...)for transcript sanitization andruntimePlan.delivery.isSilentPayload(...)for sharedNO_REPLYand mediaruntimePlan.outcome.classifyRunResult(...)for model fallbackruntimePlan.observabilityfor resolved provider/model/harness metadata
Request-transport contract
supports(ctx) receives the resolved model transport in ctx.modelProvider. Two secret-free provider-owned facts describe the selected route:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
runtimePolicy.compatibleIdslists the runtime ids the provider declaresrequestTransportOverrides: "none"means no authored provider/model request
Register a harness
authBootstrap is intentionally absent from this generic example. Add authBootstrap: "harness" only when the harness meets the contract above.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
const myHarness: AgentHarness = {
id: "my-harness",
label: "My native agent harness",
supports(ctx) {
const routeSupportsHarness =
ctx.modelProvider?.runtimePolicy?.compatibleIds.includes("my-harness") === true;
const canReproduceRequest = ctx.modelProvider?.requestTransportOverrides !== "present";
return ctx.provider === "my-provider" && routeSupportsHarness && canReproduceRequest
? { supported: true, priority: 100 }
: { supported: false, reason: "effective route is not harness-compatible" };
},
async runAttempt(params) {
// Start or resume your native thread.
// Use params.prompt, params.tools, params.images, params.onPartialReply,
// params.onAgentEvent, and the other prepared attempt fields.
return await runMyNativeTurn(params);
},
};
id: "my-native-agent",
name: "My Native Agent",
description: "Runs selected models through a native agent daemon.",
register(api) {
api.registerAgentHarness(myHarness);
},
});
Delegated execution
A harness owner may set delegatedExecutionPluginIds to the ids of trusted plugins that need to execute an existing model-locked session, such as a voice transport continuing a Codex-backed conversation. This is static owner consent, not a core allowlist. Keep it narrow.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Selection policy
OpenClaw chooses a harness after provider/model resolution:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Provider plus harness pairing
Most harnesses should also register a provider. The provider makes model refs, auth status, model metadata, and /model selection visible to the rest of OpenClaw. The harness then claims that provider in supports(...).
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- preferred user model refs:
openai/gpt-5.6-sol - compatibility refs: legacy
codex/gpt-*refs remain accepted, but new - harness id:
codex - auth: synthetic provider availability, because the Codex harness owns the
- app-server request: OpenClaw sends the bare model id to Codex and lets the
Tool-result middleware
Bundled plugins and explicitly enabled installed plugins with matching manifest contracts can attach runtime-neutral tool-result middleware through api.registerAgentToolResultMiddleware(...) when their manifest declares the targeted runtime ids in contracts.agentToolResultMiddleware. This trusted seam is for async tool-result transforms that must run before OpenClaw or Codex feeds tool output back into the model.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Terminal outcome classification
Native harnesses that own their own protocol projection can use classifyAgentHarnessTerminalOutcome(...) from openclaw/plugin-sdk/agent-harness-runtime when a completed turn produced no visible assistant text. The helper returns empty, reasoning-only, or planning-only so OpenClaw's fallback policy can decide whether to retry on a different model. planning-only requires the harness's explicit planText field; OpenClaw does not infer it from assistant prose. The helper intentionally leaves prompt errors, in-flight turns, and intentional silent replies such as NO_REPLY unclassified.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Agent-end side effects
Native harnesses must call runAgentEndSideEffects(...) from openclaw/plugin-sdk/agent-harness-runtime after they finalize an attempt. It dispatches the portable agent_end hook and OpenClaw's research capture without delaying interactive replies. Use awaitAgentEndSideEffects(...) for local, non-interactive runs where the attempt must not resolve until those side effects finish. Both helpers accept the same { event, ctx } payload as runAgentHarnessAgentEndHook(...); their failures do not alter the completed attempt result.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
User input and tool surfaces
Native harnesses that expose a runtime-level user-input request should use the user-input helpers from openclaw/plugin-sdk/agent-harness-runtime to format the prompt, deliver it through OpenClaw's blocking reply path, and normalize choice/free-form answers back into the runtime's native response shape. The helper keeps channel/TUI presentation consistent while each harness keeps its own protocol parsing and pending-request lifecycle.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Native Codex harness mode
The bundled codex harness is the native Codex mode for embedded OpenClaw agent turns. Enable the bundled codex plugin first, and include codex in plugins.allow if your config uses a restrictive allowlist. Native app-server configs should use openai/gpt-*; OpenAI agent turns select the Codex harness only when the effective route declares Codex compatibility. Legacy Codex model refs should be repaired with openclaw doctor --fix, and legacy codex/* model refs remain compatibility aliases for the native harness.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Runtime strictness
By default, OpenClaw uses auto provider/model runtime policy: registered plugin harnesses can claim compatible effective routes, and the embedded runtime handles the turn when none match. A provider/model prefix alone never selects a harness. Use an explicit provider/model plugin runtime such as agentRuntime.id: "codex" when missing harness selection should fail instead of routing through the embedded runtime. Explicit selection does not make an incompatible route compatible. Selected plugin harness failures always fail hard. This does not block an explicit provider/model agentRuntime.id: "openclaw".
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
{
"models": {
"providers": {
"openai": {
"agentRuntime": {
"id": "codex"
}
}
}
},
"agents": {
"defaults": {
"model": "openai/gpt-5.6-sol"
}
}
}
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-5",
"models": {
"anthropic/claude-opus-5": {
"agentRuntime": {
"id": "claude-cli"
}
}
}
}
}
}
{
"agents": {
"list": [
{
"id": "codex-only",
"model": "openai/gpt-5.6-sol",
"models": {
"openai/gpt-5.6-sol": {
"agentRuntime": { "id": "codex" }
}
}
}
]
}
}
{
"agents": {
"defaults": {
"agentRuntime": {
"id": "codex"
}
}
}
}
Native sessions and transcript mirror
A harness may keep a native session id, thread id, or daemon-side resume token. Keep that binding explicitly associated with the OpenClaw session, and keep mirroring user-visible assistant/tool output into the OpenClaw transcript.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- channel-visible session history
- transcript search and indexing
- switching back to the built-in OpenClaw harness on a later turn
- generic
/new,/reset, and session deletion behavior
Tool and media results
Core constructs the OpenClaw tool list and passes it into the prepared attempt. When a harness executes a dynamic tool call, return the tool result back through the harness result shape instead of sending channel media yourself.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Terminal tool outcomes
AgentHarnessAttemptParams.observeToolTerminal is the host-owned terminal outcome accumulator. A harness that executes OpenClaw dynamic tools or native tools must call it when each tool reaches one terminal outcome, before the attempt result is finalized. Harnesses that do not execute tools do not need to call it.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Pass the protocol call id when one exists, the canonical tool name, and the
- Set
executionStarted: falsewhen validation, approval, or another guard - Report
outcome: "success"oroutcome: "failure". Include the structured - Use
nativeMutationonly for native tools that do not use an OpenClaw tool
Settled tool finalization
OpenClaw may need one final visible answer after a harness has completed every tool call but its native turn ended without assistant text. A harness can opt into that recovery by implementing finalizeSettledTurn({ attempt, settledAttempt }).
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- use either the exact restricted native transcript or a complete application
- expose no tools, permission-grant or user-input capabilities, native execution
- send only the host-provided finalization prompt; and
- fail closed if its selected transcript/isolation strategy cannot enforce
Current limitations
still carry legacy names for compatibility.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- The public import path is generic, but some attempt/result type aliases
- Third-party harness installation is experimental. Prefer provider plugins
- Harness switching is supported across turns. Do not switch harnesses in the
관련 문서
주요 항목:
- SDK Overview
- Runtime Helpers
- Provider Plugins
- Codex Harness
- Model Providers
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/plugins/sdk-agent-harness - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
const myHarness: AgentHarness = {
id: "my-harness",
label: "My native agent harness",
supports(ctx) {
const routeSupportsHarness =
ctx.modelProvider?.runtimePolicy?.compatibleIds.includes("my-harness") === true;
const canReproduceRequest = ctx.modelProvider?.requestTransportOverrides !== "present";
return ctx.provider === "my-provider" && routeSupportsHarness && canReproduceRequest
? { supported: true, priority: 100 }
: { supported: false, reason: "effective route is not harness-compatible" };
},
async runAttempt(params) {
// Start or resume your native thread.
// Use params.prompt, params.tools, params.images, params.onPartialReply,
// params.onAgentEvent, and the other prepared attempt fields.
return await runMyNativeTurn(params);
},
};
id: "my-native-agent",
name: "My Native Agent",
description: "Runs selected models through a native agent daemon.",
register(api) {
api.registerAgentHarness(myHarness);
},
});
{
"models": {
"providers": {
"openai": {
"agentRuntime": {
"id": "codex"
}
}
}
},
"agents": {
"defaults": {
"model": "openai/gpt-5.6-sol"
}
}
}
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-5",
"models": {
"anthropic/claude-opus-5": {
"agentRuntime": {
"id": "claude-cli"
}
}
}
}
}
}
{
"agents": {
"list": [
{
"id": "codex-only",
"model": "openai/gpt-5.6-sol",
"models": {
"openai/gpt-5.6-sol": {
"agentRuntime": { "id": "codex" }
}
}
}
]
}
}
{
"agents": {
"defaults": {
"agentRuntime": {
"id": "codex"
}
}
}
}
관련 링크
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.