add-emacs — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited add-emacs (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Adds Emacs support via a local HTTP bridge. Works with Doom Emacs, Spacemacs, and vanilla Emacs 27.1+.
C-c n c / SPC N c), ask about a function or error without leaving Emacsnanoclaw-org-send; the response appears as a child heading inline in your org fileNanoClaw doesn't ship channels in trunk. This skill copies the Emacs adapter and the Lisp client in from the channels branch. Native HTTP bridge — no Chat SDK, no adapter package.
Skip to Enable if all of these are already in place:
src/channels/emacs.ts existssrc/channels/emacs.test.ts existssrc/channels/emacs-registration.test.ts existsemacs/nanoclaw.el existssrc/channels/index.ts contains import './emacs.js';Otherwise continue. Every step below is safe to re-run.
git fetch origin channelsmkdir -p emacs
git show origin/channels:src/channels/emacs.ts > src/channels/emacs.ts
git show origin/channels:src/channels/emacs.test.ts > src/channels/emacs.test.ts
git show origin/channels:src/channels/emacs-registration.test.ts > src/channels/emacs-registration.test.ts
git show origin/channels:emacs/nanoclaw.el > emacs/nanoclaw.elAppend to src/channels/index.ts (skip if the line is already present):
import './emacs.js';pnpm run build
pnpm exec vitest run src/channels/emacs-registration.test.tsBoth must be clean before proceeding. emacs-registration.test.ts is the one integration test: it imports the real channel barrel and asserts the registry contains emacs. It goes red if the import './emacs.js'; line is deleted or drifts, or if the barrel fails to evaluate (so the channel genuinely would not register). The adapter uses only Node builtins (http), so there is no npm dependency to guard for this channel.
End-to-end message delivery from a real Emacs buffer is verified manually once the service is running — see Verify and Troubleshooting.
The adapter is gated by EMACS_ENABLED so the HTTP port isn't opened on hosts that aren't running Emacs. Add to .env:
EMACS_ENABLED=true
EMACS_CHANNEL_PORT=8766 # optional — change only if 8766 is taken
EMACS_AUTH_TOKEN= # optional — set to a random string to lock the endpoint
EMACS_PLATFORM_ID=default # optional — only change if you want a non-default chat idGenerate an auth token (recommended even on single-user machines — prevents other local processes from poking the endpoint):
node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"Emacs is a single-user, single-chat channel. One host = one messaging group with platform_id = "default".
Run /init-first-agent — pick Emacs as the channel, use any short handle as the "user id" (e.g. your OS username), and the skill will create the agent group, wire the channel, and write a welcome message that the agent delivers back to your Emacs buffer.
Run the register step directly. The EMACS_PLATFORM_ID (default default) becomes the messaging group's platform id:
pnpm exec tsx setup/index.ts --step register -- \
--platform-id "default" --name "Emacs" \
--folder "<existing-folder>" --channel "emacs" \
--session-mode "agent-shared" \
--assistant-name "<existing-assistant-name>"agent-shared puts Emacs messages in the same session as any other channel wired to the same agent group — so a conversation you started in Telegram continues in Emacs. Use shared to keep an independent Emacs thread with the same workspace, or a new --folder for a dedicated Emacs-only agent.
nanoclaw.el needs only Emacs 27.1+ builtins (url, json, org) — no package manager.
AskUserQuestion: Which Emacs distribution are you using?
config.el with map! keybindingsdotspacemacs/user-config in ~/.spacemacsinit.el with global-set-keyDoom Emacs — add to ~/.config/doom/config.el (or ~/.doom.d/config.el):
;; NanoClaw — personal AI assistant channel
(load (expand-file-name "~/src/nanoclaw/emacs/nanoclaw.el"))
(map! :leader
:prefix ("N" . "NanoClaw")
:desc "Chat buffer" "c" #'nanoclaw-chat
:desc "Send org" "o" #'nanoclaw-org-send)Reload: M-x doom/reload
Spacemacs — add to dotspacemacs/user-config in ~/.spacemacs:
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(spacemacs/set-leader-keys "aNc" #'nanoclaw-chat)
(spacemacs/set-leader-keys "aNo" #'nanoclaw-org-send)Reload: M-x dotspacemacs/sync-configuration-layers or restart Emacs.
Vanilla Emacs — add to ~/.emacs.d/init.el:
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(global-set-key (kbd "C-c n c") #'nanoclaw-chat)
(global-set-key (kbd "C-c n o") #'nanoclaw-org-send)Reload: M-x eval-buffer or restart Emacs.
Replace ~/src/nanoclaw/emacs/nanoclaw.el with your actual NanoClaw checkout path.
If EMACS_AUTH_TOKEN is set, also add (any distribution):
(setq nanoclaw-auth-token "<your-token>")If you changed EMACS_CHANNEL_PORT from the default:
(setq nanoclaw-port <your-port>)Run from your NanoClaw project root:
pnpm run build
source setup/lib/install-slug.sh
launchctl kickstart -k gui/$(id -u)/$(launchd_label) # macOS
# systemctl --user restart $(systemd_unit) # Linuxcurl -s http://localhost:8766/api/messages?since=0Expected: {"messages":[]}. With an auth token:
curl -s -H "Authorization: Bearer <token>" http://localhost:8766/api/messages?since=0Tell the user:
1. Open the chat buffer with your keybinding (SPC N c,SPC a N c, orC-c n c) 2. Type a message and pressC-c C-cto send (RET inserts newlines) 3. A response should appear within a few seconds
>
For org-mode: open any.orgfile, position the cursor on a heading, and useSPC N o/SPC a N o/C-c n o
tail -f logs/nanoclaw.log should show Emacs channel listening at startup.
emacsplatform_id string (default default).EMACS_PLATFORM_ID (default default). User handles are arbitrary; your OS username or first name is fine (e.g. emacs:<username>).session-mode = agent-shared so a conversation started elsewhere continues in Emacs. Pick a separate folder only if you specifically want an Emacs-only persona.nanoclaw-chat) with markdown → org-mode renderingnanoclaw-org-send) — sends the current subtree or region; reply lands as a child headingNot applicable (design): multi-user channels, threads, cold DM initiation, typing indicators, attachments.
Error: listen EADDRINUSE: address already in use :::8766Either a stale NanoClaw is running or another app has the port. Kill stale process or change port:
lsof -ti :8766 | xargs kill -9
# or set EMACS_CHANNEL_PORT in .env and mirror in Emacs config (nanoclaw-port)If grep "Emacs channel listening" logs/nanoclaw.log returns nothing, check that EMACS_ENABLED=true is in .env and that the adapter import is present:
grep -q '^EMACS_ENABLED=true' .env && echo "enabled" || echo "not enabled"
grep -q "import './emacs.js'" src/channels/index.ts && echo "imported" || echo "not imported"launchctl list | grep "$(. setup/lib/install-slug.sh && launchd_label)" (macOS) / systemctl --user status "$(. setup/lib/install-slug.sh && systemd_unit)" (Linux)pnpm exec tsx scripts/q.ts data/v2.db "SELECT mg.platform_id, ag.folder FROM messaging_groups mg JOIN messaging_group_agents mga ON mg.id = mga.messaging_group_id JOIN agent_groups ag ON ag.id = mga.agent_group_id WHERE mg.channel_type = 'emacs'"grep 'channel_type=emacs\|Emacs' logs/nanoclaw.log | tail -20If no messaging group row exists, run the register command above.
M-x describe-variable RET nanoclaw-auth-token RETMust match EMACS_AUTH_TOKEN in .env. If you didn't set one server-side, clear it in Emacs too:
(setq nanoclaw-auth-token nil)ls ~/src/nanoclaw/emacs/nanoclaw.elIf NanoClaw is cloned elsewhere, update the load/load-file path in your Emacs config.
The Emacs bridge converts markdown → org-mode automatically. Agents should output standard markdown, not org-mode syntax:
| Markdown | Org-mode |
|---|---|
**bold** | *bold* |
*italic* | /italic/ |
~~text~~ | +text+ |
` code ` | ~code~ |
`lang | #+begin_src lang |
If an agent outputs org-mode directly, markers get double-converted and render incorrectly.
See REMOVE.md to uninstall this channel.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.