DeepSeek Harness is an open-source agent runtime from DeepSeek.
It is not a model. It is the application that connects a model to your project files, terminal, tools, permissions, and session history.
We will use the DeepSeek cloud API. You do not need Ollama, a local model, or a powerful GPU.
DeepSeek Harness is currently a developer preview. Commands and settings may change between versions.
What Runs Locally?
This tutorial uses the following setup:
Your computer:
DeepSeek Harness
Browser interface
Source code
Terminal commands
File changes
DeepSeek cloud:
- DeepSeek V4 model
The Web UI is local, but repository context may be sent to the DeepSeek API when the model needs it.
Do not use a confidential repository for your first test.
Requirements
You need:
- Git
- Node.js 22.19 or later
- npm and npx
- A DeepSeek API key
- API balance
- A browser
The current repository supports Node.js ^22.19.0 or Node.js 24+.
Check your versions:
node --version
npm --version
npx --version
git --version
For a new installation, Node.js 24 is a good choice.
With NVM:
nvm install 24
nvm use 24
nvm alias default 24
Create a Demo Project
Create a disposable project:
mkdir deepseek-harness-demo
cd deepseek-harness-demo
git init
Create calculator.js:
export function multiply(a, b) {
return a + b;
}
The function contains a bug. It adds the numbers instead of multiplying them.
Create calculator.test.js:
import test from "node:test";
import assert from "node:assert/strict";
import { multiply } from "./calculator.js";
test("multiply returns the product of two numbers", () => {
assert.equal(multiply(3, 4), 12);
});
Create package.json:
{
"name": "deepseek-harness-demo",
"private": true,
"type": "module",
"scripts": {
"test": "node --test"
}
}
Run the test:
npm test
It should fail.
Commit the initial state:
git add .
git commit -m "Add calculator with intentional bug"
A Git commit makes it easy to inspect and undo the agent's changes.
Start DeepSeek Harness
Remain inside the project folder and run:
npx @deepseek-ai/dsh web
The current official README uses this as the main Web UI command. The server normally starts on port 3080.
Open:
http://127.0.0.1:3080
Keep the terminal process running.
When port 3080 is unavailable, choose another port:
npx @deepseek-ai/dsh web --port 3081
Then open:
http://127.0.0.1:3081
Add Your DeepSeek API Key
Inside the Web UI:
- Open Settings
- Open Models
- Find the DeepSeek provider
- Paste your API key
- Save
The built-in DeepSeek configuration does not require you to manually add a custom base URL.
Harness stores the key through its local credential system. The settings keep a credential reference, while the browser receives a redacted description instead of the saved secret.
Do not show this screen while recording a video.
Select a Model
Return to the main interface and choose:
DeepSeek-V4-Flash
DeepSeek-V4-Flash
deepseek-v4-flash
The official DeepSeek adapter currently advertises V4 Flash and V4 Pro by default.
Start with Flash. Use Pro later for more difficult tasks.
Create a new session after changing models. Existing sessions keep the model recorded in their own history.
Choose the Workspace
Click Choose workspace and select the demo project.
Run this command when you need the full path:
pwd
A new Harness Web UI does not enable the message composer until you select a workspace.
Select Safe Permissions
Choose the permission preset that uses:
workspace-write
and asks before sensitive operations.
Avoid this preset during your first run:
danger-full-access
The default workspace-write preset combines workspace confinement with an approval policy of ask. The default danger-full-access preset combines broad access with never.
Use a disposable project even with the safer option.
Give the Agent a Clear Task
Paste this prompt:
Inspect this repository.
Run the tests using:
npm test
Find the root cause of the failing test and fix it.
Requirements:
- Do not install packages.
- Do not access files outside this workspace.
- Make only the smallest necessary change.
- Run the tests again after changing the code.
- Inspect the final Git diff.
- Do not claim success unless all tests pass.
- Summarize exactly what you changed.
The expected workflow is:
Read the source file
Read the test
Run npm test
Find the incorrect + operator
Replace it with *
Run the test again
Inspect the Git diff
Return a summary
Approve only actions that you understand.
Verify the Result
Do not trust the agent's final message without checking it.
Run:
npm test
Then inspect the code change:
git diff
The expected diff is:
export function multiply(a, b) {
- return a + b;
+ return a * b;
}
Check the repository status:
git status
Only the intended file should be changed.
How the Agent Loop Works
One model response is usually not enough for a coding task.
Harness may run several steps:
User prompt
↓
Model request
↓
Tool call
↓
Permission check
↓
Local tool execution
↓
Tool result
↓
Another model request
↓
Final response
A step includes one model request and the tools called from that request. A turn can contain several steps.
The durable session log can store user messages, assistant output, tool calls, tool results, and execution boundaries. Harness reconstructs model history from this event stream.
This supports:
- Session resume
- Replay
- Forking
- Transcripts
- Debugging
- Persistence
It also helps you understand why the agent made a particular decision.
What to Try Next
After the small demo works, test a real but non-sensitive repository.
A useful prompt is:
Before changing files:
1. Read the relevant documentation.
2. Run the existing tests.
3. Explain the root cause.
4. Propose the smallest fix.
After I approve:
1. Apply the change.
2. Run the relevant tests.
3. Inspect the final diff.
4. Report remaining risks.
Learn more about DeepSeek Harness on my website: https://proflead.dev/
Top comments (0)