Xiaol.x
By eliminating a hardwired execution engine, DeepSeek demonstrates that an agent is defined not by its model, but by the explicit composition of sandboxes, guards, and peer services wired around it.
AI-assisted summary of DeepSeek Harness: Everything is a Plugin! New Open-Source AI Agent Framework (Hands-on) — original source. Check the original for full context.
Source published:
Key ideas
- DeepSeek open-sourced DeepSeek Harness (dsh), an agent framework where the core agent loop itself is an interchangeable plugin sitting alongside tools, sandboxes, and the user interface. (0:01)
- The framework features Programmatic Tool Calling (Code Mode), enabling models to run consolidated scripts through an ephemeral worker thread that resets after every run to prevent notebook-style state leakage. (4:24)
- Long-running autonomy is broken into an auditable hierarchy of persistent goals, background jobs, deterministic workflows, and delegatable sub-agent sessions rather than an unconstrained execution loop. (5:11)
- An in-memory 'Creator' capability allows agents to dynamically inspect, define, mount, and purge their own plugins at runtime, though all self-generated extensions remain strictly ephemeral. (5:59)
Detailed notes
## Background Published on YouTube by Xiaol.x on August 16, 2026, this video provides a hands-on developer preview walkthrough of DeepSeek Harness (dsh). According to the description, the open-source framework is built on the Cordis framework and features an architecture where 'everything is a plugin'—enabling developers to swap models, tools, sandboxes, execution loops, and user interfaces via configuration without a hard-coded core.
## TL;DR The walkthrough explores DeepSeek Harness's radical architectural design, which demotes the central agent loop to an ordinary, swappable plugin anchored to a unified execution substrate. It details how runtime sessions assemble through explicit profile patches and strictly log turns into an append-only event stream governed by monotonic security guards. The overview also compares standard tool calling against Code Mode (Programmatic Tool Calling), details structured autonomy primitives such as Goals and Sub-Agents, and analyzes the reflective 'Creator' mode that allows agents to synthesize ephemeral in-memory plugins on the fly.
## Atmosphere & style The presentation is analytical, precise, and deeply technical, feeling more like a systems architecture post-mortem than a standard product demo. The narration maintains a sober, engineering-focused tone, balancing fascination with the elegance of pure composability against clear-eyed warnings regarding the framework's strictness, configuration friction, and early preview status.
## Bulletin - [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) DeepSeek open-sourced DeepSeek Harness (dsh), an agent framework where the core agent loop itself is an interchangeable plugin sitting alongside tools, sandboxes, and the user interface. - [04:24](https://www.youtube.com/watch?v=z9riGTseD0I&t=264s) The framework features Programmatic Tool Calling (Code Mode), enabling models to run consolidated scripts through an ephemeral worker thread that resets after every run to prevent notebook-style state leakage. - [05:11](https://www.youtube.com/watch?v=z9riGTseD0I&t=311s) Long-running autonomy is broken into an auditable hierarchy of persistent goals, background jobs, deterministic workflows, and delegatable sub-agent sessions rather than an unconstrained execution loop. - [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) An in-memory 'Creator' capability allows agents to dynamically inspect, define, mount, and purge their own plugins at runtime, though all self-generated extensions remain strictly ephemeral.
## Key takeaways - [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) The core agent loop is treated as an ordinary, swappable plugin row rather than a hardcoded engine, allowing the fundamental behavior of the agent to change without modifying the core codebase. - [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) DeepSeek Harness enforces that the filesystem, terminal, and language server protocols bind to a unified execution substrate to eliminate state desynchronization across disjoint local and remote environments. - [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) Runtime configurations construct deterministically from an empty list using profiles, bundles, and explicit patch directives, loading plugins strictly according to dependency resolution. - [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) Decoupled architectural seams separate abstract contracts, provider implementations, and model-facing tools, enabling backend swaps between local hosts and sandboxes without touching prompt definitions. - [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) Service slot registrations are strictly singular: duplicate attempts to claim an active slot fail immediately to prevent ambiguous, silent state overwrites. - [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) Every interaction lifecycle event is appended to an audit log, but only user messages, assistant responses, and tool execution results are ever compiled into the model's prompt context. - [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) Pre-execution security guards operate monotonically so that no downstream policy can override an earlier execution denial. - [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) Sandbox permissions enforce fail-closed security across explicit filesystem tiers, committing immutable frozen output events upon execution completion. - [04:24](https://www.youtube.com/watch?v=z9riGTseD0I&t=264s) Code Mode (Programmatic Tool Calling) lets the model write a single script that coordinates multiple tools and branch logic internally, bypassing multiple conversational round-trips. - [04:24](https://www.youtube.com/watch?v=z9riGTseD0I&t=264s) Worker threads in Code Mode are destroyed and recreated between script executions to prevent hidden variable state leakage. - [05:11](https://www.youtube.com/watch?v=z9riGTseD0I&t=311s) Autonomous execution is broken down into structured primitives—session goals, asynchronous jobs, multi-step workflows, and child sub-agents—to ensure auditability. - [05:11](https://www.youtube.com/watch?v=z9riGTseD0I&t=311s) Sub-agent providers can spawn isolated child sessions that maintain stable identities and submit structured settlement reports back to the primary agent. - [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) The reflective Creator capability permits live self-modification using five verbs—Inspect, Define, Run, Stop, and Forget—without generating static files on disk. - [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) Dynamic agent self-modifications are strictly ephemeral and disappear upon process restart, requiring persistent extensions to be authored as reviewed plugins. - [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) DeepSeek Harness embodies an architectural thesis prioritizing strict composability over ease of use, establishing that the explicit plugin composition itself constitutes the agent.
## Detailed walkthrough ### [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) The Agent Loop as an Ordinary Plugin
The most striking architectural choice in DeepSeek Harness (`dsh`) is that the core agent loop itself is not hard-coded into a privileged engine. Instead, the loop exists as an ordinary, interchangeable plugin row sitting alongside timers, model adapters, session managers, tools, and the web interface. If a developer disables or swaps that single row, the entire behavior of the system transforms without requiring engine patches. This design presents a conceptual paradox: if the central loop can be swapped out like any off-the-shelf utility, what actually defines the agent? The answer lies in the dynamic plugin tree—the explicit assembly of services, event streams, sandboxes, policies, and interfaces constructed around the underlying model.
```mermaid flowchart TD accTitle: DeepSeek Harness Plugin Composition Architecture accDescr: Diagram illustrating how DeepSeek Harness treats the agent loop, sandbox, tools, and UI as peer plugins wired to an execution substrate.
subgraph Assembly ["Assembly Recipe (Profile & Patches)"] direction TB P["Profile / Bundles"] --> R["Plugin Registry"] end
subgraph Peers ["Peer Plugin Tree"] direction TB AL["Agent Loop Plugin"] MA["Model Adapter Plugin"] ST["Session & Storage Plugin"] UI["Web UI Plugin"] end
subgraph Substrate ["Unified Execution Substrate"] direction TB FS["File System"] SH["Shell / Terminal"] LSP["Language Server"] end
R --> Peers Peers --> Substrate ```
A hardwired, monolithic agent loop functions adequately when every capability runs locally on a single machine. The breakdown happens when components split across separate environments. If an agent executes Bash commands inside a remote sandbox while editing files locally on a laptop and querying a language server tied to an entirely different repository checkout, the illusion breaks: remote test suites pass, the local editor writes to a mismatched file, and code diagnostics reflect a third reality. While no individual module has crashed, "the agent no longer has one world." DeepSeek Harness targets this desynchronization as a fatal architectural flaw, enforcing that the filesystem, subprocess execution, terminal environment, and language server protocols must anchor to a single, explicit execution substrate.
[01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) Profiles, Assemblies, and Decoupled Contracts
To avoid hidden global state, DeepSeek Harness builds every runtime configuration starting from an empty list. A designated profile names the base composition, while bundles insert cohesive groups of plugin rows. Customization occurs through a strict hierarchy: profile patches, home configuration patches, and optional command-line overlays add or substitute rows by their unique identifier. The activation order is determined strictly by dependency resolution—a plugin loads only when every upstream service contract it requires is active. Furthermore, patching uses an intentionally blunt replacement rule: patch directives replace an entire row wholesale rather than performing complex, opaque field-level merges. This creates a verbose but fully transparent and reproducible assembly recipe rather than a black-box binary.
This dynamic tree relies on clean contract seams. For example, shell execution is broken into distinct architectural layers: - An abstract contract package standardizes input arguments and return structures for running commands. - A host provider implements the contract by running Bash directly on the local machine. - A sandbox provider fulfills the identical contract while enclosing execution within a containerized or confined sandbox. - A model-facing tool exposes the Bash capability to the LLM, consuming whichever underlying provider was registered by the composition.
Because interfaces, concrete implementations, and model presentations evolve independently, swapping the execution backend requires zero modifications to the tool contract or prompt logic. To prevent ambiguous state, service registrations are strictly singular: if two providers attempt to claim the exact same service slot, the second registration fails immediately rather than silently overwriting the first. When a plugin is deactivated, its cleanup handlers fire automatically, removing its tools, event listeners, and prompt fragments from the active session.
[02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) Turn Execution Lifecycle and Event Logging
During an execution turn, DeepSeek Harness logs the entire interaction lifecycle into an append-only event stream. The harness captures `turn start`, `step start`, raw user inputs, streaming assistant chunks, the assembled assistant response, every tool invocation, tool execution outputs, and terminal turn boundaries. The majority of these events serve auditing, session replay, policy enforcement, and UI rendering; only three specific event types are ever compiled into the prompt context for the model: 1. User messages 2. Assistant messages 3. Tool execution results
System prompts, model parameters, and tool schemas are decoupled from the conversational history and recorded separately as request headers, adhering to the principle that anything "model-visible means logged." Because session persistence, branching forks, replays, and conversation histories all project directly from this append-only stream, the agent can resume past sessions deterministically.
```mermaid flowchart LR accTitle: Tool Execution Pipeline accDescr: Flowchart showing the progression of a tool call from logging through pre-execute guards to sandboxed execution and frozen output.
TC["Tool Call Logged"] --> PE["Pre-Execute Hooks & Guards"] PE --> Mode{"Sandbox Mode Resolved"} Mode -->|"Read-only / Write / Dangerous"| Exec["Timeout Wrappers & Tool Body"] Exec --> Post["Post-Processing & Content Finalization"] Post --> FR["Frozen Result Event"] ```
When a tool call is initiated, it is written to the persistent log before any code executes. Execution then flows through a shared pre-execute pipeline that evaluates security hooks, permissions, and sandbox constraints: - Guard policies operate monotonically: a guard can deny execution, but no downstream policy can overturn an earlier denial into an approval. - Sandbox permissions are resolved per invocation across distinct access tiers (read-only filesystem, workspace-write, or unrestricted access). - If confinement fails, the system fails closed rather than falling back to unconfined execution. - Approved calls pass through timeout wrappers, run the target tool body, process outputs, and commit a single, immutable frozen result event to the log. - These sandbox tiers specifically constrain filesystem access; they do not construct isolated network or process boundaries comparable to full virtual machines.
[04:24](https://www.youtube.com/watch?v=z9riGTseD0I&t=264s) Standard Mode vs. Code Mode (PTC)
DeepSeek Harness provides distinct operational modes that alter how tools interface with the language model:
| Operating Mode | Exposure Pattern | Interaction Overhead | State Lifecycle | |:--- |:--- |:--- |:--- | | **Standard Mode** | Directly exposes granular tool definitions and schemas to the LLM prompt. | Requires conversational model round-trips for every individual tool step and intermediate value. | Dependent on standard session turns. | | **Code Mode (Programmatic Tool Calling / PTC)** | Exposes a generated SDK through a single execution transport named `run_code`. | Low; the model writes a consolidated program that branches internally and returns only the final payload. | Execution runs in a dedicated worker thread that resets completely after each run. |
In Code Mode, instead of inundating the model context with conversational chatter and back-and-forth round-trips for simple data transformations, the LLM emits a compact script. This script invokes multiple tools sequentially, evaluates intermediate conditions programmatically, and returns just the relevant output. Even though these tool calls originate from within generated code, they are not backdoors: every subcall routes back through the standard permission pipeline, adheres to monotonic sandbox rules, and receives durable dispatch entries in the event log.
Critically, the harness avoids state leakage across executions. The runtime deliberately prevents state from persisting across `run_code` scripts—avoiding the hidden variable baggage typical of persistent Jupyter-style notebooks—by destroying and recreating the worker thread runtime between invocations.
[05:11](https://www.youtube.com/watch?v=z9riGTseD0I&t=311s) Structuring Autonomy: Goals, Jobs, Workflows, and Sub-Agents
Rather than treating autonomous behavior as an open-ended loop, DeepSeek Harness decomposes prolonged execution into an inspectable ownership graph divided across four primitives:
- **Goals:** Track persistent, session-level objectives that remain active across multiple interaction cycles, driving subsequent agent turns until completion criteria are satisfied. - **Jobs:** Represent detached background tasks that can be monitored asynchronously, queried for status, harvested for outputs, or explicitly canceled. - **Workflows:** Coordinate deterministic, programmatic multi-step logic that orchestrates complex routines without relying solely on model prompt chaining. - **Sub-Agent Providers:** Spawn and delegate isolated child sessions to auxiliary engines or specialized external coding CLI agents, such as Codex or Claude Code.
Child sessions maintain stable, continuable identities. They accept follow-up instructions from the primary agent and report back structured settlement reports once their delegated objectives are achieved. By structuring operations this way, autonomy transforms from an opaque, runaway loop into a visible, hierarchical tree where every descendant task and delegation path can be inspected, paused, or audited in real time.
[05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) Self-Modification, Ephemeral Plugins, and Developer Preview Trade-offs
DeepSeek Harness features a reflective "Creator" capability allowing the agent to dynamically inspect and augment its own architecture via five core verbs: 1. **Inspect:** Examine active runtime components, available services, and loaded plugins. 2. **Define:** Programmatically generate an in-memory plugin package containing new tools, prompt injections, services, or browser interface components. 3. **Run:** Mount and activate the dynamic package directly into the live process. 4. **Stop:** Deactivate the dynamic package and trigger cleanup routines. 5. **Forget:** Purge the package entirely from the runtime environment.
This self-modification capability is strictly ephemeral by design. The model creates no physical plugin files on disk, executes no package manager installations, and modifies no static configuration files; all dynamically generated capabilities vanish upon process restart. Because the in-memory execution environment functions as containment for well-intentioned code rather than a hardened security perimeter, running these ephemeral extensions requires the same level of user trust as running raw Bash commands. Persistent features must be authored as standard, human-reviewed plugins.
DeepSeek Harness is released as a developer preview with explicit warnings that breaking API changes will occur. The framework trades simplicity for rigor: developers inherit extensive configuration overhead, multiple abstraction layers to debug, a stateless code runtime, and self-modifying plugins that deliberately refuse to persist. Yet this architecture embodies a deliberate thesis: DeepSeek Harness is not merely a language model retrofitted with utility tools, but a deterministic, replayable plugin graph where the model loop, policy guards, sandboxed execution, memory management, multi-agent delegation, and frontend UI operate as equal peers. In this paradigm, "the composition is the agent."
## Notable quotes > [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) the core agent loop itself is not hard-coded into a privileged engine. Instead, the loop exists as an ordinary, interchangeable plugin row sitting alongside timers, model adapters, session managers, tools, and the web interface.
> [00:01](https://www.youtube.com/watch?v=z9riGTseD0I&t=1s) the agent no longer has one world.
> [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) DeepSeek Harness builds every runtime configuration starting from an empty list.
> [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) patch directives replace an entire row wholesale rather than performing complex, opaque field-level merges.
> [01:18](https://www.youtube.com/watch?v=z9riGTseD0I&t=78s) if two providers attempt to claim the exact same service slot, the second registration fails immediately rather than silently overwriting the first.
> [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) model-visible means logged.
> [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) a guard can deny execution, but no downstream policy can overturn an earlier denial into an approval.
> [02:47](https://www.youtube.com/watch?v=z9riGTseD0I&t=167s) If confinement fails, the system fails closed rather than falling back to unconfined execution.
> [04:24](https://www.youtube.com/watch?v=z9riGTseD0I&t=264s) The runtime deliberately prevents state from persisting across run_code scripts—avoiding the hidden variable baggage typical of persistent Jupyter-style notebooks—by destroying and recreating the worker thread runtime between invocations.
> [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) The model creates no physical plugin files on disk, executes no package manager installations, and modifies no static configuration files; all dynamically generated capabilities vanish upon process restart.
> [05:59](https://www.youtube.com/watch?v=z9riGTseD0I&t=359s) the composition is the agent.
## Mentioned DeepSeek, DeepSeek Harness, dsh, Cordis, Xiaol.x, Bash, Codex, Claude Code, Jupyter
## Video description DeepSeek just open-sourced DeepSeek Harness (dsh) — a powerful, fully modular AI agent framework where EVERYTHING is a plugin.
In this video I dive into DeepSeek’s brand-new agent harness (developer preview). Built on the Cordis framework, it lets you swap models, tools, skills, sessions, sandboxes, loops, scheduling, and even the UI itself — all through simple configuration. No hard-coded core. Just pure composability.
🔥 What you’ll see: • What DeepSeek Harness is and why “Everything is a Plugin” matters • Quick start: npx @deepseek-ai/dsh web • Web UI walkthrough • Different runtime modes (Standard, Code/PTC, Minimal, Creator) • How Model + Harness = Agent • Plugin architecture & extensibility • Real examples and first impressions
🔗 Official links: GitHub: https://github.com/deepseek-ai/deepseek-harness Official site: https://deepseek.com/harness Paper (Cordis): https://github.com/cordiverse/paper
DeepSeek Harness is currently in rapid developer preview — expect breaking changes, but the architecture is already incredibly ambitious.
If you’re building AI agents, coding agents, or just curious about the next generation of agent frameworks, this is a must-watch.
Like & subscribe for more DeepSeek, open-source AI, and agent content! Drop a comment: Will you try DeepSeek Harness?
#DeepSeek #DeepSeekHarness #AIAgents #OpenSourceAI #dsh #Cordis #AIAgentFramework
[Source](https://www.youtube.com/watch?v=z9riGTseD0I)