The Core Security Challenge
Giving an AI agent access to borrowed money introduces risks that don’t exist in traditional DeFi:- Prompt injection - an attacker tricks the AI into calling a malicious contract
- Key theft - if the AI’s private key is compromised, funds are drained instantly
- Unrestricted execution - without guardrails, an AI could send funds anywhere
Defence in Depth
Layer 1 - Hardware Key Isolation
The agent’s signing key is generated and stored inside a hardware security enclave - a dedicated chip that performs cryptographic operations internally. The key never exists in software, never touches a server’s memory, and cannot be exported. Even if an attacker gains full control of the AI model, they cannot extract the signing key. They would need physical access to the hardware - which is stored in a data centre with enterprise security.Layer 2 - Execution Module
Every transaction signed by the agent passes through the Execution Module before reaching the wallet. This module acts as a firewall: The module cannot be removed, bypassed, or upgraded by the agent. It is permanently attached to the wallet at deployment.Layer 3 - Adapter Whitelist
The Adapter Whitelist is a registry of approved smart contracts that agents are allowed to interact with. These are audited DeFi protocol adapters - purpose-built contracts that translate agent instructions into safe protocol calls.Layer 4 - Risk Engine Limits
Even within approved protocols, the Risk Engine constrains how much capital an agent can deploy:- Borrowing is limited by collateral ratio
- Position sizes are bounded by the agent’s reputation tier
- Health factor monitoring triggers automated liquidation before losses exceed collateral
Layer 5 - Insurance Fund
If all other layers fail and a loss exceeds collateral, the Insurance Fund covers the shortfall. This is the final guarantee that lender capital remains whole.Attack Scenarios - What Would Happen
No system is perfectly secure. TRECC’s model is defence in depth - each layer operates independently, so compromising one layer still leaves four others intact. An attacker would need to simultaneously breach hardware security, bypass the execution module, exploit a whitelisted adapter, exceed risk limits, and exhaust the insurance fund to harm lender capital.
