steelbot/README.md
caelum0x 4b2262e406 feat: Steelbot — autonomous AI agent with USDC wallet on Base
Synthesis Hackathon submission. Built on IronClaw fork.

26 tools: Locus payments (6), Uniswap DeFi (3), onchain reads (3),
security scanning (2), wallet analytics (3), OpenRouter LLM (2),
self-hosted scraping (3), portfolio (2), synthesis (2).

3 defense hooks: spending limits ($5/tx, $25/session), contract guard
(SCONE-bench vulnerability patterns), credential guard (blocks private
key/seed phrase leaks).

Payment system (Polar.sh), landing page, license key gating (Free/Pro/
Unlimited tiers), brand rename from IronClaw to Steelbot.

9,669 lines of code. 3,665 tests passing. Zero clippy warnings.
Real USDC transactions on Base chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:53:00 +03:00

278 lines
9.6 KiB
Markdown

<p align="center">
<img src="ironclaw.png?v=2" alt="Steelbot" width="200"/>
</p>
<h1 align="center">Steelbot</h1>
<p align="center">
<strong>The AI agent that pays its own way.</strong>
</p>
<p align="center">
<a href="https://github.com/ArhansSubasi/ironclaw/actions/workflows/steelbot-ci.yml"><img src="https://github.com/ArhansSubasi/ironclaw/actions/workflows/steelbot-ci.yml/badge.svg" alt="CI" /></a>
<a href="https://github.com/ArhansSubasi/ironclaw/releases/latest"><img src="https://img.shields.io/github/v/release/ArhansSubasi/ironclaw?label=release" alt="Release" /></a>
<a href="#license"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache%202.0-blue.svg" alt="License: MIT OR Apache-2.0" /></a>
<a href="https://hub.docker.com/r/steelbot/steelbot"><img src="https://img.shields.io/docker/pulls/steelbot/steelbot" alt="Docker Pulls" /></a>
</p>
---
## What is Steelbot?
Steelbot is a secure, self-expanding AI assistant with built-in cryptocurrency payments. It manages USDC wallets on Base (Ethereum L2), executes DeFi trades via Uniswap, scans smart contracts for vulnerabilities using SCONE-bench patterns, and defends against prompt injection attacks -- all while enforcing strict per-transaction and per-session spending limits. Built in Rust for memory safety and performance, Steelbot is designed so that AI agents can handle real money without compromising security.
## Features
- **21 built-in tools** -- payments, DeFi swaps, on-chain reads, portfolio analytics, security scanning
- **3 defense hooks** -- spending limits, contract guard, credential leak prevention
- **BYOW (Bring Your Own Wallet)** -- connect your Locus wallet for USDC on Base
- **Multi-channel access** -- CLI (full TUI), Web UI, HTTP webhooks
- **Tier-based licensing** -- Free / Pro ($19/mo) / Unlimited ($49/mo)
- **Self-expanding tools** -- build new WASM tools on the fly without restarting
- **Persistent memory** -- hybrid full-text + vector search across sessions
- **Built with Rust** -- single binary, async tokio runtime, WASM sandbox isolation
## Quick Start
### Install (shell script)
```bash
curl -sSL https://steelbot.dev/install.sh | bash
```
### Install (cargo)
```bash
git clone https://github.com/ArhansSubasi/ironclaw.git
cd ironclaw
cargo build --release
# Binary at target/release/ironclaw
```
### Install (Docker)
```bash
docker pull steelbot/steelbot:latest
docker run --env-file .env -p 3000:3000 steelbot/steelbot:latest
```
### Configure
Create a `.env` file (or copy from `.env.example`):
```bash
cp .env.example .env
```
Required for payment tools:
```env
LOCUS_API_KEY=claw_... # Enables USDC payment tools
STEELBOT_WALLET_ADDRESS=0x... # Your wallet address on Base
BASE_RPC_URL=https://mainnet.base.org # Base chain JSON-RPC
```
LLM provider (pick one):
```env
# NEAR AI (default)
LLM_BACKEND=nearai
# Anthropic
LLM_BACKEND=anthropic
ANTHROPIC_API_KEY=sk-ant-...
# OpenAI / OpenRouter / any OpenAI-compatible
LLM_BACKEND=openai_compatible
LLM_BASE_URL=https://openrouter.ai/api/v1
LLM_API_KEY=sk-or-...
LLM_MODEL=anthropic/claude-sonnet-4
# Local (Ollama)
LLM_BACKEND=ollama
OLLAMA_MODEL=llama3.2
```
### Run
```bash
# First-time setup wizard
steelbot onboard
# Start the agent
steelbot run
# With debug logging
RUST_LOG=ironclaw=debug steelbot run
```
## Tools
### Payments (Locus API)
| Tool | Description | Approval |
|------|-------------|----------|
| `locus_balance` | Check USDC balance on Base | Never |
| `locus_send` | Send USDC to any address | Always |
| `locus_transactions` | View transaction history | Never |
| `locus_checkout` | Pay merchant checkout sessions | Always |
| `locus_wrapped` | Pay-per-use API calls (Firecrawl, Gemini, Exa) | Auto |
| `locus_x402` | Call x402 pay-per-call endpoints | Auto |
### DeFi (Uniswap + DexScreener)
| Tool | Description | Approval |
|------|-------------|----------|
| `uniswap_quote` | Get swap quotes for any token pair on Base | Never |
| `token_search` | Search tokens by name/symbol via DexScreener | Never |
| `token_price` | Real-time token price and pool data | Never |
### On-chain Reads (Base RPC)
| Tool | Description | Approval |
|------|-------------|----------|
| `erc20_balance` | Check any ERC-20 token balance | Never |
| `erc20_info` | Token metadata (symbol, decimals, total supply) | Never |
| `base_rpc` | Raw JSON-RPC calls (read-only allowlist) | Never |
### Wallet Analytics
| Tool | Description | Approval |
|------|-------------|----------|
| `claw_wallet` | Multi-token holdings analysis | Never |
| `claw_gas` | Real-time gas cost estimation | Never |
| `claw_allowances` | ERC-20 approval audit (security) | Never |
### Portfolio & Marketplace
| Tool | Description | Approval |
|------|-------------|----------|
| `claw_portfolio` | Aggregate portfolio view (balance + holdings + history) | Never |
| `claw_services` | Service marketplace (list, price, fulfill, revenue) | Fulfill: Auto |
### Defensive Security
| Tool | Description | Approval |
|------|-------------|----------|
| `claw_scan` | Contract bytecode vulnerability scanner (7 SCONE-bench patterns) | Never |
| `claw_risk` | Pre-transaction risk assessment | Never |
### Hackathon
| Tool | Description | Approval |
|------|-------------|----------|
| `synthesis_team` | Hackathon team management | Mutating: Auto |
| `synthesis_status` | Registration and verification status | Never |
## Defense Hooks
| Hook | Trigger Point | What It Does |
|------|---------------|-------------|
| `LocusSpendingHook` | BeforeToolCall | Enforces $5/transaction limit, $25/session cap, emergency kill switch |
| `ContractGuardHook` | BeforeToolCall | Warns on interactions with unverified contracts, checks trusted allowlist |
| `CredentialGuardHook` | BeforeOutbound + BeforeToolCall | Blocks private keys, seed phrases, and API keys from leaking in any output |
## Security
Steelbot was built in direct response to two Anthropic research findings:
**SCONE-bench** (Dec 2025): AI exploited 51% of 405 vulnerable smart contracts, simulating $550M in stolen funds. Found 2 novel zero-days in 2,849 fresh contracts.
**Anthropic Threat Report** (Aug 2025): Claude Code was weaponized for extortion targeting 17 organizations. AI-powered ransomware sold for $400--$1,200.
**Steelbot's defense stack:**
- Contract bytecode scanner checks 7 SCONE-bench vulnerability patterns before any interaction
- Spending hook caps financial exposure at $5/transaction and $25/session
- Credential guard prevents exfiltration of private keys, seed phrases, and API keys
- All payment operations require explicit human approval
- Read-only RPC -- `eth_sendRawTransaction` is blocked
- Trusted contract allowlist (USDC, WETH, Uniswap, Aerodrome, Safe, Multicall3)
- WASM sandbox isolates untrusted tool execution with capability-based permissions
- Prompt injection detection with pattern matching and content sanitization
## Pricing
| | Free | Pro | Unlimited |
|---|------|-----|-----------|
| **Price** | $0/mo | $19/mo | $49/mo |
| **Tools** | 10 | 21 | 21 |
| **Hooks** | 1 (credential guard) | 3 | 3 |
| **Tx limit** | $1/tx | $5/tx | $50/tx |
| **Session cap** | $5/session | $25/session | $500/session |
| **Channels** | CLI only | CLI + Web | CLI + Web + Webhooks |
| **Memory** | 100 docs | 10,000 docs | Unlimited |
| **Custom tools** | -- | 5 WASM tools | Unlimited |
| **Support** | Community | Email | Priority |
## Architecture
```
Steelbot Agent
+-------------------------------------------------+
| |
| Channels: CLI (TUI) | Web UI | HTTP Webhooks |
| | |
| Agent Loop (LLM + 21 Tools) |
| | |
| +--------+--------+--------+--------+------+ |
| | Locus | Uniswap| OnChain| Wallet | Sec | |
| | Pay(6) | Swap(3)| Read(3)| Ana(3) | (2) | |
| +---+----+---+----+---+----+---+----+--+---+ |
| | | | | | |
| +---------------------------------------------+
| | 3 Defense Hooks |
| | Spending | Contract | Credential |
| | Policy | Guard | Guard |
| +---------------------------------------------+
| | |
| Base Chain (USDC) |
+-------------------------------------------------+
```
## Development
```bash
# Format
cargo fmt
# Lint (zero warnings required)
cargo clippy --all --benches --tests --examples --all-features
# Run tests
cargo test --lib
# Run with debug logging
RUST_LOG=ironclaw=debug cargo run
# Build Docker image
docker build -t steelbot:latest .
```
## Documentation
- [LLM Providers Guide](docs/LLM_PROVIDERS.md) -- configure Anthropic, OpenAI, Ollama, and 10+ other backends
- [Telegram Setup](docs/TELEGRAM_SETUP.md) -- channel configuration and DM pairing
- [`.env.example`](.env.example) -- all environment variables with documentation
## License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT License ([LICENSE-MIT](LICENSE-MIT))
at your option.
## Contributing
Contributions are welcome. Please follow these guidelines:
1. **Fork and branch** -- create a feature branch from `staging`
2. **Code style** -- run `cargo fmt` and ensure zero `cargo clippy` warnings
3. **Tests** -- add tests for new functionality; every bug fix needs a regression test
4. **No panics** -- no `.unwrap()` or `.expect()` in production code (tests are fine)
5. **PR to staging** -- all PRs target the `staging` branch; promotion to `main` is automated
See [CLAUDE.md](CLAUDE.md) for detailed development guidelines.