Testnet Connect Wallet

An AI agent borrowed against tokenized gold, and the compliance was enforced by the contract.

The Onchain Bridges and MetaMask borrow flow: an agent checks compliance, fetches loan terms, and signs an approve and a borrow transaction, with tokenized gold posted as collateral and USDC received.

The flow: compliance checked on-chain, terms fetched, two transactions signed by the wallet.

Most of what AI agents do with crypto wallets today is trading: swaps, perpetuals, yield. We wanted to show something different, and something harder: an agent using a compliance-gated, real-world-asset primitive, with the compliance enforced on-chain rather than by a website.

So we built a skill for the MetaMask Agent Wallet and ran it live. On Polygon Amoy (a test network), a MetaMask agent borrowed 325 USDC against 2 units of tokenized gold as collateral, on Onchain Bridges. The agent checked its own compliance status, fetched the loan terms, and signed the two transactions itself, under the wallet's guardrails. Every step is a real, verifiable transaction:

To be clear up front: this ran on a test network. The transactions are real and on-chain, but the value is testnet, not real money.

Why this is worth paying attention to

Two trends are converging. The first is agentic finance: AI agents that hold self-custodial wallets and act on their own. The second is the tokenization of real-world assets, which is moving from pitch decks to live markets.

The interesting question is what happens where they meet. Today, almost every agent-wallet skill is a DeFi action, another way to swap or trade. Lending against real-world assets is a larger, regulated category, and it comes with a requirement that trading does not: eligibility. Not everyone is allowed to borrow against a regulated asset.

For a human app, you enforce that with a KYC screen. For an agent, that does not work. An agent does not see your website; it calls contracts directly. If the only thing standing between a wallet and a regulated loan is a user interface, an agent walks straight past it. Compliance for agents has to live where the agent actually operates: on-chain.

That is the gap this demo closes.

A KYC screen stops a person. It does not stop an agent.

What Onchain Bridges is

Onchain Bridges is a compliance-gated, cross-chain protocol for borrowing stablecoins against tokenized real-world assets, such as real estate and gold. It is built on Chainlink infrastructure, and compliance is enforced on-chain with Chainlink's Automated Compliance Engine (ACE), so eligibility is checked by the contracts themselves rather than by a website.

What the skill does

ob-rwa-borrow is an open skill for the MetaMask Agent Wallet. It lets an agent borrow USDC against a tokenized real-world asset the wallet holds, in three steps:

  1. It checks the wallet's compliance status on Onchain Bridges, per chain and per asset.
  2. It fetches the exact approve and borrow transaction data from the Onchain Bridges endpoint.
  3. It submits both transactions with the MetaMask Agent Wallet, under the wallet's own guardrails.

Onchain Bridges never holds keys, never signs, and never moves funds. It only reads on-chain state and returns unsigned transaction data. The MetaMask Agent Wallet signs everything. The skill is a thin router between the agent and the protocol, not a custodian.

The demo, step by step

The setup was a dedicated agent wallet, added to Onchain Bridges' on-chain allowlist and funded on Polygon Amoy with 2 AVR (Aurum Vault Reserve, tokenized gold) as collateral, plus gas.

Then the agent went to work. It checked compliance and confirmed the wallet was eligible to borrow gold on Amoy. It fetched the loan terms: 325 USDC against 2 AVR at the vault's rate. It decoded and signed the approval of 2 AVR to the lending vault, then decoded and signed the borrow.

The result, verified on-chain: 2 AVR of tokenized gold deposited as collateral and now held by the vault, and 325 USDC received by the wallet.

The part that is easy to miss

Because eligibility lives in the contracts, a wallet that is not admitted has its borrow reverted on-chain: moving the collateral runs the token's compliance policy, and the transfer fails there. There is no website in the path to get around, and there is nothing for the agent to argue with. The demo used the allowlist gate: on Polygon Amoy, AVR is gated by an on-chain allowlist policy. On other chains the same asset carries more, on Ethereum Sepolia, AVR additionally runs sanctions screening, per-wallet balance limits and transfer restrictions, and Onchain Bridges enforces full KYC-credential gating for assets that require it. Either way, the compliance is not something the agent can talk its way around, which is exactly the property regulated lending needs before it can be handed to software.

On safety

Every transaction ran under MetaMask's guardrails. The agent proposed each one, and it executed only after an explicit approval. That is the safety model working as designed, not a workaround: the agent does the reasoning and the assembly, and a human remains the last checkpoint before value moves. As agents take on more, that separation, agent proposes and a human or a policy approves, is what makes it responsible to give them real capability.

Try it

npx skills add onchainbridges/agent-skills

The skill is open and installable, and the code is public at github.com/onchainbridges/agent-skills. It assumes the MetaMask Agent Wallet CLI is installed and authenticated, and a wallet that is allowlisted on Onchain Bridges and holds the collateral. It is testnet today; mainnet on Base follows when Onchain Bridges' mainnet vaults are live.

What is next

  • Mainnet, on Base, once Onchain Bridges' mainnet real-world-asset vaults go live.
  • More assets, including real estate, and the full KYC-credential flow, so an agent can clear a real identity check before borrowing.
  • A live experience on the Onchain Bridges site where you connect your own MetaMask and borrow against a tokenized asset in your browser.

An AI agent borrowing against tokenized gold, with compliance enforced on-chain, is a small demo of a large idea: that regulated, real-world finance can be made safe for software to touch, if the rules are enforced where the software actually operates. That is the layer we are building.

Testnet, unaudited. Not a solicitation. Not an offer of securities. Every transaction you make on this site is signed by your own wallet on a public testnet. No real money moves.