Agent Credit is an open-source toolkit that provides an AI agent credit line by harnessing Aave's credit delegation mechanism. It fits into the emerging category of DeFi infrastructure tailored for autonomous agents, targeting developers who want their agents to execute on-chain operations independently. The core value is straightforward: rather than manually transferring funds to an agent's wallet every time it needs to perform a transaction, the user supplies collateral on Aave and delegates a borrowing allowance to the agent. The agent then borrows from the user's credit line, with the debt accruing against the user's position. The user maintains absolute control by setting per-asset ceilings via the approveDelegation function and can revoke the delegation at any time. This design enables efficient autonomous financial workflows while keeping the user's private key safe and the agent's spending strictly bounded.
The specific pain point Agent Credit solves is the friction of manually funding agent wallets for on-chain operations. Autonomous agents need capital to pay for gas, execute swaps, provide liquidity, or perform other DeFi actions. Traditionally, a developer must monitor the agent's balance and periodically transfer funds, which is tedious, prone to human error, and defeats the purpose of automation. Worse, giving an agent unrestricted access to a wallet with a private key creates immense security risk. Agent Credit sidesteps both problems by using Aave's credit delegation: the agent holds only its own key with minimal ETH for gas, while borrowing power comes from the user's existing collateral. The debt accumulates on the user's position, so the agent never needs a large balance. This matters because it unlocks truly self-sustaining agents that can operate continuously without manual intervention, while the user retains full authority over the credit line.
The first major feature group is the core borrowing and repayment scripts. The repository provides four bash scripts designed for the agent: aave-setup.sh, aave-borrow.sh, aave-repay.sh, and aave-status.sh. The aave-borrow.sh script is the heart of the system, allowing the agent to request a loan of a specific symbol and amount. Before executing the borrow transaction, it runs four mandatory safety checks. The per-transaction cap ensures the requested amount does not exceed the configured maximum, defined in config.example.json. The delegation allowance check verifies that the user has granted sufficient approval on the VariableDebtToken. The health factor check simulates the borrow to ensure the user's position remains above a safe threshold, defaulting to 1.5. Finally, the gas balance check confirms the agent wallet has enough ETH to cover transaction fees, with a fallback floor when the RPC returns zero gas price. If any check fails, the script aborts with a clear error message, preventing a dangerous borrow.
admin
The second major feature group is the safety and control mechanisms. Agent Credit implements multiple layers of protection without requiring the user to trust the agent. The primary safety layer is that the agent never holds the user's private key; it only knows the user's address. All delegation approvals are done by the user through the Aave web UI or a block explorer, not through the agent's scripts. The user sets delegation ceilings per asset by calling approveDelegation on each VariableDebtToken contract, specifying the exact maximum amount the agent can borrow. Additionally, the agent's config file enforces a per-transaction cap and a minimum health factor. The health factor check is particularly important because it prevents the agent from borrowing so much that the user's position becomes liquidatable. If the market moves against the position, the agent's subsequent borrow requests are blocked automatically. The user can also revoke delegation instantly at any time by setting the allowance to zero.
The third major feature group encompasses compatibility and integration capabilities. Agent Credit is designed to work with a wide range of agent frameworks and DeFi tools. It supports Aave V2 and Aave V3 and is preconfigured for Base, Ethereum, Polygon, and Arbitrum chains, but works on any EVM chain where Aave is deployed. The scripts are written in plain bash and use Foundry's cast utility, making them portable across environments. They can be installed as a skill in OpenClaw, run directly from a Claude Code session, or integrated into any agent framework that supports shell commands. Furthermore, Agent Credit combines naturally with Bankr skills, enabling complex workflows like borrowing USDC via delegation and then using Bankr to swap to ETH or bridge to another chain. This composability allows developers to build advanced autonomous strategies without custom integration work.
How the product works overall: the credit delegation architecture separates borrowing power from delegation approval. The user's collateral on Aave generates a holistic borrowing capacity, determined by the loan-to-value ratio across all assets. This capacity is shared, but delegation approval is isolated per debt token. The user calls approveDelegation on each VariableDebtToken contract to authorize the agent to borrow a specific amount of that asset. The agent then uses the aave-borrow script, providing the asset symbol and amount. The script interacts with the Aave protocol via cast to execute the borrow, which creates debt in the user's position. Repayment is done using aave-repay, which the agent can also execute on behalf of the user, as it is a permissionless action on Aave. The agent's workflow is fully automated: check status, borrow if needed, repay later, all within the bounds set by the user.
Concrete use cases and outcomes include self-funding agents, autonomous dollar-cost averaging, gas self-sufficiency, and on-demand liquidity. For example, an agent providing liquidity can borrow USDC from the user's Aave position to add to a pool, earning fees that eventually repay the debt. Another use case is autonomous dollar-cost averaging: the agent borrows USDC periodically and uses Bankr to swap into ETH, building a position over time without the user doing anything. Gas self-sufficiency allows the agent to borrow a tiny amount of WETH to cover its transaction fees when its native gas balance runs low, ensuring continuous operation. On-demand liquidity means the agent accesses capital exactly when a DeFi opportunity arises, rather than having idle funds. The outcome for each use case is the same: the agent operates fully autonomously, performing complex DeFi actions without manual funding or custodial risk.
Target users are developers and power users building autonomous AI agents on EVM-compatible blockchains, requiring familiarity with Aave, Foundry, and bash scripting. Ideal users include DeFi enthusiasts who want to automate their positions and AI agent developers creating services that need on-chain capital. The tech stack is minimal: a Unix-like shell, Foundry's cast, and an Ethereum RPC endpoint. The project is open source under the MIT license, available on GitHub, and free to use aside from network transaction fees. It is preconfigured for major chains but extensible to any EVM network with Aave. In summary, Agent Credit provides a dedicated AI agent credit line solution, enabling agents to borrow on demand while users retain full custody of their collateral and the ability to revoke access at any time.
Developers building autonomous AI agents on EVM-compatible blockchains, DeFi enthusiasts who want to automate their Aave positions, and power users seeking self-funding capabilities for agents without exposing private keys. Requires proficiency with Foundry, bash scripting, and the Aave protocol. Open source contributors interested in AI and DeFi infrastructure integration.