When to use the SDK
Use the SDK when you are building any of the following outside the managed local runner:- External agent harness — a Node.js or Python service that drives coding agents on your behalf
- MCP server — a Model Context Protocol server that needs to read or write AgentRail task state
- Workflow runner — an orchestration layer that submits work, polls CI, and ships when conditions are met
- Internal service or test tool — anything that should call AgentRail directly over HTTP
When NOT to use the SDK
Managed local agents launched byagentrail server start do not need the SDK. Those agents receive a single run-scoped task and interact with AgentRail through the CLI:
Available SDKs
AgentRail ships two SDKs with identical coverage of the Task Lifecycle API.
Both SDKs require you to supply
baseUrl (or base_url) and apiKey (or api_key) explicitly. There are no hidden defaults that silently fall back to a local server.
Run
agentrail init and agentrail agent create to generate ~/.agentrail/agent.env with the two values you need before using either SDK.Next steps
Install the TypeScript SDK
Set up
@agentrail-core/sdk for Node.js 18+.Install the Python SDK
Set up
agentrail for Python 3.10+ with async/await..png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)