Skip to content

feat: tamper-evident audit, agent controls, and demo tooling - #1

Closed
tanmayyyyayyy wants to merge 9 commits into
bhoomik-codes:mainfrom
tanmayyyyayyy:feat/governance-hardening
Closed

tanmayyyyayyy wants to merge 9 commits into
bhoomik-codes:mainfrom
tanmayyyyayyy:feat/governance-hardening

Conversation

@tanmayyyyayyy

Copy link
Copy Markdown

Summary

Adds the governance-hardening capabilities that were missing from the Warden gateway, without touching working code paths.

  • Tamper-evident audit log — each JSONL record now hash-chains to the previous one (prevHash + hash, SHA-256 over a canonical encoding, GENESIS anchor). AuditLog.verify() recomputes the chain and reports the first modified, reordered, deleted, or unchained record; a missing log is never reported valid.
  • Agent controls — server-side pause / resume / quarantine (AgentControlStore) enforced at the top of /intercept, so neither client-supplied claims nor a previously pending approval can bypass them.
  • Deterministic demo fixture — cerberus demo seed writes an allow / block / human-review-and-denied fixture through the real AuditLog (records events only; runs no tool) and keeps the chain valid.
  • One-command startup — npm run demo checks Node/deps, installs/builds if needed, seeds, then starts the gateway.
  • Dashboard — live audit-verification status badge, agent status controls panel, and hello now carries recent audit history so the Live counters reflect seeded/historical state.

No bugs were found in the existing enforcement; the baseline suites were already green. One authored test expectation was corrected (an absent audit file must be invalid, not valid).

Security

  • Governance enforcement: unchanged single choke point at /intercept; the new pause/quarantine gate runs before the signal pipeline, the pending queue, and tool execution.
  • Approval handling: unchanged behavior preserved; the new gate is checked ahead of any held approval, so a paused/quarantined session cannot execute via an old pending request.
  • Agent pause and quarantine: server-side only (AgentControlStore), exposed via GET /agents and POST /agents/status (origin-gated); CLI cerberus agents|pause|resume|quarantine.
  • Audit integrity: hash-chained and verifiable via cerberus audit verify / GET /audit/verify. Explicitly tamper-evident, not tamper-proof — a locally editable file makes modification detectable, not impossible.

Testing

Executed locally (Node v25.9.0):

  • npm run typecheck — PASS
  • npm run build (engine tsc + dashboard tsc --noEmit && vite build) — PASS
  • Unit suites — PASS, including new test:audit-chain (11) and test:controls (11); all 22 pre-existing suites green (behavioral 9, content 31, injection 9, bypass 138, fp 37, hook 3, store 11, mcp-scan 32, proxy 8, deps 21, ioc 19, risk 15, init 20, projector 21, audit 14, notify 6, security 7, policy 31, adapters 22, validate 13).
  • scripts/smoke.mjs engine smoke — 11/11 PASS.
  • Custom engine integration — 12/12 PASS: allow / block / HITL-approve / pause-block / quarantine-block / resume / agents overview / audit chain valid / tamper detected.
  • Could not run: test:mitm fails on Node v25 (ERR_INVALID_ARG_VALUE: TLS servername must not be an IP) — pre-existing and environmental; CI pins Node 20. Unrelated to these changes.

Both new suites are wired into .github/workflows/ci.yml.

Demo

npm install && npm --prefix dashboard install
npm run demo            # seeds the fixture + starts the gateway → http://127.0.0.1:9000/
  • Live operations: decisions, audit-verified badge, and agent controls.
  • Sessions: the seeded allow / block / human-review run.
  • Tamper demo: edit a line in .cerberus/audit.jsonl, then node bin/cerberus.mjs audit verify (exits non-zero, names the first bad record).
  • Kill switch: node bin/cerberus.mjs pause <sessionId> then re-issue a governed call; it is blocked.

Limitations

  • Fork of the Cerberus engine; upstream attribution and notices are preserved.
  • The hash-chained log is tamper-evident, not tamper-proof (no remote anchor/retention).
  • Pause/quarantine state is in-memory per engine process (single local tier); the store interface is the seam for a Redis-backed multi-instance tier.
  • The original brief's finance-agent scenarios (transfer_money, currency thresholds) do not exist in this repository and were intentionally not fabricated.
  • Not production-ready; this is a hackathon prototype with the demo path verified end-to-end.

Asati-git and others added 9 commits July 8, 2026 15:46
Maintained, extended fork of Adirdabush1/cerberus (Apache-2.0). Adds MCP
tool-poisoning/rug-pull scan, egress proxy + opt-in MITM with outbound
prompt-secret redaction, supply-chain deps audit, offline IOC feed, and
command-chaining de-obfuscation hardening. See NOTICE for attribution and
the stated list of changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Install-from-source steps (npm publish pending), init/engine flow, npm link
and dashboard-build notes, and the optional scan/deps/proxy/feeds commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A fresh clone has no dist/ (gitignored) and no node_modules until `npm install`.
Running `node bin/cerberus.mjs` before install crashed with a raw
ERR_MODULE_NOT_FOUND for 'tsx'. Now the launcher detects missing deps and prints
setup instructions, and the README marks `npm install` as a required first step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hooting

Rewrites Setup into prerequisites → install → wire → run → verify → dashboard →
troubleshooting, with the gotchas fresh users actually hit (npm install first,
fail-closed when engine down, separate dashboard install, port override). Ships
the start-engine.bat / start-engine.command launchers the README references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nd/.sh/.mjs, CRLF for .bat)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ify step

Windows PowerShell aliases curl to Invoke-WebRequest, which rejects -s/-X/-H/-d.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Approval fatigue makes a gateway useless (users rubber-stamp everything). Three
precise fixes, each adversarially checked to keep real threat coverage:

- content taint (FP1a): arm the generic exfil HITL only on STRUCTURED secrets,
  not generic high-entropy. Reading lockfile digests / base64 / UUIDs no longer
  poisons the session. Entropy values are still kept for the exact-match path;
  SRI/hex-digest/UUID shapes excluded from the entropy heuristic only.
- content.isEgress (FP1c): a purely-local git command (commit/add/log/…) is no
  longer treated as egress just because its message contains words like
  'ssh'/'fetch'. Evaluated PER SEGMENT so a chained/substituted real curl still
  fires; push/fetch/pull/clone/remote/config stay egress-eligible.
- allow-dev-workflow: the everyday build/test/install loop (npm/pnpm/yarn/bun,
  pip/uv, cargo/go build+test, docker build, make, tsc/eslint/jest…) auto-ALLOWs.
  RCE-capable verbs excluded (docker run, *exec/npx/*dlx, cargo/go run); chained
  egress still HITL/BLOCKed via per-segment strictest-wins.

New scripts/fp.test.ts (37 assertions). Full suite green incl. redteam 0/81,
attack-sim + malware-sim 0 leaks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- hash-chain the JSONL audit log (prevHash/hash, SHA-256, canonical
  serialization) with verify() that reports the first modified, reordered,
  deleted, or unchained record; never reports a missing log as valid
- add cerberus audit verify + GET /audit/verify + live dashboard status badge
- add server-side pause/resume/quarantine (AgentControlStore) enforced at the
  /intercept boundary; CLI agents|pause|resume|quarantine + dashboard controls
- add deterministic cerberus demo seed fixture (records events only)
- add one-command npm run demo launcher and hydrate dashboard from history
- add audit-chain + controls test suites and wire them into CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants