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
event Borrowed(uint256 indexed loanId, uint256 indexed agentId, address indexed to, uint256 principal, uint256 fee, uint64 dueAt);: Emitted when a loan is issued, recording the loan ID, identity, recipient address, principal, fee, and due date.event Repaid(uint256 indexed loanId, uint256 indexed agentId, address indexed payer, uint256 principal, uint256 fee);: Emitted when a loan is repaid in full, recording who repaid it along with the principal and fee.event Defaulted(uint256 indexed loanId, uint256 indexed agentId, address indexed owner, uint256 principal);: Emitted when a loan is marked as defaulted, recording the owner at the time of the loan and the principal.function identityRegistry() external view returns (address);: Returns the address of the ERC-721 registry of identities this lender serves.function asset() external view returns (address);: Returns the address of the ERC-20 token that is lent and repaid.function isController(uint256 agentId, address account) external view returns (bool);: Returns whether the given account is authorized to borrow on behalf of that identity.function availableCredit(uint256 agentId) external view returns (uint256);: Returns the maximum additional amount that identity can borrow right now.function quote(uint256 agentId, uint256 amount, uint64 term) external view returns (uint256 fee);: Precomputes and returns the fee that would be recorded for borrowing a given amount over a given term.function borrow(uint256 agentId, uint256 amount, uint64 term, address to, uint256 maxFee) external returns (uint256 loanId);: Actually borrows money against the identity's credit limit, sends it to the specified address, and records the loan.function amountDue(uint256 loanId) external view returns (uint256);: Returns the repayment amount needed to close that loan right now.function repay(uint256 loanId, uint256 maxDue) external returns (uint256 paid);: Repays the loan in full and changes its status to Repaid.function markDefault(uint256 loanId) external;: Marks a loan as defaulted once its due date and grace period have passed.function loanInfo(uint256 loanId) external view returns (LoanInfo memory);: Looks up the full record of a loan by its loan ID.
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
- Registry trust: Lenders verify all authority by reading ownerOf on the identity registry. A registry that can be upgraded or paused can change who controls an identity, so lenders need to understand the registry's governance.
- Delegate: A delegate is a key that can borrow against the full credit limit. Lenders must terminate delegate status when an identity's owner changes, and should bind it to the transfer nonce where possible. Owners should clear out delegates before transferring an identity.
- Cheap identities: Because creating an identity is cheap, the credit limit extended to a new identity is a bet on who is behind it. This interface does not prescribe that, so lenders need their own underwriting criteria.
- A default follows an address, not a person: The owner recorded on a loan is just an address. An owner who defaulted can create a new address, so a reader should treat an identity with no history as unknown rather than as clean.
- repayment via transferFrom: The repayer must approve the lender in advance. If a token that deducts a fee on transfer is used, the lender receives less than expected, so lenders should use a token with no transfer fee or verify the amount actually received.