External agent control api
Agent API
Server-to-server only. Authenticate with Authorization: Bearer <token>. A missing or invalid token returns 401; the right token with the wrong scope returns 403.
Read endpoints — scope: read
Overall status, every node and room with its state, SB688 / SB689 / AVA module states, current ledger head hash, timestamp.
The most recent N append-only ledger entries. N is 1–200 and defaults to 25.
Uptime, the last verification result, and ledger head.
Control endpoints — scope: control
body: —
Run the system verification / pulse check now and return the result. Audited to the ledger first.
body: { "type": "string", "payload": {} }
Append one entry to the append-only ledger. Audited first. Payload is capped at 8000 characters.
body: { "node_id": 3 }
Move a node into quarantine. Audited first.
body: { "node_id": 3 }
Return a node to active duty — only if its braid chain still verifies at 100%. Otherwise 409 and the node stays quarantined.
Examples
Read status:
curl -s \
-H "Authorization: Bearer $AGENT_READ_TOKEN" \
http://localhost:3001/api/agent/statusRun a verification pulse:
curl -s -X POST \
-H "Authorization: Bearer $AGENT_CONTROL_TOKEN" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:3001/api/agent/verifyAppend a ledger entry:
curl -s -X POST \
-H "Authorization: Bearer $AGENT_CONTROL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type":"MUSE_NOTE","payload":{"note":"external agent heartbeat"}}' \
http://localhost:3001/api/agent/ledger/appendQuarantine a node:
curl -s -X POST \
-H "Authorization: Bearer $AGENT_CONTROL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"node_id":3}' \
http://localhost:3001/api/agent/quarantineRules the API enforces
- No endpoint deletes anything. The ledger has no edit or delete path at all.
- No endpoint changes user accounts, passwords, or these API settings. Token management requires a console admin session and is unreachable with an agent token.
- Every control action writes its audit entry — actor muse-external-agent, the action, and the timestamp — before the action runs.
- Failed authentication and scope violations are recorded to the ledger as SECURITY events.
- The API does not self-certify. Verification results are returned as data; certification stays with the governed trust flow.
- Restore re-verifies the node first. A node whose chain is not pristine stays quarantined — repair is owner-only.
- Agent routes are rate limited per IP.
Token management
Generate, rotate, and revoke tokens on the Agent Access page. Those routes require a console admin session, which is what keeps a leaked agent token from ever reaching the settings that govern it.