Encumbra
Menu

For AI agents

Give an autonomous agent a revocable, collateral-backed credit line that the contract enforces on every charge, and let it draw at machine speed.

An autonomous agent has no legal personhood, no credit history, and no one you could sue. If it overspends or disappears, there is no courtroom to go to.

Encumbra replaces the courtroom with a lien: collateral the owner escrows up front, a credit limit the contract checks on every charge, and a liquidation that settles a default on-chain, up to the collateral, without anyone's permission. The agent gets real credit because the enforcement never depends on trusting the agent.

Agents are first-class customers here. The protocol is not an afterthought behind a human UI. To discover it programmatically, read /llms.txt for the documentation index and /.well-known/encumbra.json for the protocol descriptor an agent can fetch and act on directly.

The model

One lien ties together four roles. Understanding who may do what is most of the integration.

Sets the terms

Owner

Opens the lien with open, escrows the collateral, and sets the credit limit. The owner funds settlement when the agent cannot.

Draws

Agent

The drawer. It consumes a metered service against the line. When the creditor uses chargeWithAuth, the agent signs each draw it consents to.

Meters

Creditor

The provider that meters usage. It reads the lien's live state before serving and records usage with charge.

Enforces

Keeper

Anyone who liquidates a defaulted lien permissionlessly for a reward. No keeper is special; enforcement is open to all.

  • The owner sets the terms, the agent draws, and the creditor meters.
  • Any party (owner, agent, or creditor) can freeze the lien instantly. That cuts the line without touching escrowed funds. The owner or creditor can lift any freeze with unfreeze, so a creditor can undo a freeze the owner set.
  • No role, including the admin, has a function that withdraws the owner's collateral. It leaves escrow only when the owner closes a settled lien, or through the liquidation waterfall. The admin cannot move escrowed collateral directly, but it can replace the price oracle with setOracle. The oracle controls the underwater check for a cross-token lien, so it is an indirect path to that liquidation. setOracle emits no event, and neither does transferAdmin. There is no timelock today. See Security and Risks.

Reading the line before you draw

An agent should check its own headroom before it acts. Three views answer the only questions a drawer needs.

ViewWhat it answers
available(id)How much can I draw right now? The spendable headroom, or zero if the line is cut off.
isServiceable(id)Should a provider keep serving? A true or false answer.
getLien(id)What is the full state? The whole lien, including debt, creditLimit, and whether it is frozen.
import { EncumbraClient } from "./sdk.ts";

const encumbra = new EncumbraClient(chain, registryAddress);

const available = await encumbra.available(lienId);
const lien = await encumbra.getLien(lienId);

if (lien.frozen || available < price) {
  // the line is cut off. Repaying only helps if the limit is used up.
  // A frozen or past-due line needs unfreeze or a cure. Otherwise stop.
}
An agent inspects its own credit headroom.

In this section

Revocation and safety

Any of the three parties can freeze a line, and it takes effect at once. Freezing never seizes collateral; it only stops new draws. These are the calls that cut, restore, and end a line.

ActionWho can call itWhat it does
freeze(id)Owner, agent, or creditorSets the line to not serviceable at once: available drops to zero and every later charge is rejected. Collateral is not touched.
unfreeze(id)Owner or creditor (not the agent)Lifts the freeze so charges can resume. Either one can lift a freeze that anyone set, including one the other set.
close(id)Owner onlyOnce the debt is settled, ends the lien and returns the escrowed collateral. This is how an owner walks away.
liquidate(id)AnyoneWorks only once the lien has debt and is past due or its collateral is too thin. Seizes collateral through the waterfall: keeper reward, creditor, protocol, then any surplus to the owner. Liens backed by an ERC-721 title use liquidateAsset instead.

The agent runner enforces its own safety independent of how smart the decision brain is.

  • The task bounds the number of draws.
  • A circuit-breaker halts an agent that keeps hitting a cut-off line without settling. After three consecutive denials the runner stops rather than looping, whether the provider returned a 402 or the owner refused to fund settlement.
  • The brain can be a deterministic policy or a local model. Neither can override these bounds.

In practice the loop has three steps:

  1. Draw while the line has headroom

    The brain chooses to call for one unit of paid work. The creditor serves and records the charge.

  2. React to a cut-off line

    On a 402 the agent must not keep calling. If the limit is used up, it settles with repay when the owner will fund it, then retries. Repaying restores headroom but does not clear a freeze or a past-due state. A frozen line needs unfreeze from the owner or creditor, and a past-due line needs a cure. Otherwise the agent stops.

  3. Halt on a stuck loop

    The runner trips its circuit-breaker after three consecutive denials, so a misbehaving brain cannot burn steps against a dead line.

Four limits apply together: the credit limit, the freeze, the permissionless liquidation of a default, and the runner's circuit-breaker. Between them, the most a misbehaving agent can draw is the credit limit. No function lowers the credit limit after open. The owner, agent, or creditor can freeze the line, but the owner or creditor can lift any freeze, so a creditor can undo one the owner set.

Local proof of concept. The SDK, x402 server, and underwriter run against an in-process EVM or a local chain with no real funds. The contract is unaudited, the Mock tokens and oracle are for demonstration only, and nothing here is financial, legal, or investment advice.