
dazai — burn-after-reading secret (motokano)
io.github.New1Direction由 GitHub 帳號 New1Direction 發布v0.1.0更新於 Oct 24, 2026
Serve a secret to an agent exactly N times from locked RAM, then wipe it and self-destruct.
概覽
本機 MCP 伺服器:從鎖定記憶體中依指定次數把密鑰交給代理,之後抹除並自我終止。
- 可以做什麼
- 依固定次數把預先載入的靜態密鑰值提供給代理,之後從鎖定記憶體抹除並結束行程。
- 把代理的行程 ID 註冊到看門狗守護程式,讓工作階段結束時該行程被終止。
- 執行心跳用戶端,把守護程式的生命週期綁定到終端機或 SSH 工作階段。
- 可選擇把固定欄位的生命週期記錄(裝載、讀取、抹除、終止)附加到防竄改帳本檔案。
- 適用情境
- 適合代理只需一次性使用某個憑證、且希望明文用後即消失的情境,也適合希望工作階段結束時代理自動退出的情境。對象是目前把密鑰明文寫在 MCP 設定裡、想縮小暴露窗口的使用者。
- 執行需求
- 以本機行程透過 stdio 執行,支援 macOS 與 Linux;預先編譯的執行檔涵蓋 macOS arm64/x86_64 與 Linux x86_64/arm64,也可用 Cargo 從原始碼建置。受 seccomp 限制的守護程式需在 Linux 上從原始碼建置,並需 libseccomp-dev 與 pkg-config。密鑰透過命令列工具定義傳入,未宣告任何環境變數或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 dazai — burn-after-reading secret (motokano),將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ningen-shikkaku
Burn-after-reading secrets for AI agents.
ningen-shikkaku ships two small Rust binaries — dazai (the session-bound daemon) and motokano (a self-immolating one-shot MCP server).
Your MCP configs are full of plaintext API keys, and every agent you run can read all of them — and they keep working long after the agent is done. dazai inverts that: secrets live in locked, non-swappable RAM, are served to agents over MCP, and are destroyed after N reads — or the instant your session dies.
Point any MCP client at it and call get_key once → you receive s3cr3t
→ the server wipes the value out of locked memory and SIGKILLs itself. Call
again → the process is gone.
Install
Prebuilt binaries are built with default features; the seccomp-confined daemon
is a from-source build (it links libseccomp — install libseccomp-dev +
pkg-config first).
Use it with Claude Code
Any MCP client works the same way — the transport is plain stdio.
And the second act: a dead-man's switch for your agents
The same daemon is a session kill-switch. Any MCP client registers its PID;
when your shell/SSH session dies, your heartbeat stops, or a panic signal
arrives, dazai SIGKILLs every registered process, overwrites its secrets
with a wipe the compiler can't optimize away, and exits. Walk away: agents
die, secrets burn.
It runs only on your own machine, on your own secrets and your own configured tools. It never touches another process, file, or host.
What's in the box
It ships in two layers:
- a hardened Rust daemon + tooling — the real thing:
mlock(no swap),madvise(MADV_DONTDUMP)+prctl(PR_SET_DUMPABLE, 0)(no core dumps / no ptrace), a seccomp syscall allowlist (noexecve/open/connect/…), and a non-elidableexplicit_bzero/memset_swipe; and - a Python reference implementation — the original proof-of-concept that
established the mechanism (see
python-reference.md).
Architecture
Korg interop
dazai daemon and motokano can feed Korg's
tamper-evident ledger: --korg-sink PATH (or /dev/fd/N for a pre-opened
descriptor) appends one Korg append-shape record per arm, session, read, wipe
and kill step. Records carry only fixed-vocabulary fields and counters. Secret
values, lengths, digests, tool names, arguments, paths and the environment are
never recorded. Korg imports the file through its ningen-shikkaku.lifecycle@v2
envelope profile and assigns sequence numbers, hashes and signatures. See Korg lifecycle records.
Threat model
daZai shrinks the window and the surface in which plaintext secrets are reachable, and makes session-end deterministically destroy them.
It protects against:
It does NOT protect against (and the project is deliberately honest about this):
- GPU VRAM. If an attached LLM/agent copies a secret into GPU memory, killing the host process does not wipe VRAM. daZai controls host RAM and the processes it supervises — not an accelerator's memory.
exec-tool stdout.motokano'skind=exectools return a command's stdout, which is OS-buffered and not held in a locked buffer. Usekind=static(a pre-loaded, locked, wipeable value) when you need the wipe guarantee.- Managed-runtime residue (Python reference). CPython copies
bytesfreely, so a secret may transiently live in unlocked heap before/after the locked buffer. The Rust implementation eliminates this for its own buffers (data is written into the locked mapping and never copied to a GC heap); the Python tier is a reference, not a hard guarantee. - A privileged or same-UID attacker on the live box (root,
/proc/<pid>/mem, a debugger) reading memory before the wipe.mlockstops swap, not memory reads; seccomp +PR_SET_DUMPABLEraise the bar on Linux, but an adversary who already has privileged access to your running machine is out of scope. - Cold-boot / DMA / physical attacks on RAM.
- A hard crash (kernel OOM, an external
kill -9, power loss): the wipe path can't run, so nothing is zeroed. The mechanism is best-effort on these paths and never claims otherwise.
In short: daZai is not, and cannot be, a guarantee against an attacker who already owns your running machine. It is a sharp tool for making secrets ephemeral and session-bound, with every limitation stated up front.
Verification
- 81 tests across the Rust workspace (secure memory, the panic policy, the wire protocol, the MCP layer, the one-shot lifecycle, the Korg lifecycle contract) plus the 29-test Python reference.
- Linux seccomp is validated on both architectures under the real
KillProcessfilter —aarch64(locally) andx86_64(CI) — where the daemon installs the live filter and the full integration suite runs against it with noSIGSYS. - Every push runs the whole suite (default and
--features seccomp),clippy -D warnings, andrustfmt --checkon x86_64 Linux as a permanent regression gate.
Deep technical docs (per-crate design, the seccomp allowlist, the
adversarial-review history) live in rs/README.md; the Python
proof-of-concept is in python-reference.md.
The name
Named for the novelist Osamu Dazai, whose work circles themes of disappearance and self-erasure — fitting for software whose defining act is to wipe itself out the moment it is no longer being watched over. The repository takes its name from his novel No Longer Human (人間失格, Ningen Shikkaku). It's flavor, not a manifesto; the software just self-destructs on cue.
License
MIT © 2026 New1Direction.
來源:README.md,提交 f464356
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分