@certaworks/goal-drift-monitor
v0.1.0
Published
Tracks whether long-running agents are still aligned with their original goal. Alerts when behavior diverges.
Maintainers
Readme
Goal Drift Monitor
Type: Local Monitor / API / MCP Server / Dashboard
Value: Tracks whether long-running agents are still aligned with the original goal and alerts when behavior starts to diverge.
Current Status
Complete as a local monitor / CLI / MCP / HTTP dashboard slice. It persists local sessions, scores each turn, and exposes alert receipts for local review workflows.
Shipped Local Scope
- Durable local goal sessions and turn history
- Turn-by-turn lexical drift scoring
- Drift threshold alerts
- Webhook delivery receipts for drift alerts
- CLI for creating sessions, adding turns, summaries, history, alerts, and serving the dashboard
- MCP tools for create, score, summarize, history, alert receipts, list, and delete
- Local HTTP API and dashboard
- Regression tests for persistence, CLI, MCP validation, HTTP/dashboard, and core scoring
Commands
npm install
npm test
npm run buildgoal-drift session create --goal "Keep the agent focused on refund policy questions" --threshold 0.35
goal-drift turn add --session <id> --content "The agent is discussing vacation planning"
goal-drift summary --session <id>
goal-drift history --session <id>
goal-drift alerts --session <id>
goal-drift serve --port 4321The dashboard is available at http://127.0.0.1:4321/dashboard after goal-drift serve.
Local API
GET /healthPOST /api/sessionsGET /api/sessionsGET /api/sessions/:idDELETE /api/sessions/:idPOST /api/sessions/:id/turnsGET /api/sessions/:id/historyGET /api/sessions/:id/summaryGET /api/sessions/:id/alertsGET /dashboard
Local Store
By default, local sessions are stored at:
.goal-drift-monitor/sessions.jsonOverride with:
GOAL_DRIFT_MONITOR_STORE_PATH=/path/to/sessions.jsonCurrent Guardrails
- External HTTP and MCP inputs are validated before mutating state.
- Invalid MCP envelopes return JSON-RPC
-32600. - Invalid MCP tool params return JSON-RPC
-32602. - Webhook threshold breaches and delivery receipts are separate:
alertFiredmeans drift threshold breached, whilealertDeliveryStatusrecords whether delivery was configured, delivered, or failed.
Current Limits
- This is a local product slice, not a hosted multi-user SaaS service.
- No public npm publication, hosted account system, billing, team workspace, or live checkout is included.
- Scoring defaults to deterministic lexical matching. Semantic scoring exists in the SDK but MCP/CLI/API currently expose lexical scoring for predictable local operation.
- Email alerts are not implemented; webhook receipts are implemented.
- Delete currently removes the session from the local store. Compliance-grade immutable audit retention remains future scope.
Verification
Fresh suite verification on 2026-05-28:
npm testpassed, 19/19 tests.npm run buildpassed.
