Documentation

Complete guide to integrating MoltGuard with your AI agent.

🚀 Quick Start — Clawdbot Plugin

Connect your Clawdbot agent to MoltGuard in under a minute:

# 1. Install the plugin
$ clawdbot plugins install @moltnet/guard

# 2. Add to your config (~/.clawdbot/config.json)
{
  "plugins": {
    "entries": {
      "moltguard": {
        "enabled": true,
        "config": {
          "token": "YOUR_TOKEN",
          "agentName": "my-assistant"
        }
      }
    }
  }
}

# 3. Restart
$ clawdbot gateway restart

Plugin Configuration Options

OptionTypeDefaultDescription
tokenstringrequiredYour MoltGuard API token
urlstringhttp://guard.moltnet.aiMoltGuard server URL
agentNamestringautoDisplay name in dashboard
logThoughtsbooleantrueSend reasoning to Mind Graph
gateHighRiskbooleantrueRequire approval for high-risk actions
gateToolsstring[]["exec", "message", "write"]Tools requiring approval
pollCommandsbooleantrueEnable remote control
pollIntervalMsnumber5000Command poll interval

📦 Plugin source: github.com/moltnet/guard/plugin

API Reference

Base URL: http://guard.moltnet.ai/api

Skill Scanner
POST /api/scan

Scan a skill for security issues. Provide either a URL or raw content.

ParameterTypeDescription
urlstringURL of the skill file to scan
contentstringRaw skill content to scan
namestringOptional skill name
GET /api/scans

Get recent scan history.

GET /api/badge?url={skillUrl}

Get an SVG badge showing the scan result. Use in README files.

Action Logging
POST /api/actions

Log an action from your agent. Use status="pending" to require approval.

ParameterTypeDescription
agentstringAgent identifier
typestringAction type (e.g. email.send, file.write)
descriptionstringHuman-readable description
riskstringlow | medium | high | critical
statusstringexecuted | pending
detailsobjectAdditional structured data
costUsdnumberAPI cost in USD
tokensInnumberInput tokens used
tokensOutnumberOutput tokens used
reversiblebooleanCan this action be undone?
undoActionobjectInstructions for undoing
callbackUrlstringWebhook URL for decision notifications
GET /api/actions/{id}/decision

Poll for the decision on a pending action. Returns status, decidedAt, decidedBy, rejectReason.

GET /api/pending

Get all pending actions awaiting approval.

POST /api/actions/{id}/approve

Approve a pending action.

POST /api/actions/{id}/reject

Reject a pending action. Optionally include reason in body.

POST /api/actions/{id}/undo

Mark a reversible action as undone. Returns undoAction if provided.

Stats & Monitoring
GET /api/stats

Get aggregate statistics: action counts, costs, risk breakdown, top agents.

GET /api/activity?hours=24

Get hourly activity data for charts.

GET /api/health

Health check endpoint.

Agent Management
POST /api/agents/register

Register a new agent. Returns API key for authentication.

GET /api/agents

List all registered agents.

Sessions & Mind Graph
POST /api/sessions

Start a new agent session. Returns sessionId.

POST /api/traces

Log a thought/reasoning step. Used to build the mind graph.

ParameterTypeDescription
sessionIdstringSession ID
agentstringAgent name
typestringreasoning | decision | planning | observation | reflection
titlestringBrief title
contentstringDetailed content
parentIdstringParent trace ID (for nesting)
GET /api/mind-graph/{sessionId}

Get mind graph data (nodes and edges) for visualization.

Remote Control
POST /api/control/{agent}

Send a control command to an agent (pause, resume, stop).

GET /api/control/{agent}/pending

Get pending commands for an agent (agent polls this).

POST /api/control/{agent}/ack/{commandId}

Acknowledge command execution.

Quick Example
# Log a pending action and wait for approval
$ ID=$(curl -s -X POST http://guard.moltnet.ai/api/actions \
    -H "Content-Type: application/json" \
    -d '{"agent":"my-bot","type":"email.send","description":"Send report","risk":"high","status":"pending"}' \
    | jq -r '.id')

# Poll for decision
$ curl -s http://guard.moltnet.ai/api/actions/$ID/decision | jq '.status'
"pending"

# After user approves in dashboard...
$ curl -s http://guard.moltnet.ai/api/actions/$ID/decision | jq '.status'
"approved"