# dsh-automode โก
**Claude Codeโstyle auto mode for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)** โ let your agent run hands-free, while a deterministic guardrail and a cost-aware reviewer keep the dangerous stuff from ever executing.
> ๐ **็ฎไฝไธญๆ**: [README.zh.md](./README.zh.md) ยท **English**: [README.md](./README.md)
[](https://www.npmjs.com/package/@log.li/dsh-automode) [](https://www.npmjs.com/package/@log.li/dsh-automode) [](./LICENSE) [](https://github.com/log-li/dsh-automode) [](https://github.com/log-li/dsh-automode) [](https://github.com/log-li/dsh-automode) [](https://github.com/topics/dsh-plugin)
---
dsh-automode sits between your agent and the harness. It intercepts every tool call **before execution** โ hard `deny` rules and curated `allowPaths` decide deterministically (zero LLM cost), and whatever is left goes to a two-stage classifier. Safe actions run on their own; risky ones are blocked, reshaped, or routed to you.
## โจ Key features
- ๐ก๏ธ **Deterministic first line** โ regex `deny` bands hard-block exfiltration, secrets, and system paths before any LLM call; prefix-glob `allow` rules approve routine commands for free.
- โก **Zero-confirmation allowlist** โ `config.allowPaths` is full trust: file ops and bash writes inside it skip the classifier entirely, and escalated calls are auto-granted through the approval bridge (v0.10.0) โ no prompt, no round-trip.
- ๐ง **Cost-aware two-stage classifier** โ a one-token filter pre-screens; only flagged actions get the structured review, and identical actions reuse the verdict cache for 5 minutes.
- ๐ **Circuit breaker + human fallback** โ 3 consecutive (or 20 total) DENYs pause auto mode and route decisions to a human; one human decision resumes and resets.
- ๐ **Full audit trail** โ every allow / deny / bridge decision is appended to `~/.dsh/auto-mode/decisions.jsonl`.
- ๐ **Native preset** โ flip it on from the permission picker or `/auto`; it plays nicely alongside read-only / workspace-write / danger-full-access.
> โ ๏ธ **Not a sandbox.** The plugin runs inside the [DSH](https://github.com/deepseek-ai/deepseek-harness) process; a deliberately malicious plugin can do anything your user account can do. It reduces unsafe autonomous tool use โ it is not an OS security boundary.
## ๐ Table of contents
- [Install](#install)
- [Commands](#commands)
- [How it works](#how-it-works)
- [Rules](#rules)
- [Configuration](#configuration)
- [Logging](#logging)
- [Architecture](#architecture)
- [Compatibility & contributions](#compatibility--contributions)
- [License](#license)
## Install
```bash
dsh plugin add @log.li/dsh-automode
```
From a local checkout:
```bash
dsh plugin add ./path/to/dsh-automode
```
Restart `dsh web` after installing. The permission picker (bottom-left of the chat box) will show **Auto mode** alongside read-only / workspace-write / danger-full-access.
### Optional: the โก glyph in the permission picker
The `auto-mode` preset declares an `icon`, but **stock DSH ignores a preset's `icon` on both sides**: the host preset schema has no `icon` field and `optionOf()` forwards none, and the client bundle hardcodes the three built-in glyphs. So the bolt renders only after you apply the shipped patch, which adds the schema field, forwards the value to the client catalog, and teaches the client to draw it:
```bash
#