DeepSeek Harness Architecture: Why ‘Everything Is a Plugin’ Is Not a Slogan
Use the official architecture.md to explain profiles, bundles, the session log and turn/step. No package table dump — only where new behavior should attach.
Open the official tutorial| Item | Details |
|---|---|
| Provider | DeepSeek Harness |
| Level | Intermediate |
| Date | 2026-08-13 |
| Official source | DeepSeek Harness |
| Topics | #agents · #engineering · #open-source |
One sentence first
The official architecture doc assumes you know Cordis. If you do not, remember its job: plugins contribute services, typed events and reversible effects to a shared context. There is no privileged core. The model adapter, tool registry, session log and agent loop are all plugins.
Profiles and bundles
A running dsh is a plugin tree composed at boot.
- A profile is a named composition. Shipped templates are
webandheadless. It lists the bundles it stacks and keeps yourcordis.patch.yml. - A bundle is a patchable plugin layer.
dsh-baseis the first layer of every profile (models, tools, persistence, sandbox, credentials).dsh-web-appadds the browser app.dsh-headlessis a one-shot runner with no server.
Layers apply in this order: each bundle, then the profile patch, then the home-level patch, then --patch. To see the tree your machine actually boots:
sh dsh --profile web --dump-config
Any row it prints can be replaced by a patch of your own.
The session log is what the model sees
Official hard rule: Model-visible means logged. Anything that reaches a model request must be reconstructable from the session log. Fork, resume, transcripts and telemetry all derive from that stream. New model-visible input needs a new session event — do not sneak text into the loop.
Turns and steps
A step is one model request plus the tools it calls. A turn is zero or more steps. Input reaches one inbox. agent/pre-step decides what the model sees; listeners may rewrite or reject. A rejected first claim still closes a durable turn that spent no step.
To intercept a request, tool or turn, hang off agent/* or tools/*. Do not start by editing the loop.
Where new behavior goes
The official map is the authority. The rows you will use first:
| Goal | Mechanism |
|---|---|
| Add a model provider | ctx.llm |
| Add a model-facing capability | ctx.tools; its schema joins prompt assembly |
| Add a human command | ctx.commands; no model turn |
| Add filesystem access or policy | ctx.fs or fs/* |
| Confine spawned processes | ctx.sandbox |
FAQ
What is the difference between dsh, a profile and a bundle?
dsh is the launcher. A profile is a named composition. A bundle is a patchable plugin layer.
Why not patch the agent loop?
The official doc says new behavior attaches to a documented extension point. Changing the loop itself updates that map. In a developer preview, forking the core loop means you merge conflicts on every upgrade.
Official source: DeepSeek Harness architecture.md. This is a decision map; package names and event tables belong to the repo.
Sources & Further Reading
This page is grounded in the authoritative sources below — verifiable and citable by AI engines and readers.
- 🔗 Official source
- 👤 Person: DeepSeek Harness
- # Topic: AgentsBuilding, orchestrating and shipping AI agents
- # Topic: EngineeringAPIs, prompting and system design
- # Topic: Open SourceOpen models, frameworks and ecosystems
Citation: Please attribute Laojin Global (laojinchuhai.com) and keep the original link.
Made by Laojin · AI that ships
AllModelsAPIOne key for many models
AllModelsAPI is a multi-model API gateway: one key reaches many models through an OpenAI-compatible interface — point your existing code at a new base URL and you're migrated. It's not a demo: our own production workloads run on it every day.
More from Laojin: Sellenca · 365AIOrg · 365Loopa · 365 Ops · 365Skill
Related
Linked by topic, people and hubs