Deep Agents is an agent harness. An opinionated, ready-to-run agent out of the box. Instead of wiring prompts, tools, and context management yourself, you get a working agent immediately and customize what you need.
What's included:
write_todos for task breakdown and progress trackingread_file, write_file, edit_file, ls, glob, grep for working memorytask for delegating work with isolated context windows[!NOTE] Looking for the Python package? See langchain-ai/deepagents.
npm install deepagents
# or
pnpm add deepagents
# or
yarn add deepagents
[!IMPORTANT]
deepagentsdeclares the LangChain runtime packages as peer dependencies so your app controls their versions and everything resolves to a single shared copy. npm 7+ and pnpm 8+ install these automatically; Yarn users must add them explicitly:yarn add @langchain/core @langchain/langgraph @langchain/langgraph-checkpoint @langchain/langgraph-sdk langchain langsmith
import { createDeepAgent } from "deepagents";
const agent = createDeepAgent();
const result = await agent.invoke({
messages: [
{
role: "user",
content: "Research LangGraph and write a summary in summary.md",
},
],
});
The agent can plan, read/write files, and manage longer tasks with sub-agents and filesystem tools.
[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
deepagents now publishes environment-specific entrypoints:
deepagents - default Node.js/server entrypoint with the full API.deepagents/browser - recommended browser entrypoint (no Node-only exports).deepagents/node - optional explicit Node.js entrypoint (same full API as deepagents).// Browser-safe usage
import { createDeepAgent, StateBackend } from "deepagents/browser";
// Node.js usage (recommended)
import { createDeepAgent, FilesystemBackend } from "deepagents";
// Optional explicit Node.js usage
// import { createDeepAgent, FilesystemBackend } from "deepagents/node";
Add tools, swap models, and customize prompts as needed:
import { ChatOpenAI } from "@langchain/openai";
import { createDeepAgent } from "deepagents";
const agent = createDeepAgent({
model: new ChatOpenAI({ model: "gpt-5", temperature: 0 }),
tools: [myCustomTool],
systemPrompt: "You are a research assistant.",
});
See the JavaScript Deep Agents docs for full configuration options.
createDeepAgent returns a compiled LangGraph graph, so you can use streaming, Studio, checkpointers, and other LangGraph features.
Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police. See the security policy for more information.
Base sandbox implementation with execute() as the only abstract method.
This class provides default implementations for all SandboxBackendProtocol methods using shell commands executed via execute().
Backend that routes file operations to different backends based on path prefix.
This enables hybrid storage strategies like:
/memories/ → StoreBackend (persistent, cross-thread)Backend that stores files in a LangSmith Hub agent repository.
Mutation model
Mutations are accepted in call order, coalesced for a short window, and pushed by one worker. Only one batch is in fl
Backend that reads and writes files directly from the filesystem.
Files are accessed using their actual filesystem paths. Relative paths are resolved relative to the current working directory. Conten
LangSmith Sandbox backend for deepagents.
Extends BaseSandbox to provide command execution and file operations
via the LangSmith Sandbox API.
Use the static LangSmithSandbox.create() factory for
Filesystem backend with unrestricted local shell command execution.
This backend extends FilesystemBackend to add shell command execution capabilities. Commands are executed directly on the host syst
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Uses LangGraph's state management and checkpointing. Files persist within a conversation thread but not across threads. State is automatically ch
Backend that stores files in LangGraph's BaseStore (persistent).
Uses LangGraph's Store for persistent, cross-conversation storage. Files are organized via namespaces and persist across all threads.
Base sandbox implementation with execute() as the only abstract method.
This class provides default implementations for all SandboxBackendProtocol methods using shell commands executed via execute().
Backend that routes file operations to different backends based on path prefix.
This enables hybrid storage strategies like:
/memories/ → StoreBackend (persistent, cross-thread)Backend that stores files in a LangSmith Hub agent repository.
Mutation model
Mutations are accepted in call order, coalesced for a short window, and pushed by one worker. Only one batch is in fl
LangSmith Sandbox backend for deepagents.
Extends BaseSandbox to provide command execution and file operations
via the LangSmith Sandbox API.
Use the static LangSmithSandbox.create() factory for
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Uses LangGraph's state management and checkpointing. Files persist within a conversation thread but not across threads. State is automatically ch
Backend that stores files in LangGraph's BaseStore (persistent).
Uses LangGraph's Store for persistent, cross-conversation storage. Files are organized via namespaces and persist across all threads.
Thrown when createDeepAgent receives invalid configuration.
Follows the same pattern as SandboxError: a human-readable
message, a structured code for programmatic handling, and a
static `isInst
Thrown when createDeepAgent receives invalid configuration.
Follows the same pattern as SandboxError: a human-readable
message, a structured code for programmatic handling, and a
static `isInst
Backend that reads and writes files directly from the filesystem.
Files are accessed using their actual filesystem paths. Relative paths are resolved relative to the current working directory. Conten
Filesystem backend with unrestricted local shell command execution.
This backend extends FilesystemBackend to add shell command execution capabilities. Commands are executed directly on the host syst
Base sandbox implementation with execute() as the only abstract method.
This class provides default implementations for all SandboxBackendProtocol methods using shell commands executed via execute().
Backend that routes file operations to different backends based on path prefix.
This enables hybrid storage strategies like:
/memories/ → StoreBackend (persistent, cross-thread)Thrown when createDeepAgent receives invalid configuration.
Follows the same pattern as SandboxError: a human-readable
message, a structured code for programmatic handling, and a
static `isInst
Backend that stores files in a LangSmith Hub agent repository.
Mutation model
Mutations are accepted in call order, coalesced for a short window, and pushed by one worker. Only one batch is in fl
LangSmith Sandbox backend for deepagents.
Extends BaseSandbox to provide command execution and file operations
via the LangSmith Sandbox API.
Use the static LangSmithSandbox.create() factory for
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Uses LangGraph's state management and checkpointing. Files persist within a conversation thread but not across threads. State is automatically ch
Backend that stores files in LangGraph's BaseStore (persistent).
Uses LangGraph's Store for persistent, cross-conversation storage. Files are organized via namespaces and persist across all threads.
Base sandbox implementation with execute() as the only abstract method.
This class provides default implementations for all SandboxBackendProtocol methods using shell commands executed via execute().
Backend that routes file operations to different backends based on path prefix.
This enables hybrid storage strategies like:
/memories/ → StoreBackend (persistent, cross-thread)Thrown when createDeepAgent receives invalid configuration.
Follows the same pattern as SandboxError: a human-readable
message, a structured code for programmatic handling, and a
static `isInst
Backend that stores files in a LangSmith Hub agent repository.
Mutation model
Mutations are accepted in call order, coalesced for a short window, and pushed by one worker. Only one batch is in fl
Backend that reads and writes files directly from the filesystem.
Files are accessed using their actual filesystem paths. Relative paths are resolved relative to the current working directory. Conten
LangSmith Sandbox backend for deepagents.
Extends BaseSandbox to provide command execution and file operations
via the LangSmith Sandbox API.
Use the static LangSmithSandbox.create() factory for
Filesystem backend with unrestricted local shell command execution.
This backend extends FilesystemBackend to add shell command execution capabilities. Commands are executed directly on the host syst
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Uses LangGraph's state management and checkpointing. Files persist within a conversation thread but not across threads. State is automatically ch
Backend that stores files in LangGraph's BaseStore (persistent).
Uses LangGraph's Store for persistent, cross-conversation storage. Files are organized via namespaces and persist across all threads.
A one-shot promise whose settlement is controlled externally.
Use this when one part of a workflow must wait for an event that is owned elsewhere—for example, a queued mutation waiting for the worker
Create a Deep Agent.
This is the main entry point for building a production-style agent with deepagents. It gives you a strong default runtime (filesystem, tasks, subagents, summarization) and lets y
Adapt a v1 BackendProtocol to BackendProtocolV2.
If the backend already implements v2, it is returned as-is. For v1 backends, wraps returns in Result types:
read() string returns wrapped in ReadRAdapt a sandbox backend from v1 to v2 interface.
This extends adaptBackendProtocol to also preserve sandbox-specific
properties from SandboxBackendProtocol: execute and id.
Group structured matches into the legacy dict form used by formatters.
Check if content is empty and return warning message.
Create a FileData object.
Defaults to v2 format (content as single string). Pass fileFormat: "v1" for
backward compatibility with older readers during a rolling deployment.
Binary content (Uint8Arr
Convert FileData to plain string content.
Format file content with line numbers (cat -n style).
Lines longer than MAX_LINE_LENGTH are split into continuation rows such as
5.1 and 5.2. Use formatContentWithLineNumbersAndBoundaries whe
Format file content with line numbers and structured source-line boundaries.
The boundaries let downstream size limiting truncate only after complete source lines without reparsing the rendered gutte
Format structured grep matches using existing formatting logic.
Format grep search results based on output mode.
Format file data for read response with line numbers.
Join file content into the unmodified source body of a read_file result.
Source lines are emitted unchanged, with no numbering. A status header carries the line-range metadata separately, so nothin
Determine MIME type from a file path's extension.
Defaults to "text/plain" for unknown extensions. Only the known non-text formats above (images, audio, video, PDF/PPT) are treated as binary by isTex
Search files dict for paths matching glob pattern.
Return structured grep matches from an in-memory files mapping.
Performs literal text search (not regex). Binary files are skipped.
If path names an exact file, only that file is considered.
Return
Search file contents for literal text pattern.
Performs literal text search.
Type guard to check if FileData contains binary content (Uint8Array).
Type guard to check if FileData is v1 format (content as line array).
Check whether a MIME type represents text content.
Convert FileData to v2 format, joining v1 line arrays into a single string.
If the data is already v2, returns it unchanged.
Normalize model- or caller-supplied text pagination bounds.
Every backend must slice content and calculate pagination metadata from the same normalized values. Otherwise a fractional or negative argu
Perform string replacement with occurrence validation.
Sanitize tool_call_id to prevent path traversal and separator issues.
Replaces dangerous characters (., /, ) with underscores.
Truncate list or string result if it exceeds token limit (rough estimate: 4 chars/token).
Update FileData with new content, preserving creation timestamp.
Validate and normalize a file path for security.
Ensures paths are safe to use by preventing directory traversal attacks and enforcing consistent formatting. All paths are normalized to use forward s
Validate and normalize a directory path.
Ensures paths are safe to use by preventing directory traversal attacks and enforcing consistent formatting. All paths are normalized to use forward slashes a
Enforce a match cap after a backend grep has completed.
When maxCount is set and the result exceeds it, the matches are sliced
to the cap and the result is flagged truncated: true.
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Checks for the presence of execute function and id string,
which are the defining features of sandbox protocols.
Compute summarization defaults based on model profile.
Mirrors Python's _compute_summarization_defaults.
If the model has a profile with maxInputTokens, uses fraction-based
settings. Otherwise, u
Create a completion callback middleware for async subagents.
Experimental — this middleware is experimental and may change.
This middleware is added to a subagent's middleware stack. On success
Create middleware that provides built-in filesystem tools and optional custom prompt guidance.
By default, the middleware registers every built-in filesystem tool listed in FILESYSTEM_TOOL_NAMES. Use
Create a frozen HarnessProfile from user-provided options.
Validates all fields, converts mutable collections to their frozen counterparts, and returns a frozen object. Empty options produce a no-op
Create middleware for loading agent memory from AGENTS.md files.
Loads memory content from configured sources and injects into the system prompt. Supports multiple sources that are combined together.
Create middleware that enforces strict tool call / tool response parity in the messages history.
Two kinds of violations are repaired:
Create backend-agnostic middleware for loading and exposing agent skills.
This middleware loads skills from configurable backend sources and injects skill metadata into the system prompt. It implemen
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
This middleware:
Look up the HarnessProfile for a model spec string.
Resolution order:
spec (e.g., "openai:gpt-5.4").:) when spec containsType guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Uses the presence of the graphId field as the runtime discriminant —
AsyncSubAgent requires it, while SubAgent a
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Checks for the presence of execute function and id string,
which are the defining features of sandbox protocols.
Parse an untrusted JSON/YAML object into a validated HarnessProfile.
Combines Zod schema validation with prototype-pollution protection and profile construction validation. Use this for any config da
Register a harness profile for a provider or specific model.
Accepts either a pre-built HarnessProfile (from createHarnessProfile) or raw HarnessProfileOptions that will be validated and frozen autom
Serialize a HarnessProfile to a JSON-compatible object.
Omits undefined fields and extraMiddleware (runtime-only).
Throws if extraMiddleware contains instances — callers should
strip it before
Adapt a v1 BackendProtocol to BackendProtocolV2.
If the backend already implements v2, it is returned as-is. For v1 backends, wraps returns in Result types:
read() string returns wrapped in ReadRAdapt a sandbox backend from v1 to v2 interface.
This extends adaptBackendProtocol to also preserve sandbox-specific
properties from SandboxBackendProtocol: execute and id.
Create a Deep Agent.
This is the main entry point for building a production-style agent with deepagents. It gives you a strong default runtime (filesystem, tasks, subagents, summarization) and lets y
Create a Settings instance with detected environment.
Find the project root by looking for .git directory.
Walks up the directory tree from startPath (or cwd) looking for a .git directory, which indicates the project root.
Enforce a match cap after a backend grep has completed.
When maxCount is set and the result exceeds it, the matches are sliced
to the cap and the result is flagged truncated: true.
Create a runnable agent from a declarative SubAgent spec.
This is the shared entrypoint for compiling a SubAgent into a
ReactAgent. Pre-compiled CompiledSubAgent runnables bypass this
functio
List skills from user and/or project directories.
When both directories are provided, project skills with the same name as user skills will override them.
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Adapt a v1 BackendProtocol to BackendProtocolV2.
If the backend already implements v2, it is returned as-is. For v1 backends, wraps returns in Result types:
read() string returns wrapped in ReadRAdapt a sandbox backend from v1 to v2 interface.
This extends adaptBackendProtocol to also preserve sandbox-specific
properties from SandboxBackendProtocol: execute and id.
Compute summarization defaults based on model profile.
Mirrors Python's _compute_summarization_defaults.
If the model has a profile with maxInputTokens, uses fraction-based
settings. Otherwise, u
Create a completion callback middleware for async subagents.
Experimental — this middleware is experimental and may change.
This middleware is added to a subagent's middleware stack. On success
Create a Deep Agent.
This is the main entry point for building a production-style agent with deepagents. It gives you a strong default runtime (filesystem, tasks, subagents, summarization) and lets y
Create middleware that provides built-in filesystem tools and optional custom prompt guidance.
By default, the middleware registers every built-in filesystem tool listed in FILESYSTEM_TOOL_NAMES. Use
Create a frozen HarnessProfile from user-provided options.
Validates all fields, converts mutable collections to their frozen counterparts, and returns a frozen object. Empty options produce a no-op
Create middleware for loading agent memory from AGENTS.md files.
Loads memory content from configured sources and injects into the system prompt. Supports multiple sources that are combined together.
Create middleware that enforces strict tool call / tool response parity in the messages history.
Two kinds of violations are repaired:
Create a Settings instance with detected environment.
Create backend-agnostic middleware for loading and exposing agent skills.
This middleware loads skills from configurable backend sources and injects skill metadata into the system prompt. It implemen
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
This middleware:
Find the project root by looking for .git directory.
Walks up the directory tree from startPath (or cwd) looking for a .git directory, which indicates the project root.
Look up the HarnessProfile for a model spec string.
Resolution order:
spec (e.g., "openai:gpt-5.4").:) when spec containsType guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Uses the presence of the graphId field as the runtime discriminant —
AsyncSubAgent requires it, while SubAgent a
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Checks for the presence of execute function and id string,
which are the defining features of sandbox protocols.
Normalize model- or caller-supplied text pagination bounds.
Every backend must slice content and calculate pagination metadata from the same normalized values. Otherwise a fractional or negative argu
Parse an untrusted JSON/YAML object into a validated HarnessProfile.
Combines Zod schema validation with prototype-pollution protection and profile construction validation. Use this for any config da
Register a harness profile for a provider or specific model.
Accepts either a pre-built HarnessProfile (from createHarnessProfile) or raw HarnessProfileOptions that will be validated and frozen autom
Serialize a HarnessProfile to a JSON-compatible object.
Omits undefined fields and extraMiddleware (runtime-only).
Throws if extraMiddleware contains instances — callers should
strip it before
Append text to a system message.
Creates a new SystemMessage with the text appended to the existing content. If the original message has content, the new text is separated by two newlines.
Create a preview of content showing head and tail with truncation marker.
Patch tool call / tool response parity in a messages array.
Ensures strict 1:1 correspondence between AIMessage tool_calls and ToolMessage responses:
Prepend text to a system message.
Creates a new SystemMessage with the text prepended to the existing content. If the original message has content, the new text is separated by two newlines.
Compute summarization defaults based on model profile.
Mirrors Python's _compute_summarization_defaults.
If the model has a profile with maxInputTokens, uses fraction-based
settings. Otherwise, u
Create a completion callback middleware for async subagents.
Experimental — this middleware is experimental and may change.
This middleware is added to a subagent's middleware stack. On success
Create middleware that provides built-in filesystem tools and optional custom prompt guidance.
By default, the middleware registers every built-in filesystem tool listed in FILESYSTEM_TOOL_NAMES. Use
Create middleware for loading agent memory from AGENTS.md files.
Loads memory content from configured sources and injects into the system prompt. Supports multiple sources that are combined together.
Create middleware that enforces strict tool call / tool response parity in the messages history.
Two kinds of violations are repaired:
Create backend-agnostic middleware for loading and exposing agent skills.
This middleware loads skills from configurable backend sources and injects skill metadata into the system prompt. It implemen
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
This middleware:
Type guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Uses the presence of the graphId field as the runtime discriminant —
AsyncSubAgent requires it, while SubAgent a
Adapt a v1 BackendProtocol to BackendProtocolV2.
If the backend already implements v2, it is returned as-is. For v1 backends, wraps returns in Result types:
read() string returns wrapped in ReadRAdapt a sandbox backend from v1 to v2 interface.
This extends adaptBackendProtocol to also preserve sandbox-specific
properties from SandboxBackendProtocol: execute and id.
Enforce a match cap after a backend grep has completed.
When maxCount is set and the result exceeds it, the matches are sliced
to the cap and the result is flagged truncated: true.
Compute summarization defaults based on model profile.
Mirrors Python's _compute_summarization_defaults.
If the model has a profile with maxInputTokens, uses fraction-based
settings. Otherwise, u
Create a completion callback middleware for async subagents.
Experimental — this middleware is experimental and may change.
This middleware is added to a subagent's middleware stack. On success
Create a Deep Agent.
This is the main entry point for building a production-style agent with deepagents. It gives you a strong default runtime (filesystem, tasks, subagents, summarization) and lets y
Create middleware that provides built-in filesystem tools and optional custom prompt guidance.
By default, the middleware registers every built-in filesystem tool listed in FILESYSTEM_TOOL_NAMES. Use
Create a frozen HarnessProfile from user-provided options.
Validates all fields, converts mutable collections to their frozen counterparts, and returns a frozen object. Empty options produce a no-op
Create middleware for loading agent memory from AGENTS.md files.
Loads memory content from configured sources and injects into the system prompt. Supports multiple sources that are combined together.
Create middleware that enforces strict tool call / tool response parity in the messages history.
Two kinds of violations are repaired:
Create a Settings instance with detected environment.
Create backend-agnostic middleware for loading and exposing agent skills.
This middleware loads skills from configurable backend sources and injects skill metadata into the system prompt. It implemen
Create a runnable agent from a declarative SubAgent spec.
This is the shared entrypoint for compiling a SubAgent into a
ReactAgent. Pre-compiled CompiledSubAgent runnables bypass this
functio
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
This middleware:
Find the project root by looking for .git directory.
Walks up the directory tree from startPath (or cwd) looking for a .git directory, which indicates the project root.
Look up the HarnessProfile for a model spec string.
Resolution order:
spec (e.g., "openai:gpt-5.4").:) when spec containsType guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Uses the presence of the graphId field as the runtime discriminant —
AsyncSubAgent requires it, while SubAgent a
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Checks for the presence of execute function and id string,
which are the defining features of sandbox protocols.
List skills from user and/or project directories.
When both directories are provided, project skills with the same name as user skills will override them.
Normalize model- or caller-supplied text pagination bounds.
Every backend must slice content and calculate pagination metadata from the same normalized values. Otherwise a fractional or negative argu
Parse an untrusted JSON/YAML object into a validated HarnessProfile.
Combines Zod schema validation with prototype-pollution protection and profile construction validation. Use this for any config da
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Register a harness profile for a provider or specific model.
Accepts either a pre-built HarnessProfile (from createHarnessProfile) or raw HarnessProfileOptions that will be validated and frozen autom
Serialize a HarnessProfile to a JSON-compatible object.
Omits undefined fields and extraMiddleware (runtime-only).
Throws if extraMiddleware contains instances — callers should
strip it before
Evaluate permission rules against an operation + path and return the access decision.
First-match-wins; permissive default.
Test whether path matches a glob pattern.
Supports:
** — any number of directory levels* — within a single path segment{a,b} — brace expansionUses micromatch with dot: true so
Canonicalize and validate an absolute path before permission checking.
Throws for:
/)..Validate permission rule paths at setup time. Throws if any path is
relative, contains .., or contains ~.
Apply a profile's prompt overlay to a base prompt string.
baseSystemPrompt (when set) replaces basePrompt entirely.systemPromptSuffix (when set) is appended with \n\n.Both are independ
Merge two harness profiles, layering override on top of base.
Merge semantics per field:
| Field | Strategy |
|---|---|
baseSystemPrompt |
Override wins if not undefined |
| `sy |
Normalize and validate a profile registry key.
Trims leading/trailing whitespace, then enforces the "provider" or
"provider:model" shape. Rejects empty strings, multiple colons, and
empty halves.
Create a frozen HarnessProfile from user-provided options.
Validates all fields, converts mutable collections to their frozen counterparts, and returns a frozen object. Empty options produce a no-op
Look up the HarnessProfile for a model spec string.
Resolution order:
spec (e.g., "openai:gpt-5.4").:) when spec containsParse an untrusted JSON/YAML object into a validated HarnessProfile.
Combines Zod schema validation with prototype-pollution protection and profile construction validation. Use this for any config da
Register a harness profile for a provider or specific model.
Accepts either a pre-built HarnessProfile (from createHarnessProfile) or raw HarnessProfileOptions that will be validated and frozen autom
Serialize a HarnessProfile to a JSON-compatible object.
Omits undefined fields and extraMiddleware (runtime-only).
Throws if extraMiddleware contains instances — callers should
strip it before
Type guard: is this a fully-constructed HarnessProfile (frozen with Set fields) or raw options?
Options use arrays for excludedTools; profiles use Set. We
distinguish by checking whether `exclude
Apply a profile's prompt overlay to a base prompt string.
baseSystemPrompt (when set) replaces basePrompt entirely.systemPromptSuffix (when set) is appended with \n\n.Both are independ
Create a frozen HarnessProfile from user-provided options.
Validates all fields, converts mutable collections to their frozen counterparts, and returns a frozen object. Empty options produce a no-op
Look up the HarnessProfile for a model spec string.
Resolution order:
spec (e.g., "openai:gpt-5.4").:) when spec containsMerge two harness profiles, layering override on top of base.
Merge semantics per field:
| Field | Strategy |
|---|---|
baseSystemPrompt |
Override wins if not undefined |
| `sy |
Parse an untrusted JSON/YAML object into a validated HarnessProfile.
Combines Zod schema validation with prototype-pollution protection and profile construction validation. Use this for any config da
Register a harness profile for a provider or specific model.
Accepts either a pre-built HarnessProfile (from createHarnessProfile) or raw HarnessProfileOptions that will be validated and frozen autom
Serialize a HarnessProfile to a JSON-compatible object.
Omits undefined fields and extraMiddleware (runtime-only).
Throws if extraMiddleware contains instances — callers should
strip it before
List skills from user and/or project directories.
When both directories are provided, project skills with the same name as user skills will override them.
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Detect whether a model is an Anthropic model.
Used to gate Anthropic-specific prompt caching optimizations (cache_control breakpoints).
Accepts the wider RunnableInterface shape (the type of `requ
Detect whether a model is an AWS Bedrock Converse model.
Accepts the wider RunnableInterface shape (the type of request.model
inside wrapModelCall, aliased as AgentLanguageModelLike in langch
Create middleware for loading agent-specific long-term memory.
This middleware loads the agent's long-term memory from a file (agent.md) and injects it into the system prompt. The memory is loaded on
Create middleware for loading agent-specific long-term memory.
This middleware loads the agent's long-term memory from a file (agent.md) and injects it into the system prompt. The memory is loaded on