tenzro-agent-bond
v0.1.0
Published
Agent insurance & bonding desk — a programmatic surface for agent platforms to post TNZO AgentBonds against agent DIDs (Spec 9), top up / wind them down, and file insurance claims against a misbehaving agent's bond. Wraps the SDK BondClient + InsuranceCli
Readme
tenzro-agent-bond
A programmatic insurance & bonding desk that agent platforms run to give their agents Amex-style indemnity. The desk lets a platform:
- post a TNZO AgentBond against an agent DID — which promotes that agent into the Delegated admission lane and backs it with stake,
- top up or wind down that bond, and
- when an agent misbehaves, file an insurance claim against its bond, paid from the insurance pool on governance approval.
The desk wraps the SDK's BondClient (Spec 9 bond ops) and InsuranceClient
(claims + pool). It holds no keys: bond writes build typed
PostAgentBond / IncreaseAgentBond / WithdrawAgentBond transactions whose
signing is ambient (DPoP-bound bearer JWT, server-side MPC). Claim
approval/payout flows through governance and the on-chain PayInsuranceClaim
transaction, not this desk.
Install & build
npm install
npm run buildUsage
import { InsuranceBondingDesk } from "tenzro-agent-bond";
const desk = new InsuranceBondingDesk({
endpoint: "https://rpc.tenzro.network",
// supply a transport carrying the platform's DPoP-bound bearer JWT to call
// the bond write paths; read paths and claim filing work without it.
});
// reads
await desk.pool(); // { vault, balance_wei, paid_claims, ... }
await desk.listClaims(); // { count, claims: [...] }
await desk.listBondsByController("did:tenzro:human:acme"); // { count, aggregate_bond, bonds }
// bond writes (ambient DPoP auth, server-side MPC signing)
await desk.postBond({
controller: "0x…",
agentDid: "did:tenzro:machine:0x…:…",
controllerDid: "did:tenzro:human:acme",
amount: 1_000_000_000_000_000_000n,
});
// file a claim against a misbehaving agent's bond
await desk.fileClaim({
claimant: "did:tenzro:human:victim",
agentDid: "did:tenzro:machine:0x…:…",
amount: "500000000000000000",
evidence: "ipfs://… or hash/description",
});API
| Method | Kind | Description |
|--------|------|-------------|
| getBond(bondId) | read | Fetch a single bond record by 32-byte bond id |
| listBondsByController(controllerDid) | read | Bonds a controller DID has posted ({count, aggregate_bond, bonds}) |
| postBond(params) | write | Post a fresh bond, locking TNZO and promoting the agent |
| increaseBond(controller, agentDid, amount) | write | Top up an Active bond (tx.from = original poster) |
| withdrawBond(controller, agentDid) | write | Start the withdrawal cooldown on an Active bond |
| fileClaim(params) | write | File a claim against a misbehaving agent's bond |
| listClaims() | read | List every insurance claim known to the node ({count, claims}) |
| getClaim(claimId) | read | Fetch a single claim by its 32-byte id |
| pool() | read | Insurance pool vault state ({vault, balance_wei, paid_claims, total_paid_wei, open_claim_count}) |
Demo (read-only, against live infra)
npm run demo # pool balance + claims
npm run demo -- did:tenzro:human:acme # also list that controller's bondsLiveness (read-only, against live infra)
npm run livenessProbes the insurance pool balance and the filed-claim list. It does not post, increase, or withdraw a bond, nor file a claim — those are stateful actions exercised via the desk's write methods with real authorization.
Configuration
| Var | Default | Meaning |
|-----|---------|---------|
| TENZRO_RPC | https://rpc.tenzro.network | Tenzro JSON-RPC endpoint |
Notes
- Bond writes require a transport carrying the platform's DPoP-bound bearer JWT — the desk never holds signing keys; signing is server-side MPC.
- Posting a bond promotes the agent DID into the Delegated admission lane and backs it with the locked stake. Withdrawal starts a cooldown rather than releasing funds immediately.
- Claim approval and payout are governance + on-chain
PayInsuranceClaim, outside this desk's surface —fileClaimonly opens the claim.
