Configuration reference

Every option createAgent() accepts, in one place. For what each type is for, see agent types.

Shared options#

Accepted by all three types.

OptionTypeDefaultNotes
type'one-shot' | 'agent' | 'saga'requiredSelects the overload
systemPromptstring-The agent's role and quality bar
modelstringtype-dependentSee the defaults below
effortstringmodel defaultReasoning effort, e.g. xhigh
maxOutputTokensnumber128000Cap on generated tokens

By type#

Optionone-shotagentsaga
temperature--
stop--
instructions-
deadlineMs-
contextWindow-
tools-
toolAllowlist-
maxTools-
skills-
mcpServers-
imageModel-
outputs-
maxOutputInlineBytes-
maxTurns--
permissionMode--
groundingModel--
maxSteps--
parallelism--

TypeScript enforces this table. An option in the wrong column is a compile error, not a runtime surprise.

Defaults#

OptionDefaultWhat it sets
model for one-shotdeepseek/deepseek-v4-flashModel used by the synchronous response endpoint
model for agent and sagadeepseek/deepseek-v4-proModel used by the managed runtime
maxOutputTokens128000Maximum tokens the model may generate in one response
contextWindow250000Size of the agent's working context across a run
deadlineMsnoneWall-clock execution deadline. Unset means the run is unbounded
permissionModeautoDefault permission policy for agent
groundingModeldeepseek/deepseek-v4-flashGrounding model for saga
maxOutputInlineBytes262144Maximum bytes projected inline when not set explicitly
toolAllowlistderivedTool names visible to the model. Derived from the rest of the config when unset. See Tools

Connection options#

The second argument configures transport rather than behaviour, and is the same shape new CoreSource() takes.

OptionTypeDefault
apiKeystringCORESOURCE_API_KEY
baseUrlstring | URLCORESOURCE_API_URL, then https://api.coresource.ai/v1/
fetchtypeof fetchglobal fetch
ttlSecondsnumber3600 for an SDK-hosted bridge

ttlSeconds applies only when local capabilities cause the SDK to provision a bridge. The accepted range is 60 seconds through 30 days.

TypeScript
import { createAgent } from '@coresourceai/sdk';

const agent = createAgent(
  { type: 'agent', systemPrompt: 'Be careful.' },
  {
    apiKey: process.env.CORESOURCE_API_KEY,
    baseUrl: 'https://api.example.com/v1/'
  }
);

await agent.close();

See Authentication for keys, deployments, and supplying your own fetch.

Lifecycle#

createAgent() is synchronous and lazy. It prepares the agent locally and does no network work until run() or start().

close() releases what the agent holds and makes further use of the handle an error. A live bridge is created when an agent or saga uses custom tools, runtime tools, local skill bundles, or locally registered MCP.

TypeScript
import { createAgent } from '@coresourceai/sdk';

const agent = createAgent({ type: 'agent' });

try {
  const result = await agent.run('Do the work.');
  console.log(result.text);
} finally {
  await agent.close();
}

registerRuntimeTools() and registerMcpServer() must be called before the first run starts; afterwards they throw, because the tool set is fixed when the run begins.