Noolog Docs

Avatar API

The control plane an avatar exposes while running — this is the HTTP API served by a live quorum-rs service (the SDK that runs your avatars). Response buffers, pause / auto-approve, live config. 31 endpoints. Read-only reference, generated from the OpenAPI 3.1.0 schema.

Authentication. API for the NSED Agent HITL (Human-in-the-Loop) control plane.

Provides real-time agent monitoring, response buffer management, pause/resume controls, and live configuration patching.

Dashboard

GET / multi-agent dashboard HTML.

Returns Cache-Control: no-store so the browser always fetches the latest version after a rebuild (HTML is embedded at compile time via include_str!).

Responses
200Multi-agent dashboard HTML page

Agents

GET /api/agents list all agents with summary status.
Responses
200List of all agents with summary statusAgentSummary[]
GET /api/agents/errors fleet-wide API errors over the last 24h.

Reads each agent's NATS-persisted event log (24h retention) and aggregates the agent_error events into one operator view, so infra can be watched at a glance without pulling each agent's diagnostics individually.

Responses
200Fleet-wide API errors over the last 24hAgentErrorsReport
fieldtypedescription
errorsAgentErrorEntry[]requiredErrors across all agents, newest first.
stream_capinteger requiredPer-agent hard cap on retained events. The 24h window is bounded by this: an agent emitting more than this many events inside the window loses its oldest events to eviction.
totalintegerrequiredNumber of errors in errors.
window_hoursinteger requiredRolling window, in hours.
GET /api/agents/{name}/diagnostics metrics + latest errors for one agent.
path parameters
namestringrequiredAgent name
Responses
200Agent metrics + latest errorsAgentDiagnostics
fieldtypedescription
error_ratenumber required
flag_reasonstring | nullWhy it's flagged, if flagged.
is_flaggedbooleanrequiredWhether the agent is flagged for operator attention (e.g. score divergence from peers).
is_pausedbooleanrequiredWhether the agent is paused (e.g. auto-paused on a 402/billing error) — it pulls no new tasks while paused.
model_namestringrequired
namestringrequired
recent_errorsEventLogEntry[]requiredMost recent agent_error events (newest first), with their detail.
recent_failed_tasksTaskLogEntry[]requiredMost recent tasks that ended in "error" (newest first).
tasks_completedinteger required
tasks_failedinteger required
uptime_secsinteger required
404Unknown agent
GET /api/agents/{name}/tasks the agent's in-flight and finished tasks/queries over the last 24h, from its NATS event log.
path parameters
namestringrequiredAgent name
Responses
200In-flight and finished tasksTasksView
fieldtypedescription
finishedTaskView[]requiredFinished tasks, newest first.
in_flightTaskView[]requiredTasks started with no finish event yet, newest first.
404Unknown agent
GET /api/agents/{name}/tool-calls the agent's pending and finished tool invocations over the last 24h, from its NATS event log.
path parameters
namestringrequiredAgent name
Responses
200Pending and finished tool callsToolCallsView
fieldtypedescription
finishedToolCallView[]requiredFinished tool calls, newest first.
pendingToolCallView[]requiredStarted tool calls with no finish event yet, newest first.
404Unknown agent

Status

GET /api/agents/{name}/config per-agent configuration.

Serializes the full AgentConfig directly. The orchestrators field is excluded automatically via #[serde(skip_serializing)] on the struct.

path parameters
namestringrequiredAgent name
Responses
200Agent configurationAgentConfig
fieldtypedescription
auto_stopbooleanWhen true, buffer entries from this agent are created with stopped = true, preventing auto-release until an external system edits and explicitly releases them via POST /buffer/{id}/release. Used with stub providers for human-operated agents.
builtin_toolsBuiltinToolGrant[]Per-agent grants for built-in sandboxed tools. Attached to an agent's tool list only for the native-LLM provider branch; provider_type: claude / exec / mcp route their tools through provider-native channels (claude sub-agents, the exec subprocess's own tool surface, MCP server) so grants configured on those agents are silently ignored at runtime (loaders are expected to warn). Use this to give native-LLM agents scoped runtime capabilities (e.g. read files confined to a specific filesystem root) without going through the user_tools NATS dispatcher pipeline.

Each grant becomes a tool in the agent's tool list at startup. See crate::tools::scoped_read for the read_file implementation and its security model.
capability_tagsstring[]Free-form capability tags (e.g., ["legal", "audit", "quantitative"]). Used for filtering in agent picker and directory.
chars_per_tokennumber | nullCharacters per token for heuristic estimation when the provider doesn't return usage stats. Deserialized as Option<f64> (None when absent in config). The runtime fallback of 4.0 (English approximation) is applied at the call site via .unwrap_or(4.0) in nsed_agent.rs; set lower (~1.5) for CJK/code.
claudeoneOf
compact_history_default_keepintegerDefault value of compact_history(keep_last_n_calls) when the model omits the argument. Two recent tool results give the model enough context to reason while older results fold into the scratchpad summary.
context_windowinteger
descriptionstring | nullShort description of the agent's specialization. Shown in the agent directory and picker UI.
disable_native_toolsboolean
execoneOf
failure_dumpsstring | nullControls failure dump output when parse or API errors occur. Values: "on" (default — dump error + raw response), "full" (include system prompt, request body, and messages), "off" (disable). Dumps are written to failures/<session>_<agent>/. Can also be set globally via the NSED_FAILURE_DUMPS env var (1 = on, full = full). The config value takes precedence over the env var.
frequency_penaltynumber | null
input_price_per_mtoknumber | nullUSD per million input tokens. Used for cost estimation in budget reporting.
json_modeboolean
max_concurrent_jobsinteger | nullMax jobs this agent runs concurrently. Enforced as the pull consumer's max_ack_pending, so the broker withholds the next task until an in-flight one finishes. Set to 1 for agents whose jobs mutate shared state (e.g. a git repo a middleware resets per job) to prevent races. None (default) leaves it unbounded.
max_react_iterationsinteger | null
max_retriesinteger | null
max_scratchpad_sizeinteger | null
max_tokensinteger
mcponeOf
merge_system_promptboolean
modelstring | nullDotpath model reference: "provider_id.model_key". When set, resolves the provider and merges ModelDef fields into this agent at config load time (load_agent_from_config). Replaces the legacy provider_id + model_name + flat LLM field pattern.
model_namestring
namestringrequired
openrouteroneOf
output_price_per_mtoknumber | nullUSD per million output tokens. Used for cost estimation in budget reporting.
personastring | null
presence_penaltynumber | nullPresence penalty for the model. Defaults to Some(1.5) to encourage diverse vocabulary in multi-agent deliberation (reduces repetitive phrasing across rounds). Set to None or 0.0 in config to disable.
prompt_exposure_guardbooleanEnable the prompt_exposure safety guardrail on this agent's LLM responses. When true, the agent scans every terminal tool-call content (proposal / batch evaluation) for internal-prompt leakage (XML scaffolding tags, canonical tool names, meta-protocol phrases) and forces a retry with a block-reason feedback message when a leak is detected. Defaults to false so existing deployments do not change behavior until explicitly opted in. See [docs/middleware.md#prompt_exposure-config](../../docs/middleware.md) for the detection heuristics.
propagate_payment_errorbooleanWhether to propagate 402 Payment Required errors to the orchestrator. When true (default), an agent_error event is published immediately. When false, the agent silently pauses and lets the orchestrator timeout.
provider_configobjectFree-form provider config for third-party [ProviderFactory] implementations. Built-in providers (exec / mcp / claude) use their typed sections above; a custom provider.type reads its knobs from here, so registering a new provider needs no new field on this core struct.

Deserialize the whole map into a typed struct with [AgentConfig::provider_config_as], or index the map directly.

[ProviderFactory]: crate::providers::ProviderFactory
provider_idstringLegacy provider reference. When model is set, this is overwritten during resolution. Kept for backward compatibility.
reasoning_effortstring | null
repair_invalid_escapesboolean
response_sla_secsinteger Maximum seconds this agent needs to complete a single task (propose or evaluate). When > 0, this is a hard infrastructure constraint — the orchestrator will never give this agent less time than this value per phase. Set to 0 to opt out of SLA reporting (the field is omitted from heartbeats). Defaults to 3600s (1 hour).
scratchpad_limitinteger
scratchpad_squeeze_fractionnumber Fraction of max_scratchpad_size at which compact_history also auto-squeezes the scratchpad. Default 0.95 — leaving 5% headroom keeps the next tool call from immediately tripping the persistence cap.
signing_schemesstring[]Signing schemes this agent supports (placeholder for #115). Values will be validated against SigningScheme enum when implemented. Empty means no signing support (legacy/internal agent).
supports_native_thinkingboolean
system_prompt_overridestring | null
task_precisionobject | nullPer-task-category precision parameters for the thermodynamic model. Map from task category (e.g. "supply", "audit", "quant", "legal") to { pg, pv } where pg = zero-shot generation precision, pv = verification precision. Used by the dashboard to compute the NSED utility function: U(t) = 1 - (1-pg) * exp(-Lambda*(pv-pg)*t) - beta*t^2 If absent, the dashboard falls back to built-in MODEL_PRECISION defaults.
temperaturenumber
textual_feedbackboolean
tool_formatstring | null
unwrap_hallucinated_tool_callsboolean
use_streamingboolean
404Agent not found
GET /api/agents/{name}/status per-agent status.
path parameters
namestringrequiredAgent name
Responses
200Agent status snapshotAgentStatusSnapshot
fieldtypedescription
agent_idstringrequired
buffered_countinteger requiredNumber of responses currently held in the HITL buffer.
current_jobstring | null
current_phasestring | nullCurrent deliberation phase: "propose", "evaluate", or null.
current_roundinteger | null
error_ratenumber requiredRolling error rate: tasks_failed / (tasks_completed + tasks_failed).
event_logEventLogEntry[]requiredChronological event log for the dashboard event stream.
flag_reasonstring | nullHuman-readable reason why the agent is flagged.
is_flaggedbooleanrequiredWhether the agent is flagged for operator attention.
is_pausedbooleanrequiredWhether the agent is paused (HITL control plane).
mean_scorenumber | nullRolling mean of recent_scores. None if no scores received yet.
model_namestringrequired
nats_connectedbooleanrequired
provider_idstringrequired
recent_scoresScoreEntry[]requiredRecent peer evaluation scores received from the orchestrator. Primary divergence indicator — consistently low scores flag a problem.
recent_tasksTaskLogEntry[]required
score_std_devnumber | nullStandard deviation of recent scores — higher values indicate divergence.
scratchpad_keysinteger required
tasks_completedinteger required
tasks_failedinteger required
uptime_secsinteger required
404Agent not found

HITL

PUT /api/agents/auto-all enable or disable auto-approve for all agents.
Request body AutoApproveRequest
fieldtypedescription
enabledbooleanrequired
thresholdnumber | nullDivergence threshold (0.0 to 1.0). Optional — if absent, only the enabled flag is updated.
Responses
200Auto-approve updated for all agents
400Invalid threshold value
PUT /api/agents/pause-all pause or resume all agents at once.
Request body PauseRequest
fieldtypedescription
pausedbooleanrequired
Responses
200All agents paused/resumed
PUT /api/agents/{name}/auto set auto-approve mode for an agent.

When auto-approve is enabled and the agent's effective divergence score falls below the configured threshold, buffered responses are auto-released immediately instead of waiting for the hold timer.

path parameters
namestringrequiredAgent name
Request body AutoApproveRequest
fieldtypedescription
enabledbooleanrequired
thresholdnumber | nullDivergence threshold (0.0 to 1.0). Optional — if absent, only the enabled flag is updated.
Responses
200Auto-approve state updated
400Invalid threshold value
404Agent or buffer not found
GET /api/agents/{name}/buffer list buffered responses.

Automatically drains entries from previous jobs when the agent has moved on to a new job, preventing stale evaluations from cluttering the review queue.

path parameters
namestringrequiredAgent name
Responses
200List of buffered entriesBufferEntrySummary[]
404Agent not found
GET /api/agents/{name}/buffer/{id} get full detail of a buffer entry.

Returns the deserialized response content (Proposal or Evaluation JSON) along with summary metadata. Used by the dashboard for operator inspection and editing before release.

path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Responses
200Buffer entry detailBufferEntryDetail
404Agent or entry not found
PUT /api/agents/{name}/buffer/{id} edit a buffered response's content.

Creates an OperatorAnnotation for audit traceability. If content is provided, the payload is replaced and the annotation type is Edit. If only operator_comment is provided, the annotation type is Comment.

When the operator edits the response, they become the "owner" of that output (in the future this will replace the agent's digital signature with the operator's higher-order key).

path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Request body BufferEditRequest
fieldtypedescription
contentobjectModified response content (Proposal or Evaluation JSON). If None, only the operator comment is recorded (no content change).
operator_commentstring | nullOptional operator commentary.
Responses
200Buffer entry edited
400Invalid content or missing fields
404Agent or entry not found
POST /api/agents/{name}/buffer/{id}/reject discard a buffer entry.
path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Responses
200Entry rejected and discarded
404Agent or entry not found
POST /api/agents/{name}/buffer/{id}/release force-release a buffer entry.
path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Responses
200Entry marked for release
404Agent or entry not found
POST /api/agents/{name}/buffer/{id}/stop reversibly stop a buffer entry.

Stopped entries remain in the buffer but are skipped by drain_ready(). The operator can later un-stop the entry to make it eligible for release.

path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Responses
200Entry stopped
404Agent or entry not found
POST /api/agents/{name}/buffer/{id}/unstop un-stop a previously stopped entry.

The entry becomes eligible for drain_ready() again. If its release_at has already passed, it will drain on the next worker cycle (≤500ms).

path parameters
namestringrequiredAgent name
idstringrequiredBuffer entry ID
Responses
200Entry un-stopped
404Agent or entry not found
PUT /api/agents/{name}/config live-update tunable parameters.

Applies a [ConfigPatch] — only non-null fields are updated. Changes are in-memory only (lost on restart).

path parameters
namestringrequiredAgent name
Request body ConfigPatch
fieldtypedescription
frequency_penaltynumber | null
max_react_iterationsinteger | null
max_retriesinteger | null
personastring | null
presence_penaltynumber | null
temperaturenumber | null
textual_feedbackboolean | null
Responses
200Config patched successfully
400Invalid config patch
404Agent not found
PUT /api/agents/{name}/pause pause or resume an agent.

Toggles the worker's pause flag via its AtomicBool handle. This works regardless of whether a response buffer is configured. When a buffer is also present, its pause flag is toggled in tandem.

path parameters
namestringrequiredAgent name
Request body PauseRequest
fieldtypedescription
pausedbooleanrequired
Responses
200Pause state updated
404Agent not found

Chat

POST /api/agents/{name}/chat chat with a specific agent.
path parameters
namestringrequiredAgent name
Request body ChatRequest
fieldtypedescription
messagesChatMessage[]required
Responses
200Chat response from the agentChatResponse
fieldtypedescription
responsestringrequired
400Invalid chat request payloadChatResponse
fieldtypedescription
responsestringrequired
404Agent not foundChatResponse
fieldtypedescription
responsestringrequired
500LLM call failedChatResponse
fieldtypedescription
responsestringrequired

Config

GET /api/config return global configuration (base hold duration).
Responses
200Current global configurationGlobalConfig
fieldtypedescription
base_hold_secsinteger required
buffer_floor_pctinteger requiredBuffer floor as % of total SLA — minimum hold before divergence boost.
response_sla_secsinteger requiredGlobal response SLA in seconds — agents exceeding this are flagged.
PUT /api/config update global configuration.

When base_hold_secs changes, all agent buffers' base hold duration is updated to the new value.

Request body GlobalConfigUpdate
fieldtypedescription
base_hold_secsinteger | null
buffer_floor_pctinteger | null
response_sla_secsinteger | null
Responses
200Updated global configurationGlobalConfig
fieldtypedescription
base_hold_secsinteger required
buffer_floor_pctinteger requiredBuffer floor as % of total SLA — minimum hold before divergence boost.
response_sla_secsinteger requiredGlobal response SLA in seconds — agents exceeding this are flagged.

Registry

GET /api/orchestrators list active orchestrator connections.
Responses
200List of active orchestrator connectionsActiveOrchestrator[]
POST /api/orchestrators request adding a new orchestrator at runtime.

The request is forwarded to the runner via a channel. The actual registration (JWT ceremony) and worker spawning happens asynchronously.

Request body AddOrchestratorRequest
fieldtypedescription
agent_namesstring[]Optional list of agent names to connect. If empty, all agents connect.
bearer_tokenstring | nullBearer token for authentication (supports ${ENV_VAR} expansion).
idstring | nullOptional orchestrator ID. Derived from URL hostname if omitted.
urlstringrequiredOrchestrator HTTP URL (e.g. "http://orch-2:8080").
Responses
202Orchestrator registration queued
400Invalid request
503Orchestrator registry not available
GET /api/orchestrators/budgets fetch budget from each connected orchestrator.

For each orchestrator, proxies GET /api/operators/budget using the stored bearer token. Returns an array of results (one per orchestrator).

Responses
200Budget info per orchestratorOrchestratorBudget[]

Agent Management

POST /api/agents/bulk Bulk register agents

Register multiple agents in one request.

Request body BulkRegisterRequest
fieldtypedescription
agentsRegisterAgentRequest[]required
Responses
202Agent registrations accepted (pending hot-reload)BulkRegisterResponse
fieldtypedescription
errorsstring[]required
failedinteger required
registeredstring[]required
POST /api/agents/register Register new agent

Add a new agent to the config and start it. Returns 409 if the agent already exists.

Request body RegisterAgentRequest
fieldtypedescription
capability_tagsstring[]Capability tags for directory filtering.
descriptionstring | nullAgent description.
model_namestring | nullModel name (optional for stub provider).
namestringrequiredUnique agent name (alphanumeric + underscore, max 64 chars).
personastring | nullAgent persona / system prompt.
provider_idstringrequiredProvider ID — must reference a configured provider.
response_sla_secsinteger | nullResponse SLA in seconds.
signing_schemesstring[]Signing schemes supported.
Responses
202Agent registration accepted (pending hot-reload)RegisterAgentResponse
fieldtypedescription
namestringrequired
statusstringrequired
400Invalid agent name or config
409Agent already exists
PUT /api/agents/{id}/manage Replace agent config

Full replace of agent configuration in memory. Config changes take effect on the worker's next task cycle. Full restart requires AgentManager integration.

path parameters
idstringrequiredAgent ID (currently name; future: pubkey fingerprint)
Request body RegisterAgentRequest
fieldtypedescription
capability_tagsstring[]Capability tags for directory filtering.
descriptionstring | nullAgent description.
model_namestring | nullModel name (optional for stub provider).
namestringrequiredUnique agent name (alphanumeric + underscore, max 64 chars).
personastring | nullAgent persona / system prompt.
provider_idstringrequiredProvider ID — must reference a configured provider.
response_sla_secsinteger | nullResponse SLA in seconds.
signing_schemesstring[]Signing schemes supported.
Responses
200Agent updatedRegisterAgentResponse
fieldtypedescription
namestringrequired
statusstringrequired
400Invalid config
404Agent not found
PATCH /api/agents/{id}/manage Patch agent config

Partial update — only provided fields are changed.

path parameters
idstringrequiredAgent ID (currently name; future: pubkey fingerprint)
Request body PatchAgentRequest
fieldtypedescription
capability_tagsarray | null
descriptionstring | null
model_namestring | null
personastring | null
provider_idstring | null
response_sla_secsinteger | null
signing_schemesarray | null
Responses
200Agent patchedRegisterAgentResponse
fieldtypedescription
namestringrequired
statusstringrequired
404Agent not found
DELETE /api/agents/{id}/manage Remove agent

Stop and remove an agent. Use ?force=true to remove agents with pending tasks.

path parameters
idstringrequiredAgent ID (currently name; future: pubkey fingerprint)
query parameters
forcebooleanSet to true to force removal of agents with pending tasks
Responses
202Agent removal accepted (pending hot-reload)
404Agent not found
409Agent has pending tasks (use ?force=true)