Skip to content

AgentDef

Configuration passed to new Agent(def).

const agent = new Agent({
name: "support",
model: "anthropic/claude-sonnet-4-6",
instructions: "You are a customer support agent.",
})

optional defaults?: boolean | DefaultsOptions

Auto-apply sensible default middleware (retry, usage, tools, duration, maxIterations).

  • true or omitted: defaults applied
  • { ... }: defaults applied with custom options
  • false: bare minimum, no defaults

instructions: string

System prompt injected into every model call.


model: string | LanguageModelV3

Model identifier string (“provider/model”) or a LanguageModelV3 object.


name: string

Agent name for debugging and tracing.