Agent Credit is an open-source toolkit that introduces the first credit line for AI agents using Aave's credit delegation system on Ethereum-compatible blockchains. This tool falls under the rapidly growing category of autonomous DeFi infrastructure, designed specifically for developers who need to give their agents access to on-chain capital without manual funding. Its core value proposition is enabling agents to borrow and repay funds programmatically using the user's existing Aave collateral, while the user retains full control over borrowing limits, asset selection, and the ability to revoke delegation at any time. The system leverages Aave's variable debt tokens to create a trust-minimized arrangement: the agent holds its own wallet for transaction signing and never accesses the user's private key. This paradigm shift allows agents to become self-funding entities that can operate independently within the DeFi ecosystem, accessing liquidity exactly when needed.
The primary problem Agent Credit solves is the operational friction of manually funding agent wallets. Traditionally, developers building automated agents must periodically transfer ETH or tokens to the agent's address to cover transaction costs and capital for operations. This creates overhead, potential delays, and often results in idle funds sitting in the agent's wallet. With Aave credit delegation, the agent can borrow stablecoins or ETH directly from the user's existing collateral position on Aave. The user's capital remains productive as collateral, earning yield, while the agent accesses liquidity on demand. The pain point of managing separate wallet balances and ensuring the agent always has sufficient funds is eliminated. Instead, the user sets a global credit line per asset, and the agent borrows the exact amount needed, when needed, with debt accruing on the user's Aave position. This makes agent operations seamless and capital-efficient.
The first major feature group is the set of bash scripts that enable agent-side borrowing with robust safety checks. The primary script, aave-borrow.sh, allows the agent to borrow any approved asset by calling the Aave pool's borrow function using the delegation allowance. Critically, before executing any transaction, the script performs four automated safety checks. First, it verifies the requested amount is within the per-transaction cap set in the configuration file. Second, it checks that the delegation allowance on the specific variable debt token is sufficient. Third, it computes the delegator's health factor after the would-be borrow and ensures it remains above a configurable minimum (default 1.5). Fourth, it confirms the agent wallet has enough ETH to pay for gas. If any check fails, the borrow is aborted with a clear error message. This built-in safety layer is essential for autonomous agents to avoid liquidating the user's position.
admin
The second major feature group revolves around delegation management and user control. The user sets per-asset borrowing limits by calling approveDelegation on each variable debt token contract. Each asset on Aave has a distinct debt token, so the user can independently approve, say, 500 USDC and 0.1 WETH. The agent can only borrow from the assets that have been explicitly approved, even if the user's total collateral would support larger borrowing. The approval amount is expressed in raw units—for USDC with 6 decimals, 500 USDC becomes 500,000,000. The user can change an approval by calling approveDelegation again with a new amount, which replaces the previous value. To revoke delegation entirely, the user sets the amount to zero. This isolated, per-asset control ensures the agent cannot borrow unapproved tokens, giving the user fine-grained risk management.
The third feature group covers compatibility and integrations with agent frameworks. Agent Credit is designed to work with OpenClaw, where it can be installed as a skill, allowing the agent to borrow autonomously within the OpenClaw environment. It also integrates with Claude Code, enabling developers to run the scripts directly from a Claude Code session. Because the scripts are plain bash combined with Foundry's cast tool, they are compatible with any agent framework that can execute shell commands—no special dependencies required. Furthermore, Agent Credit combines naturally with Bankr, a DeFi automation platform. With Bankr, the agent can swap borrowed USDC for any token, bridge funds to another chain, or deploy capital into yield strategies. This integration transforms a simple credit line into a full autonomous DeFi toolkit, enabling complex multi-step operations.
The overall workflow of Agent Credit follows a clear two-party setup: the delegator (user) and the agent. The user first supplies collateral on Aave using the standard Aave interface. Then they locate the variable debt token addresses for the assets they wish to delegate—either from the Aave UI or from the provided deployments.md file. Using a block explorer like Etherscan, the user calls approveDelegation on each debt token, entering the agent's address and the maximum borrow amount in raw units. After that, the user sends a small amount of ETH to the agent's wallet to cover gas fees—a borrow on Base costs about $0.01. Once these steps are complete, the agent can run aave-borrow.sh with the desired asset symbol and amount. The script runs the safety checks, then submits the borrow transaction. The debt appears on the user's Aave dashboard, and the agent can repay using aave-repay.sh or the user can repay manually.
Concrete use cases demonstrate the power of this system. For self-funding agents, the agent borrows stablecoins as needed to pay for on-chain operations, eliminating manual transfers and keeping capital productive as collateral. In autonomous DCA scenarios, the agent borrows USDC periodically via credit delegation, then uses Bankr to swap into ETH, gradually building a position without any manual intervention. Gas self-sufficiency is another use case: an agent monitoring a position can borrow a tiny amount of WETH to cover its own gas fees when its balance runs low, ensuring uninterrupted operation. For on-demand liquidity, the agent accesses capital exactly when needed for trades or liquidity provision, avoiding idle capital. Borrow+swap combos allow the agent to borrow USDC, swap to a governance token, and participate in voting—all in one autonomous flow. The outcomes include reduced operational overhead, efficient capital utilization, and 24/7 automated DeFi participation.
Agent Credit is designed for developers building AI agents on EVM-compatible chains where Aave V2 or V3 is deployed, including Base, Ethereum, Polygon, and Arbitrum. The primary audience is DeFi users who already have collateral positions on Aave and wish to delegate borrowing power to automated agents for advanced strategies. The tech stack is minimal: bash scripts and Foundry's cast tool for Ethereum JSON-RPC interactions. The toolkit is open-source and free, with no paid plans. Users must have an existing Aave depositor position and be comfortable using block explorers to approve delegation. Safety recommendations include starting with small amounts, never approving type(uint256).max, monitoring health factor, revoking when idle, preferring stablecoins for borrowing, and testing on testnets first. In summary, Agent Credit provides the infrastructure for AI agents to become financially autonomous while preserving user control and safety, transforming Aave depositors into credit issuers for the next generation of decentralized automation.
Developers building AI agents on EVM chains with Aave V2/V3 deposits. DeFi power users who want to automate treasury management by delegating credit to agents. Aave depositors seeking to earn yield on collateral while enabling agent borrowing. OpenClaw and Claude Code users looking to extend agent capabilities with on-chain capital. Crypto traders implementing DCA strategies with autonomous borrowing. Blockchain developers interested in autonomous DeFi infrastructure and credit delegation mechanics. Also suitable for enthusiasts exploring trust-minimized agent finance on Base, Ethereum, Polygon, or Arbitrum.