AgentARC
Security & policy enforcement layer for AI blockchain agents with multi-stage validation, honeypot detection, and LLM-based threat analysis.
Install / Use
/learn @galaar-org/AgentARCREADME
AgentARC - Security Layer for AI Blockchain Agents
Advanced security and policy enforcement layer for AI blockchain agents with multi-stage validation, transaction simulation, and threat detection across DeFi + smart-contract attack surfaces, with LLM-based risk analysis.
What is AgentARC?
AgentARC sits between your AI agent and the blockchain. Every transaction the agent wants to send passes through a 4-stage validation pipeline before signing — catching threats that would otherwise reach the chain.
Agent wants to send a transaction
│
▼
┌─────────────────────────────────────┐
│ AgentARC Pipeline │
│ │
│ Stage 1: Intent Analysis │
│ → parse calldata, identify action │
│ │
│ Stage 2: Policy Validation │
│ → spending limits, allow/denylists │
│ │
│ Stage 3: Transaction Simulation │
│ → Tenderly sandbox test │
│ │
│ Stage 3.5: Honeypot Detection │
│ → test buy + sell before buying │
│ │
│ Stage 4: LLM Security Analysis │
│ → AI threat detection (optional) │
└──────────────┬──────────────────────┘
│
BLOCKED ─┤─ APPROVED
│
▼
Wallet executes
(EOA / ERC-4337 / Safe / CDP)
Threats it catches:
- Unauthorized fund transfers and unexpected value movement
- Hidden or unlimited token approvals and allowance abuse
- Malicious smart contracts and hostile call chains
- Token traps (honeypots, sell-blocks, malicious fee mechanics)
- Liquidity and price-manipulation patterns
- Reentrancy-style execution hazards
- Suspicious fund-flow anomalies
Key Features
- Multi-Stage Validation Pipeline — Intent → Policies → Simulation → Threat Detection
- 7 Policy Types — ETH limits, address allow/denylists, per-asset limits, gas limits, function allowlists
- Universal Wallet Support — EOA, ERC-4337 smart wallets, Safe multisig, Coinbase CDP
- Framework Adapters — OpenAI SDK, LangChain, AgentKit — same API for all
- Transaction Simulation — Tenderly integration for full execution traces
- Honeypot Detection — Automatically test buy + sell before any token purchase
- LLM Security Analysis — AI-powered malicious pattern detection (optional)
- Interactive CLI Wizard — Scaffold a new project in under a minute
Quick Start
Installation
# Core install (EOA + CDP wallets, no framework adapters)
pip install agentarc
# With OpenAI SDK support
pip install agentarc[openai]
# With LangChain support
pip install agentarc[langchain]
# With ERC-4337 smart wallet support
pip install agentarc[smart-wallets]
# With Safe multisig support
pip install agentarc[safe]
# Everything
pip install agentarc[all]
Scaffold a new project (recommended)
The interactive CLI wizard creates a complete project for your chosen wallet type and framework:
agentarc setup
==================================================
AgentARC Setup Wizard
==================================================
Is this for an existing or new project? [existing/new]: new
Enter your project name [my-secure-agent]: my-agent
Choose your agent framework [openai/langchain]: openai
Choose wallet type [eoa/erc4337/safe/cdp]: eoa
Choose network (number or name) [1]: 1 (Base Sepolia)
Select policy templates: 1,2 (Spending Limits + Denylist)
Project created at: ./my-agent
Files created:
agent.py <- EOA + OPENAI agent
policy.yaml <- Off-chain policy config
.env.example <- Environment variables for EOA
requirements.txt <- Python dependencies
.gitignore
Next steps:
cd my-agent
cp .env.example .env
# Add your keys to .env
pip install -r requirements.txt
python agent.py
The wizard supports all combinations of wallet × framework and generates the correct agent.py, policy.yaml, .env.example, and requirements.txt for each.
Wallet Support
AgentARC works with four wallet types. Your agent code changes by one line:
from agentarc import WalletFactory, PolicyWallet, OpenAIAdapter
# EOA — normal private key wallet
wallet = WalletFactory.from_private_key(private_key, rpc_url)
# ERC-4337 — smart contract wallet, transactions go through a bundler
wallet = WalletFactory.from_erc4337(owner_key, bundler_url, rpc_url)
# Safe — Gnosis Safe multisig wallet
wallet = WalletFactory.from_safe(safe_address, signer_key, rpc_url)
# CDP — Coinbase Developer Platform wallet
wallet = WalletFactory.from_cdp(cdp_provider)
# Everything below is identical for all four wallet types
policy_wallet = PolicyWallet(wallet, config_path="policy.yaml")
adapter = OpenAIAdapter()
tools = adapter.create_all_tools(policy_wallet)
Wallet type comparison
| | EOA | ERC-4337 | Safe | CDP | |--|--|--|--|--| | Wallet address | key address | smart contract | safe contract | CDP managed | | Gas sponsorship | no | yes (Paymaster) | no | no | | Multi-signature | no | no | yes | no | | Requires bundler | no | yes | no | no | | Best for | testing, simple agents | production agents | teams, DAOs | AgentKit |
ERC-4337 specifics
The smart account address is counterfactual — derived from your owner key before the contract is deployed. Fund the smart account address and it auto-deploys on first transaction.
wallet = WalletFactory.from_erc4337(
owner_key=os.environ["OWNER_PRIVATE_KEY"],
bundler_url="https://api.pimlico.io/v2/84532/rpc?apikey=...",
rpc_url="https://sepolia.base.org",
)
wallet.get_address() # smart account address (holds funds)
wallet.get_owner_address() # owner EOA address (signs UserOps)
wallet.is_deployed() # False until first transaction
Get a free bundler URL at pimlico.io or alchemy.com.
Safe specifics
wallet = WalletFactory.from_safe(
safe_address=os.environ["SAFE_ADDRESS"],
signer_key=os.environ["SIGNER_PRIVATE_KEY"],
rpc_url="https://sepolia.base.org",
auto_execute=True, # execute immediately if threshold == 1
)
wallet.get_address() # Safe contract address (holds funds)
wallet.get_owner_address() # signer EOA address
wallet.get_threshold() # number of required signatures
wallet.get_owners() # list of all Safe owner addresses
Deploy a Safe for free at app.safe.global.
Framework Support
AgentARC has adapters for OpenAI SDK and LangChain. Both work identically with any wallet type.
OpenAI SDK
from agentarc import WalletFactory, PolicyWallet
from agentarc.frameworks import OpenAIAdapter
from openai import OpenAI
wallet = WalletFactory.from_private_key(os.environ["PRIVATE_KEY"], os.environ["RPC_URL"])
policy_wallet = PolicyWallet(wallet, config_path="policy.yaml")
adapter = OpenAIAdapter()
tools = adapter.create_all_tools(policy_wallet)
# tools: send_transaction, get_wallet_balance, get_wallet_info, validate_transaction
client = OpenAI()
response = client.chat.completions.create(model="gpt-4o-mini", messages=messages, tools=tools)
tool_results = adapter.process_tool_calls(response, policy_wallet)
LangChain + LangGraph
from agentarc import WalletFactory, PolicyWallet
from agentarc.frameworks import LangChainAdapter
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
wallet = WalletFactory.from_private_key(os.environ["PRIVATE_KEY"], os.environ["RPC_URL"])
policy_wallet = PolicyWallet(wallet, config_path="policy.yaml")
adapter = LangChainAdapter()
tools = adapter.create_all_tools(policy_wallet) # List[StructuredTool]
llm = ChatOpenAI(model="gpt-4o-mini")
agent = create_react_agent(llm, tools=tools)
Security Pipeline
Stage 1: Intent Analysis
Parses transaction calldata to understand what the transaction does — identifies function calls, token transfers, approvals, and parameter values.
Stage 2: Policy Validation
Runs all enabled policy rules against the transaction:
| Policy | What it blocks |
|--------|---------------|
| eth_value_limit | ETH transfers above a max per transaction |
| address_denylist | Transactions to specific blocked addresses |
| address_allowlist | Transactions to any address not on the list |
| per_asset_limit | ERC-20 transfers above a per-token limit |
| token_amount_limit | ERC-20 transfers above a global limit |
| gas_limit | Transactions requesting more than a gas cap |
| function_allowlist | Any function call not on the allowed list |
Stage 3: Transaction Simulation
Simulates the transaction in a Tenderly sandbox before sending. Catches reverts, unexpected asset changes, and gas spikes without spending real gas.
Stage 3.5: Honeypot Detection
When a token BUY is detected, AgentARC automatically simulates a SELL. If the sell fails, the buy is blocked — zero manual blacklisting required.
BUY detected → simulate SELL → SELL fails → HONEYPOT BLOCKED
Stage 4: LLM Security Analysis (optional)
Uses an LLM to detect sophisticated attacks that rule-based checks miss:
- Hidden token approvals
- Reentrancy patterns
- Flash loan exploits
- Phishing contracts
- Hidden fees and fund draining
Cost: ~$0.003 per transaction with gpt-4o-mini.
Policy Configuration
#
Related Skills
node-connect
329.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
329.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.2kCommit, push, and open a PR
