ERC-8460 Agent credit line (Agent Credit Lines)

Draft · Vaults & DeFi · created 2026-10-20

Defines a common interface for loan contracts that extend revolving credit in ERC-20 tokens to an autonomous agent's identity, covering quoting, borrowing, repayment, and default handling.

Why it is needed

Autonomous agents often need operating capital because they must pay for services before they get paid for their own work. Lenders that extend unsecured or partially secured credit to agent identities have already appeared, but each one uses its own functions and events. A wallet that wants to borrow a shortfall at payment time, a job market that wants to check whether a given provider is in default, and a reader that wants to reconstruct an agent's credit history from logs alone all have to integrate with each lender separately. Yet the calls needed are the same everywhere: check how much can be borrowed right now and at what cost, actually borrow, check how much is owed to close the loan and repay it, and mark a default if needed. Fixing these calls and the events that record them lets a single client borrow from any lender, and a single reader reconstruct any lender's loan history without a lender-specific adapter.

What to implement

In depth

Identities and controllers

agentId is the token ID in the ERC-721 registry pointed to by identityRegistry(). isController must return true if ownerOf(agentId) equals the given account, and may also return true for another account (a delegate) that the owner designated and the lender accepted, but must never return true for an account the owner did not designate. For a nonexistent agentId or the zero address, it returns false rather than reverting. If an identity changes to a different owner, any previously designated delegate must immediately lose controller status, and if the registry supports ERC-5008 transfer nonces, the lender must bind the delegate to the nonce at the time it was designated, so that an old delegate cannot work again even if the identity returns to the same owner.

Available credit and quotes

availableCredit(agentId) must return the maximum amount for which borrow would not revert right now due to insufficient credit or liquidity, returns 0 if nothing can be borrowed, and must never revert. quote(agentId, amount, term) must return the fee that would be recorded if borrow(agentId, amount, term, to, maxFee) were called in the same state.

Borrowing: borrow

borrow must revert if isController(agentId, msg.sender) is not true. It must revert if amount is 0 or greater than availableCredit, or if the fee that would be recorded exceeds maxFee. It may also revert for lender-specific reasons, such as the term falling outside the lender's allowed range or the identity already being in default. On success, it records the loan under a loanId that is nonzero and never reused, setting owner to ownerOf(agentId) at that time, issuedAt to the block timestamp, dueAt to issuedAt + term, defaultableAt to no earlier than dueAt, and status to Active. It sends amount of asset() to to and emits Borrowed.

Repayment: repay

amountDue(loanId) returns the amount needed to close the loan with a repayment right now, and returns 0 if the status is not Active. repay(loanId, maxDue) can be called by anyone, and must revert if the loan is not Active or the repayment amount exceeds maxDue. It collects the repayment amount from msg.sender via transferFrom, changes the status to Repaid, emits Repaid with payer set to msg.sender, and returns the amount received. There is no partial repayment; the full amount is repaid at once. The principal and fee recorded in Repaid are the values recorded at borrow time, and a lender that charges additional costs after the due date may include those in amountDue and emit a separate event for them.

Default handling: markDefault

markDefault(loanId) can also be called by anyone. It must revert if the loan is not Active or the block timestamp has not yet reached defaultableAt. On success, it changes the status to Defaulted and emits Defaulted carrying the owner recorded at borrow time. How a default affects the lender's internal records, a guarantor's stake, or collateral is outside the scope of this interface.

Difference from collateralized loans

ERC-7565 also has term loans with a maturity date and a Defaulted event, but there each loan posts an NFT as collateral, and on default that NFT is transferred to the lender. In this standard, the identity itself is not collateral, because seizing an agent identity would also transfer the reputation that identity has built up to the lender, and most of the credit extended to agents is unsecured. So instead of seizing collateral, a default is recorded by naming the owner. Both standards use the event name Defaulted, but the signatures differ, so the topics do not collide; indexers must distinguish events by topic rather than by name.

What remains undecided

This proposal is in Draft status, submitted in October 2026. The detailed rules may still change or discussion may stall, so check the latest status before implementing it in practice.

Things to watch out for

Original ERC · ← ERCs