Skip to content
providerkit
GitHub

AgentConfig

Defined in: agents/src/types.ts:461

Type Parameter Default type
H unknown
optional compaction?: CompactionPolicy;

Defined in: agents/src/types.ts:480


optional enabledTools?: EnabledTools;

Defined in: agents/src/types.ts:491

A host policy or allow-list. A run may narrow this list, never widen it. The reserved submit_result tool stays available when there is an output contract.


optional finish?: FinishPolicy;

Defined in: agents/src/types.ts:518

Opt in to one finish turn for a run that would otherwise end without its answer: when it reaches limits.turns, limits.toolCalls or its own limits.costUsd, when the output limit cut a turn (including incomplete arguments on an otherwise finished turn), or when a checked-output agent answers in text. The model reads a note saying why, then answers with no tools (a text agent) or is made to call its stopping tool. None of a cut turn’s calls run. The finish turn is the run’s last call, and only one stopping call runs in it. It is priced and counted like any other call; past costUsd that makes the cap soft by one bounded call. A run it saves completes with salvaged; otherwise the run ends as it would have. Time limits, the tree’s limits and a Stop stay hard.


optional guardrails?: Guardrails;

Defined in: agents/src/types.ts:479


id: string;

Defined in: agents/src/types.ts:462


instructions: AgentInstructions;

Defined in: agents/src/types.ts:466

A function runs once when the run is created; resume uses the recorded text.


optional limits?: Partial<RunLimits>;

Defined in: agents/src/types.ts:527


optional memory?: true | AgentMemory;

Defined in: agents/src/types.ts:483

Bounded recall, recorded before the first model call. Requires host-supplied memory.


optional modelSettings?: ModelSettings;

Defined in: agents/src/types.ts:469


optional onLifecycle?: LifecycleHook;

Defined in: agents/src/types.ts:485

Host-only observer. Runs before RunOptions.onLifecycle at each boundary.


provider: Provider;

Defined in: agents/src/types.ts:468

Already composed with whatever routing, retries and watchdog the caller needs.


optional recovery?: RecoveryPolicy;

Defined in: agents/src/types.ts:478

Opt in before starting a run. Never retries a settled failure or an unknown write.


optional requests?: RequestPolicy;

Defined in: agents/src/types.ts:521

Controls how human requests open in a turn: one at a time, and whether a tool validates arguments with accepts() before an approval opens.


optional retryAfterOutput?: RetryAfterOutputPolicy;

Defined in: agents/src/types.ts:524

Opt in to retrying transient mid-stream model failures after chunks arrived, for runs whose stream nobody watches. Refused when hostedTools are declared on the agent or run.


optional runFirst?: readonly string[];

Defined in: agents/src/types.ts:500

Calls of these tools run before the rest of their turn, in the model’s order, and the rest waits for their results even when both sides may run in parallel. Models often send a plan with the first step it describes; run in wire order, that step would reach the host’s check before the plan it depends on. Results keep the model’s order.


optional steering?: SteeringPolicy;

Defined in: agents/src/types.ts:526

Controls how steering input from host.inbox interacts with the end of a run.


optional stopAtTools?: readonly string[];

Defined in: agents/src/types.ts:495

End on the first successful result from these tools, in model call order, after the whole batch settles. Text agents return its summary; checked agents validate its raw output. A failed or invalid result goes back to the model.


optional stopOnlyAtTools?: object;

Defined in: agents/src/types.ts:508

End the run only through a stopping tool: stopAtTools, an isTerminal tool or submit_result. A turn that answers in text, with no tool call, no longer ends the run: the model reads nudge as the next user message and keeps working. A stopping tool may share its turn with other calls; once it succeeds, each call after it gets a result that says it did not run. submit_result and handoffs still run alone. When a text agent’s stopping tool returns an empty summary, the turn’s text is the answer. The turn limit is a hard cap, with no tool-free final call. A run that disables every stopping tool throws.

nudge: string;

optional supportsVision?: boolean;

Defined in: agents/src/types.ts:472

Set false if this agent’s model calls cannot read images. They get text notes instead. User attachments stay in the transcript; image references need no loader for these calls.


optional toolHistory?: ToolHistoryPolicy;

Defined in: agents/src/types.ts:476

Opt in to trimming old tool results. Above 120,000 characters the model view drops older text toward 60,000, keeping the newest result. The journal keeps the original text. Only the newest keepImages tool images keep their bytes in the snapshot.


optional toolRetries?: ToolRetryPolicy;

Defined in: agents/src/types.ts:481


optional tools?: readonly (
| Delegation
| Tool<unknown, unknown>
| ClientTool
| CodeTool
| Handoff<H>)[];

Defined in: agents/src/types.ts:488

Core tools, client tools, code tools, delegations or handoffs. Terminal tools and handoffs must be called alone. H is the union of the registered targets’ output types.


optional treeLimits?: Partial<TreeLimits>;

Defined in: agents/src/types.ts:529

Applies when this agent is the root. Descendants share the root’s limits.


version: string;

Defined in: agents/src/types.ts:464

Change this when instructions, tools or output contracts change.