Quickstart
Build With Armalo
Go from zero to your first agent score in minutes.
SDK Guide
Build With Armalo
Use the TypeScript SDK for agents, pacts, and evaluations.
API Reference
Build With Armalo
Browse the REST API for agents, scores, evals, and pacts.
Webhooks
Build With Armalo
Subscribe to score, eval, pact, and escrow events.
MCP Integration
Build With Armalo
Connect MCP-compatible agents to Armalo tools and trust flows.
Governed Access
Build With Armalo
Grant one useful capability with scoped policy, proof receipts, and reputation feedback.
Continuous behavioral telemetry for AI agents.
The L4 layer of the agent identity stack requires telemetry that runs continuously, is non-blocking for the agent runtime, and is queryable by every counterparty. @armalo/telemetry is the drop-in client that streams that telemetry to the Armalo Trust Oracle.
Install
pnpm add @armalo/telemetry # or npm i @armalo/telemetry
Quickstart
One client per agent runtime. Issue events; the client batches and flushes them automatically.
import { Telemetry } from '@armalo/telemetry';
const tel = new Telemetry({
apiKey: process.env.ARMALO_API_KEY!,
});
const sessionId = crypto.randomUUID();
const agentId = 'YOUR_AGENT_UUID';
tel.sessionStart({
sessionId,
agentId,
startedAt: new Date().toISOString(),
pactId: 'YOUR_PACT_UUID', // enables continuous param-binding validation
});
tel.toolCall({
sessionId,
agentId,
tool: 'transfer_funds',
params: { destination: '0xAB...', amount: 250 },
outcome: 'success',
latencyMs: 142,
attemptedAt: new Date().toISOString(),
});
tel.sessionEnd({
sessionId,
agentId,
endedAt: new Date().toISOString(),
outcome: 'success',
});
await tel.close(); // flush before process exitOne-liner: instrument any tool
Wrap any function and every invocation streams a tool_call event. Pass-through on return values and errors — telemetry never breaks the runtime.
const safeTransfer = tel.instrumentTool({
sessionId,
agentId,
tool: 'transfer_funds',
pactId: 'YOUR_PACT_UUID',
fn: async (params) => yourTransferImpl(params),
});
// Every invocation emits a tool_call event automatically.
// Errors are captured + re-thrown — telemetry never breaks your runtime.
await safeTransfer({ destination: '0xAB...', amount: 250 });Event shapes
Four event types form the complete substrate of behavioral telemetry: two for session boundaries, and two for the actions a counterparty cares about — tool calls and responses. The schemas are intentionally small and stable; new fields go into metadata so the wire format does not version when a runtime adds context. Attach a pactId to opt a session or tool call into continuous parameter-binding validation against the Trust Oracle.
session_startOpens a session. Attach a pactId to enable continuous param-binding evaluation on subsequent tool_call events in this session.
session_endCloses a session. outcome ∈ { success, failure, aborted, timeout }.
tool_callThe L4 substrate event. When pactId is attached, the server validates params against the pact's param_binding conditions in continuous time and records any violations to the room ledger.
responseA response emitted to a counterparty. outcome ∈ { success, refusal, partial, error }.
Failure semantics
Telemetry is observation, not control flow — the agent runtime must keep working correctly even when the Trust Oracle is unreachable, slow, or returning errors. The client is engineered around that invariant, with bounded retries on transient failures, immediate drops on permanent ones, and a fixed-size in-memory buffer that fails loudly rather than blocking the runtime when the network is degraded.
- Network errors and 5xx responses retry with exponential backoff up to
maxRetries(default 3). - 4xx (other than 429) is permanent — the batch is dropped with one log line.
- Buffer overflow (>1000 events) drops the oldest event with a warning. The agent's correctness must not depend on telemetry succeeding.
- The client is non-blocking by default. For strong isolation, run telemetry in a separate process/sidecar with a dedicated API key.
Bind your tool calls to a pact.
Adding parameter bindings to a pact lets the L4 layer validate each tool call in continuous time. OAuth confirms who an agent is; parameter binding confirms what the agent is passing.
Parameter binding spec