convez.ai
MCP ServerSegurançaIntermediário
ucsandman

DashClaw

ucsandman/DashClaw

Governe agentes de IA antes que ajam — intercepção, políticas e auditoria

Ver no GitHub
BomPluginScore · de 0 a 100

Camada de governança para agentes de IA que interagem com sistemas reais. Intercepta ações de risco, aplica políticas, requer aprovações humanas e gera trilhas de auditoria completas. Integra-se com Claude, LangChain, CrewAI e outros via MCP, SDK ou REST.

Instalação

$npx convez-ai ucsandman/DashClaw

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
319
Forks
53
Acompanhando
4
Saúde
71%
Último commit
há 3 dias
Versão
v5.39.0
Issues abertas
32
Contribuidores
7

Casos de uso

  • Controlar ações críticas de agentes autônomos antes da execução
  • Implementar aprovações humanas em workflows de IA sensíveis
  • Manter trilhas de auditoria verificáveis e replicáveis de decisões de agentes
  • Prevenir execução dupla silenciosa em retentativas de agentes

Veredito

Solução madura e bem integrada para quem precisa governar agentes de IA em ambientes de produção. Endereça um problema real (controle de risco em automação autônoma) com arquitetura sólida, suporte a múltiplos runtimes e audit trail confiável.

README

A tradução para o português deste README ainda está na fila.

60-second proof path

  1. Read the loop: DashClaw intercepts risky agent intent, enforces policy, records the decision, routes approval when required, and verifies the final outcome.
  2. Run the local demo: npx dashclaw-demo. Expected proof: a simulated high-risk deployment is blocked and opens Decision Replay.
  3. Self-host the runtime from the deploy guide, then run npm run doctor locally or dashclaw doctor against the hosted URL. Expected proof: the doctor command exits 0 or names the blocking setup item.
  4. Connect one agent with DASHCLAW_BASE_URL and DASHCLAW_API_KEY. Expected proof: one action appears in /decisions, any held action appears in /approvals, and /api/setup/live-proof can capture setup evidence for onboarding or CI.

What DashClaw does

InterceptRisky agent actions are evaluated before they execute. Block, warn, or hold for approval, by policy.
Verify identityAgents authenticate with JWKS-verified OIDC bearer tokens (EdDSA / RSA / ECDSA). Replay protection rejects reused tokens; optional action binding scopes a token to one intended call. Cryptographic attribution, not self-assertion.
EnforceDeclarative policies (risk thresholds, deploy gates, capability access rules, semantic checks) run on every action.
ApprovePending approvals route to a dashboard queue, the CLI inbox, a mobile PWA, Telegram, or Discord, with one-tap allow or deny.
RecordEvery action becomes a replayable decision record: declared goal, reasoning, risk score, matched policies, assumptions, evidence.
FinalizeTerminal outcomes are one-shot and durable. Lost confirmations are swept and surfaced, so retries do not double-execute.
Govern external systemsThe capability registry wraps real HTTP APIs with per-agent access rules, rate limits, and audit. Workflows compose these into multi-step governed runs.
ImproveCode Sessions ingests Claude Code transcripts (Stop-hook live or JSONL backfill), prices the spend, surfaces optimizer signals (stuck loops, cache crater, context gaps), and distills sessions into an Optimal Files bundle — root CLAUDE.md, path-scoped rules, hooks, and skill packs — applied locally via dashclaw code apply.

The control plane, running

Real screenshots from a live instance governing a working agent fleet. Dark instrument panel, orange only where attention is required.

The decisions ledger. Every governed action lands here with its risk score, matched policies, signature state, and terminal outcome. 77,000+ decisions on this instance; each one replayable.

Mission Control. Fleet posture, the intervention queue, and a live ledger of governed events on one calm screen. Repeated signal occurrences collapse into one row; dismissing it clears them all.

Spend and posture, measured. Analytics prices every action and breaks enforcement down by agent and type. Governance posture is one gaming-resistant score: a policy only counts when replaying real traffic proves it fires, and drafting a policy never raises the number.


Choose your integration path

DashClaw meets agents where they already are. Every path lands on the same governance primitives, audit ledger, and approval queue — pick the one closest to how your agent already runs.

Coverage at a glance

If your agent is…Use this pathInstall
Claude CodePlugin + hooksnpm i -g @dashclaw/cli && dashclaw install claude
CodexPlugindashclaw install codex --project <path>
Hermes AgentPlugin (8 lifecycle hooks)bash scripts/install-hermes-plugin.sh
OpenClawOpenClaw pluginnpm install @dashclaw/openclaw-plugin
Claude Desktop, any MCP hostMCP server (stdio)npx @dashclaw/mcp-server
Claude Managed AgentsMCP server (Streamable HTTP)Point at /api/mcp
LangChainPython SDK callback handlerpip install dashclaw
CrewAIPython SDK task callback / agent wrapperpip install dashclaw
AutoGenPython SDK instrumentationpip install dashclaw
LangGraph, OpenAI Agents SDKNode or Python SDKnpm install dashclaw
Custom / framework-lessNode or Python SDKnpm install dashclaw
Anything HTTPREST API + webhooksOpenAPI spec

Working end-to-end examples for each runtime live in examples/ — anthropic-governed-agent, autogen-governed, claude-code-review-agent, codex-review-agent, crewai-governed, langgraph-governed, managed-agent-governed, managed-agent-mcp, openai-agents-governed, and more.

1. Coding-agent plugins (Claude Code, Codex, Hermes Agent)

One plugin source, three ecosystems. Distributed via plugins/dashclaw/. Each manifest ships the MCP server config, the dashclaw-governance protocol skill, the dashclaw-platform-intelligence reference skill, and a distinct agent_id so Mission Control separates sessions per host.

# Claude Code — no clone needed: the CLI downloads the hooks bundle from your
# instance, wires ~/.claude/settings.json, and defaults to observe mode
npm i -g @dashclaw/cli
dashclaw install claude            # prompts for endpoint + API key
dashclaw install claude --trial    # browser signup on a hosted instance, paste the key

# Codex — installer wires manifest, hooks, and AGENTS.md governance protocol
node cli/bin/dashclaw.js install codex --project /path/to/your/project

# Hermes Agent — 8 lifecycle hooks (pre/post tool, pre/post LLM, on-session
# start/end, secret redaction, subagent_stop ROI tracking)
bash scripts/install-hermes-plugin.sh        # macOS / Linux
powershell -File scripts/install-hermes-plugin.ps1   # Windows

For Claude Code specifically, dashclaw install claude governs Bash, Edit, Write, MultiEdit, sub-agent spawns, and every mcp__* tool call with semantic classification, risk scoring, and per-turn token capture — no SDK calls in your agent code, no repo clone. It starts in observe mode (decisions logged, nothing blocked); flip to enforce by setting DASHCLAW_HOOK_MODE=enforce in ~/.dashclaw/claude-hooks/.env. Working from a checkout instead, npm run hooks:install does the same wiring. Full details in hooks/README.md.

Verify it fires: pipe a fake tool call through the hook — a clean exit (and a guard evaluation when DashClaw is reachable) confirms the wiring. Use python3 if your system has no python on PATH; the installer picks the right one automatically.

echo '{"tool_name":"Bash","tool_input":{"command":"echo hello"},"tool_use_id":"test_001","session_id":"smoke"}' | python .claude/hooks/dashclaw_pretool.py

2. MCP server (zero code, any MCP host)

@dashclaw/mcp-server exposes 32 governance MCP tools across 12 groups — core governance, optimal files, session continuity, credential hygiene, skill safety, open loops, learning + retrospection, agent inbox, agent identity, behavior learning, governance posture, work orders — plus 6 read-only resources (dashclaw://policies, dashclaw://capabilities, dashclaw://agent/{agent_id}/history, dashclaw://status, dashclaw://code-sessions/projects, dashclaw://code-sessions/sessions/{session_id}).

As of v2.0.0 the local stdio server also carries governed execution: provider tools for GitHub, Vercel, Neon, Stripe and ten more (each registering only when its credential env var is present), and stateful launch plans (create_launch_plan / get_launch_status / preflight_launch / verify_launch) that track the launch tail with reality-checked, never self-reported completion — every step through the same guard/policy/approval path. See mcp-server/README.md and mcp-server/docs/launch-plans.md.

Stdio (Claude Code, Claude Desktop, any stdio MCP client):

{
  "mcpServers": {
    "dashclaw": {
      "command": "npx",
      "args": ["@dashclaw/mcp-server"],
      "env": {
        "DASHCLAW_URL": "https://your-dashclaw.vercel.app",
        "DASHCLAW_API_KEY": "oc_live_xxx"
      }
    }
  }
}

Streamable HTTP (Claude Managed Agents, any remote MCP client): every DashClaw instance serves MCP at /api/mcp — no npm package, no client install.

agent = client.beta.agents.create(
    name="Governed Agent",
    model="claude-sonnet-4-6",
    tools=[{"type": "agent_toolset_20260401"}],
    mcp_servers=[{
        "type": "url",
        "url": "https://your-dashclaw.vercel.app/api/mcp",
        "headers": {"x-api-key": "oc_live_xxx"},
        "name": "dashclaw"
    }],
)

3. Node and Python SDKs — including framework integrations

For custom agents, frameworks, and anywhere you want explicit control over what gets governed.

npm install dashclaw     # Node 18+
pip install dashclaw     # Python 3.7+

137-method canonical Node surface: core governance, durable execution finality, scoring profiles, learning analytics, messaging, handoffs, security scanning, sessions, agent reputation, agent registry, x402 spend governance, work orders, and the execution-studio domains (workflow templates, model strategies, knowledge collections, capability runtime). The Python SDK exposes 233 methods including ready-made framework integrations:

# LangChain — auto-log LLM calls, tool use, and costs
from dashclaw.integrations.langchain import DashClawCallbackHandler
agent.run("Hello world", callbacks=[DashClawCallbackHandler(claw)])

# CrewAI — per-task callback or agent-level instrumentation
from dashclaw.integrations.crewai import DashClawCrewIntegration
integration = DashClawCrewIntegration(claw)
analyst = integration.instrument_agent(analyst)

# AutoGen — multi-agent conversation monitoring
from dashclaw.integrations.autogen import DashClawAutoGenIntegration
DashClawAutoGenIntegration(claw).instrument_agent(assistant)

Full method catalogues: sdk/README.md (Node, camelCase), sdk-python/README.md (Python, snake_case). The 4-step governance loop is in the Quick start below.

4. OpenClaw plugin

For agents built on OpenClaw, @dashclaw/openclaw-plugin wires governance into the lifecycle directly.

npm install @dashclaw/openclaw-plugin

It intercepts every tool-use call (before_tool_call, llm_output, after_tool_call, agent_end), calls guard / record / waitForApproval automatically, and ships a HOOK.md the openclaw CLI installs. Tool-classification vocabulary aligns with DashClaw guard action types so policies behave consistently across plugin, hook, and SDK paths.

5. Direct REST API and webhooks

Every governance primitive is reachable as HTTP. The stable contract is pinned in docs/openapi/critical-stable.openapi.json; the full inventory (321 routes: 54 stable, 24 beta, 243 experimental) is at docs/api-inventory.md. Webhook events include signal.detected, decision.created, action.created, lost_confirmation, and the rest of the catalog — configurable per org.

6. Work Orders — task-grade contracts + receipts

Work Orders turn an agent call into a contract: a typed input/output schema, a budget ceiling, and a self-verifying receipt. A caller submits an order against a registered type (validated, guard-gated, queued); any agent with an API key claims and completes it; the server validates the output, builds a SHA-256-hashed receipt (cost, timestamps, output hash, governance trail), and writes an audit record. DashClaw stays the control plane — execution is external workers via claim/complete, so there's no LLM key and no cron. Page at /work-orders, API at /api/work-orders, 8 SDK methods each (Node + Python), 2 MCP tools, and a ~75-line reference worker in examples/work-order-worker/.

7. Skills — governance protocol + live platform reference

Two drop-in skills, both available as zip bundles or source directories in public/downloads/ and auto-bundled into the coding-agent plugins:

  • dashclaw-governance — governance protocol skill. Teaches agents the decision tree (allow / warn / block / require_approval), action recording, approval-wait protocol, session lifecycle, plus six new sections for handoffs, secret hygiene, skill safety, action-scoped open loops, learning, and in-session retrospection.
  • dashclaw-platform-intelligence — live API reference, env var contract, and troubleshooting playbook with progressive disclosure. Regenerated from the codebase on every release so it never drifts from the running runtime.
cp -r public/downloads/dashclaw-governance .claude/skills/
cp -r public/downloads/dashclaw-platform-intelligence .claude/skills/

Or grab the zips from dashclaw.io/downloads. The platform-intelligence skill is also published on ClawHub.


Quick start

10-second demo

npx dashclaw-demo

Spins up a local demo runtime, fires a simulated high-risk deployment, lets DashClaw block it, and opens Decision Replay in your browser. No setup, no accounts.

Real agent in 8 minutes (SDK path)

npm install dashclaw   # or: pip install dashclaw
import { DashClaw, GuardBlockedError, ApprovalDeniedError } from 'dashclaw';

const claw = new DashClaw({
  baseUrl: process.env.DASHCLAW_BASE_URL,
  apiKey: process.env.DASHCLAW_API_KEY,
  agentId: 'my-agent',
});

// 1. Guard
const decision = await claw.guard({ action_type: 'deploy', risk_score: 80 });

// 2. Record
const action = await claw.createAction({
  action_type: 'deploy',
  declared_goal: 'Ship release 2.13.4 to production',
});

// 3. Verify reasoning basis
await claw.recordAssumption({
  action_id: action.action_id,
  assumption: 'Tests passed on the candidate commit',
});

// 4. Outcome (durable, retry-safe)
try {
  // ...do the real work...
  await claw.reportActionSuccess(action.action_id, 'Deployed 2.13.4');
} catch (err) {
  await claw.reportActionFailure(action.action_id, err.message);
}

Python uses the same shape with snake_case. Full reference: sdk/README.md. Step-by-step walkthrough: QUICK-START.md.


Deploy

Local

npx dashclaw up

Installs the app, provisions Postgres (Docker or embedded), generates secrets, mints your API key, applies migrations, starts on :3000, and offers to wire Claude Code hooks — one command, no accounts required.

Cloud

Deploy with Vercel

$0 to deploy. Vercel free tier plus Neon free tier. Click the button, add the Neon integration when prompted, fill in the env vars listed in .env.example. The schema migration runs as part of the build, so there is no manual migration step.

After deploy

  1. Open the app at https://your-app.vercel.app and sign in.
  2. Copy the integration snippet from Mission Control. It pre-fills your base URL and gives you a one-click API key.
  3. Run it. node --env-file=.env demo.js from any client environment and watch the governed action land in your decisions ledger.

Optional

  • Live decision stream. Add Upstash Redis credentials (UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN) to get cross-instance event replay. Without it, Mission Control uses in-memory events, which is fine for getting started but does not persist across serverless invocations.
  • Hosted trial mode. If you want DashClaw itself to mint trial workspaces (operator deployments only), follow docs/hosted-deployment-runbook.md. That path needs Turnstile, cleanup secrets, and an operator-managed cron.
  • Self-host without Vercel. A Dockerfile and standalone next start path are available; see Dockerfile. The schema migration in scripts/auto-migrate.mjs is idempotent and safe to re-run.

Durable execution finality

Approved actions now carry a terminal outcome separate from their lifecycle status. Five states, one-shot transitions, repository-level enforcement:

StateMeaning
pendingApproved, no outcome reported yet.
completedFinished successfully. Set by the agent.
partialStarted but did not finish. Set by the agent with a progress payload.
failedAttempted and errored. Set by the agent with an error message.
lost_confirmationTimeout exceeded without a report. Set by the cron sweep.
// Retry-safe poll before re-trying any approved action
const outcome = await claw.getActionOutcome(actionId);
switch (outcome.status) {
  case 'pending':           /* still in flight, wait */ break;
  case 'completed':         /* already executed, skip */ break;
  case 'failed':            /* safe to retry */ break;
  case 'lost_confirmation': /* sweep gave up, safe to retry */ break;
  case 'partial':           /* clean up then retry */ break;
}

// Make the create itself retry-safe
const key = claw.deriveIdempotencyKey({
  agent_id: 'deploy-bot', action_type: 'deploy', scope: 'prod-us-east', request_id,
});
await claw.createAction({ /* ... */, idempotency_key: key });

POST /api/actions/[actionId]/outcome is one-shot: the first call wins, every subsequent POST returns 409 with current_status. A daily Vercel cron (hourly externally on Pro or via GitHub Actions) marks stale pending rows as lost_confirmation and emits a signal.detected event so subscribed webhooks know to investigate. Full spec: docs/architecture/durable-execution-finality.md.


Safety and governance model

DashClaw is not observability. It is control before execution. The model:

  1. Every agent action is evaluated against active policies before the action runs. Policies are declarative; the policy builder ships with nine pre-built safety switches (Deploy Gate, Risk Threshold, Rate Limiter, and others), an AI generator, and YAML import.
  2. Sensitive actions require human approval. Approvals route to the dashboard, the CLI (@dashclaw/cli), the mobile PWA at /approve, Telegram, or Discord. Same action, any surface.
  3. Every decision is recorded. The decisions ledger is replayable: declared goal, reasoning, matched policies, assumptions, signals, and the final outcome.
  4. Outcomes are durable. The five-state finality machine guarantees no silent double-execute on retry, and the sweep catches lost confirmations.
  5. Evidence is exportable. Compliance evidence bundles (signed manifests, JSON exports) are produced from real action records, not synthetic fixtures.
  6. Prompt injection scanning is on by default. Declared goals are scanned for injection patterns. Hits are blocked at guard time.
  7. Agent identity is cryptographically verified. Agents may present a JWKS-verified JWT instead of self-asserting agent_id. DashClaw checks the signature against the issuer's published keys (EdDSA / RSA / ECDSA), rejects replayed tokens, and can bind a token to its intended action — the verified sub overrides any body-supplied agent_id. Fail-soft: a downed issuer never blocks a decision. See docs/agent-identity.md.

The full architecture map lives in PROJECT_DETAILS.md. The runtime API contract is in docs/architecture/runtime-api.md.


Approvals beyond the dashboard

SurfacePurposeSetup
Dashboard (/approvals)Primary inbox for operators in front of a browser.None.
CLI (@dashclaw/cli)Terminal-first inbox. dashclaw approvals, dashclaw approve <id>.npm install -g @dashclaw/cli
Mobile PWA (/approve)Phone-first allow/deny with risk score and policy. Add to home screen.None.
TelegramInline Approve/Reject buttons in an admin chat.Optional. See docs/telegram-setup.md.
DiscordInline Approve/Deny on DM embeds.Optional. See .env.example (Discord section).

waitForApproval() unblocks within roughly one second regardless of which surface resolves the action. All surfaces hit the same /api/approvals/[actionId] endpoint.


Beyond the basics

FeatureDescriptionDocs
Drift detectionStatistical reasoning and metric drift across sessions.SDK: Learning Loop
Capability registryWrap real HTTP APIs with per-agent access rules and health monitoring.Capability Runtime
Workflow engineCompose governance into multi-step runs with variables, continue_on_failure, and resume from checkpoint.DEMO.md
Scoring profilesMulti-dimensional evaluation with weighted composites and auto-calibration.SDK: Scoring
Recovery recipesSix built-in recipes mapping signals to remediations.SDK: Learning
Agent profilesPer-agent governance dashboard at /agents/[agentId].PROJECT_DETAILS.md
AnalyticsCost trends, action volume, agent and type breakdowns, policy enforcement stats, and token efficiency at /analytics.PROJECT_DETAILS.md
Doctornpm run doctor (local) or dashclaw doctor (remote + machine checks). Report-only by default; --fix applies safe auto-fixes (migrations, default policy, CORS, timestamp hygiene, stale mcp-server lib, and more).SDK README

Documentation


License

MIT

Ver o original no GitHub

Bom para

Relacionados