The official Python SDK launches and drives a matching Harness runtime over JSON-RPC. It is intended for embedding an agent in Python services, tests, or automation—not for replacing the Web UI.
Install
pip install deepseek-harness-sdk
The SDK requires Python 3.10+. The official documentation currently lists Linux x64/arm64 and macOS 14+ arm64 as runtime platforms. Installation includes a runtime wheel from the same release, so Node.js does not need to be installed separately.
Keep versions aligned
The Python SDK and runtime wheel should use the same version. DSH is still prerelease software; do not allow the SDK to drift automatically to a version different from the tutorial or service that depends on it.
Sessions and processes
The SDK client communicates with the runtime process over stdio JSON-RPC. The caller should explicitly manage the workspace, agent ID, session ID, permission callbacks, and process lifecycle.
Important security warning
The official minimal composition uses danger-full-access. Its persistent Bash process and absolute file-editing paths may modify any location visible to the runtime.
Run a first experiment in a disposable checkout, container, or virtual machine. Do not point the minimal composition directly at a directory containing private files, production credentials, or uncommitted work.
When to choose it
- You need Python to control the flow, receive events, or handle permission callbacks.
- You need to embed an agent in an existing Python system.
- You need finer lifecycle control than Headless’s single final text response.
For a single task from the shell, Headless is shorter. If the target client natively supports ACP, the official ACP example is closer to that protocol integration.
Evidence and revision
Primary sources
This guide is intentionally concise; use the official source or documentation below as the authority for commands, behavior, and risk boundaries.