Local decision-layer plugin for DSH: a fail-closed command approval gate and ask/gate tools backed by a 144.3M on-device model. Needs a separate local decision service: `pip install phocinae-server`, then download the ~330 MB weights and keep the service running; without it the tool returns `PHOCINAE_SERVICE_UNAVAILABLE`.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Phocinae/dsh-phocinae
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English · 中文 · Español · Português · हिन्दी
dsh-phocinae
A local, non-generative decision layer for DeepSeek Harness. A 150M-parameter model answers yes/no, choice and 2–10 score questions in one forward pass, and a fail-closed gate screens tool calls before they run.
- Runs on your machine; no cloud API, no API key.
phocinae_askfor typed batch decisions;phocinae_gatefor one command or action.- The gate hooks
tools/pre-execute: unreachable service → ask a human, never silently allow. - The model does not write prose or code. It makes one structured decision.
Quick start
pip install phocinae-server
huggingface-cli download Phocinae/Phocinae-Largha-150M-v1 --local-dir ./model
PHOC_MODEL_DIR=./model python -m phocinae.main
dsh plugin --profile web add dsh-phocinae@0.2.5
curl http://127.0.0.1:8155/health
{"status":"ok","model_loaded":true} means the service is ready. Pin dsh-phocinae@0.2.5: a bare add dsh-phocinae can resolve to an older build while pnpm's minimumReleaseAge gate holds a fresh release back.
What you get
| Surface | What it does |
|---|---|
phocinae_ask |
Runs up to 64 typed questions against one state; returns answers, calibrated confidence and an advisory escalate flag. |
phocinae_gate |
Judges one command or action as allow, ask or deny; checks it without executing it. |
tools/pre-execute gate |
Screens every tool call matching gate.tools before execution; fail-closed. |
phocinae skill |
Tells the model when a local decision is the right tool and how to read escalate. |
Examples
Ask two questions about one state:
{"state":"The user wants to delete /tmp/build. The path is inside the workspace.","questions":[{"id":"safe","type":"noul","threshold":0.8},{"id":"urgency","type":"score"}]}
The response shape is:
{"answers":{"safe":true,"urgency":4},"confidence":{"safe":0.92,"urgency":0.71},"escalate":false}
Gate a dangerous command:
{"command":"rm -rf /","toolName":"shell","cwd":"/home/me/project"}
It returns decision: "deny" with a reason and confidence; the command is never run. These outputs illustrate the schema, not a recorded fixture.
How it works
- The host calls
phocinae_ask,phocinae_gate, or the pre-execute gate. - The plugin sends the raw state to
http://127.0.0.1:8155/v1/systemone. - The service returns one structured answer per question.
- The gate maps the answer to
allow/ask/deny; low confidence becomesescalate, and an unreachable service becomesaskinfailMode: closed.
Configuration
Defaults live in cordis.patch.yml and lib/config.mjs. Every key has a default.
| Key | Default | Meaning |
|---|---|---|
endpoint |
http://127.0.0.1:8155/v1/systemone |
Decision service. Loopback only unless allowRemoteEndpoint: true. |
timeoutMs |
3000 |
Per request; one attempt. |
escalateAt |
0.6 |
Confidence below this marks an answer escalate: true. |
gate.mode |
harm |
harm, tri-state, noul or off. |
gate.tools |
['*'] |
Tool names to screen: exact, globs, or *. |
gate.failMode |
closed |
closed asks a human when the service is unreachable; open allows. |
To use only the tools and screen nothing:
- id: phocinae
config:
gate:
mode: off
Security and boundaries
- Loopback only. The state contains raw tool-call text; a non-loopback endpoint is a load-time error unless explicitly allowed.
- Fail-closed. Service errors/timeouts route screened calls to a human; a missing tool name is not allowlisted.
- Not a sandbox. The gate is an additional approval signal, not a replacement for the host sandbox or human approval.
- No generation. The model cannot answer knowledge questions, write code, or summarize; use a chat model for that.
Compatibility
- Node
^22.19or>=24. - DSH
>=0.2.1-0 <0.3.0; the bundle row mountsphocinae_ask,phocinae_gate, the gate and the skill. phocinae-servermust be reachable at the configured endpoint.
Troubleshooting
| Symptom | Fix |
|---|---|
PHOCINAE_SERVICE_UNAVAILABLE |
Start the server and check curl http://127.0.0.1:8155/health. |
| Bare add installs an old version | Re-add with dsh-phocinae@0.2.5; check dsh --profile web --dump-config. |
| The gate asks for everything | Confirm the server is up; in failMode: closed, an unreachable service deliberately asks. |
| The gate is too aggressive/lenient | Tune gate.mode, gate.tools, gate.minConfidence, gate.autoAllow; do not turn it off blindly. |
License
Apache-2.0. The model card and server are separate projects: Phocinae-Largha-150M-v1 and phocinae-server.
Links
More in this category
kenryu42/cc-safety-net★ 2161
Pre-execution guard that blocks destructive Git and filesystem commands and access to secrets such as SSH keys and .env files before a tool call runs.
ADWMC/helm-d#helmd★ 1654
Security-analysis plugin for DeepSeek Harness: 33 tools spanning six security domains, evidence/reporting and toolbox, plus the case lifecycle, routing and tool ledger; a session-bound case workflow with an evidence chain, E-id validation and reproducible findings; 362 on-demand references; three hot-swappable persona profiles; and a four-tab workbench (armor / case / intercept / about) with case-state recovery after context compaction.
SeaOf0/dsh-redteam-model★ 945
Authorized-security DSH collection: nine work modes (redteam coordinator, pentest, code audit, binary analysis, attack-defense, AV evasion, incident response, cloud security, CTF solving) and fifteen runtime plugins, managed from a settings page with one-click deploy, install, update and uninstall.
toby-bridges/api-relay-audit★ 939
Runs local security audits of AI API relays and LLM proxies from DeepSeek Harness, producing Markdown reports for prompt injection, model substitution signals, tool-call rewriting, error leakage, stream integrity, and profile-gated Web3 risks.
howmp/dsh-pentest★ 625
Authorized pentest mode for DeepSeek Harness — exploration chain, assets and findings with a Web view.
Jueze-2019/dsh-redteam-mode#packages/redteam-bundle★ 320
Red-team engagement mode: send one target organization name; a planner session runs five execution roles (recon, asset triage, vulnerability discovery, exploitation, internal pivot) with configurable concurrency; preflight checks skills/resources; scoring uses four stages (recon, internet, boundary, internal) with server-side caps and privilege-wins dedup; findings stay in a local SQLite fact base. The persistent right-side console has nine pages and includes asset mapping, agents, sessions/tunnels, findings, score targets, reports, POC knowledge base and skill library. v0.15.2 adds automatic HTTP evidence/action records, batch ingest, scope check, tunnel pivot probe, data proof, cleanup ledger and T0-T3 asset admission to prevent scope drift. 59 redteam_* tools; 38 bundled skills.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.