Overview
The Draft SDK lets external AI agents create goals, generate tickets, monitor execution, and review results — all programmatically. Agents interact with Draft the same way a human would, but through code.Install
Quick Start
- Creates a goal from your description
- Generates actionable tickets using AI
- Approves tickets automatically
- Executes each ticket in an isolated git worktree
- Runs verification (tests, lints)
- Auto-approves passing revisions
- Returns the final result
Agentic-First Design
Draft is built for agents. The SDK exposes the same API surface that the web UI uses, so agents are first-class citizens:Resource-Based API
client.goals, client.tickets, client.jobs, client.revisions — mirrors the REST API structure.Polling Built In
client.jobs.wait() and client.run_goal(wait=True) handle polling automatically with configurable timeouts.Progress Callbacks
Pass
on_progress to get real-time events as the pipeline progresses.Full Control
Use the high-level
run_goal() or go granular with individual resource methods.Authentication
When Draft runs with auth enabled (AUTH_ENABLED=true), pass a JWT token: