- Home
- Plugins
- Security & Permissions
- dsh-ruleset
dsh-ruleset
cengcengcai-creator/dsh-ruleset
Audit whether an agent actually follows your AGENTS.md-style rules: 15 predicates evaluated over native DSH events, a pre-execute approval gate for red lines, per-finding false-positive triage, and baseline significance so a noisy day does not read as a regression.
Install
dsh plugin --profile web add github:cengcengcai-creator/dsh-rulesetREADME
dsh-ruleset (draft)
Behavioral rule compliance for DSH — one policy file drives both prompt injection and evidence-backed three-value checks.
Audits agent behavior, not plugin quality. For plugin conformance, see
PerryLink/dsh-standards(ENTRY/FLOW/BOOST).
Relationship to the methodology
The four-tier enforcement model (interception / exit gate / detection / prompt-only) and the "detectable is not blocked" rule live in agent-rule-enforcement. This package is the detection tier: it measures behaviour against logs and never claims to block anything.
Interop: lib/export.js emits a generic JSONL event log (ts / session / tool / ok / checkpoint / outcome), which audit_events.py from that repo consumes directly. Verified: 1,138 events → 40 task segments → long_task_without_checkpoint 15/40.
Why
Most rule plugins inject text. Most audit plugins measure tooling. Neither answers: did the agent follow the rules it was told?
dsh-ruleset keeps one source of truth (policy.yaml):
- inject — rule text into the system prompt, hot-reloaded on file change
- observe — rule-by-rule verdicts:
pass/violation/unknown, each pointing back to aseqor file
Contract: unknown is never read as pass (no data source or too few samples stays unknown).
Install
# from GitHub (works today)
dsh plugin --profile web add github:cengcengcai-creator/dsh-ruleset
# from npm (once published)
dsh plugin --profile web add dsh-ruleset
Status
Functional, self-hosted, no npm account needed — install straight from GitHub.
What it does today:
- Write rules in one sentence — a model turns it into a predicate you can adjust (
/api/dsh-ruleset/parse, deterministic fallback included). - Three tiers — redline / hard / soft, injected in that order so hard rules are not buried.
- Judge behaviour — 15 predicate types over native DSH events (approvals, sandbox modes, jobs, turns, file writes), never regex-guessing what the platform already records.
- Gate red lines — a
tools/pre-executeguard returnsaskforsudo,chmod 777,curl | sh, system-path writes, credential-shaped strings. Hits are logged to.ruleset/guard.log. - Keep findings honest — per-finding lifecycle (
open/fixed/accepted/false_positive/superseded), false positives subtract from hit counts and are never deleted. - Compare against a baseline — two-proportion z-test (ported from OpenClaw's
audit-verdict.py);|z| < 1.96is reported as "no meaningful change" instead of red. - Verify what reached the model — every distinct injected rule text is fingerprinted into
.ruleset/injected.log. - Own nothing —
AGENTS.mdis read-only;policy.yamlis written only on explicit user action, always after a backup; one-click rollback and export are built in.
Rule hygiene (/api/dsh-ruleset/hygiene): duplicates, conflicts, rules without predicates, token cost.
Tests: npm test — 20 cases (validation, predicates, extraction, dedupe, plugin-load smoke, guard behaviour).
Known limits: no hot reload (host restart required), client-side slot props are not inspectable, model judging is advisory only (not calibrated with kappa yet).
Community listings
Listed:
- Included — awesome-dsh-plugin/awesome-dsh-plugin under Security & Permissions (merged 2026-11-18 via PR #16379); this list also powers the in-app plugin market index.
Pending review:
- kejixiaoliang/awesome-dsh-plugins — health checks / diagnostics / audit category
Not on npm yet; install from GitHub until it is:
dsh plugin --profile web add github:cengcengcai-creator/dsh-ruleset
Related plugins
dsh-purge
hunyisage/dsh-purge
dsh-infinite-gen-4
minglink/dsh-infinite-gen-4
dsh-purge
mmparko/dsh-purge
cc-safety-net
kenryu42/cc-safety-net