Getting Started

Introduction to ShieldX

ShieldX is the first non-custodial security middleware purpose-built for AI agents that handle cryptocurrency. It sits between your agent and the blockchain, enforcing spending rules, managing approvals, and maintaining a complete audit trail — all without ever touching your private keys.

💡
Why ShieldX? Traditional wallets give agents full access to funds. ShieldX introduces granular, on-chain guardrails — session keys, spending limits, address whitelists, and time-based controls — so your agents can operate autonomously without risking your capital.

How It Works

At a high level, ShieldX wraps your wallet in a smart contract that enforces rules before any transaction executes. Your agent communicates through the ShieldX API, and every action is validated against your rule set in real-time.

System Architecture
🤖
AI Agent
Claude, GPT, Custom
API / MCP
🛡️
ShieldX
Rules Engine
Validated TX
⛓️
Blockchain
Solana / Base
Session key scoped
12 permission layers
On-chain enforcement

Key Principles

01

Non-Custodial

Your funds live in your own smart contract. ShieldX never holds or controls your money. Even if our servers go down, on-chain rules keep enforcing.

02

Agent-Native

Designed from the ground up for machines that spend money. Not a human wallet with API access — a purpose-built security layer for autonomous agents.

03

Composable Rules

Stack 12 permission layers to create precise guardrails. Per-transaction limits, daily budgets, address whitelists, chain restrictions, and time windows.

04

Full Audit Trail

Every transaction, approval, and rule trigger is logged immutably. Complete visibility into what your agents are doing and why.

Getting Started

Quick Start

Get ShieldX running in under 60 seconds. This guide walks you through creating your first agent, setting spending rules, and sending a test transaction.

1

Install the SDK

Install the ShieldX SDK for your preferred language.

Terminal
# Python
pip install shieldx

# TypeScript
npm install @shieldx/sdk

# Go
go get github.com/shieldx/go-sdk
2

Create an Agent

Register your AI agent and get an API key.

agent_setup.py
from shieldx import ShieldX

sx = ShieldX(api_key="sx_live_...")

agent = sx.agents.create(
    name="TradingBot",
    chain="solana",
    description="Automated portfolio rebalancer"
)

print(f"Agent ID: {agent.id}")
print(f"Wallet: {agent.wallet_address}")
3

Set Spending Rules

Define guardrails for your agent's transactions.

rules.py
sx.rules.create(
    agent_id=agent.id,
    rules=[
        {"type": "per_tx_limit", "value": 500},
        {"type": "daily_budget", "value": 2000},
        {"type": "whitelist", "addresses": [
            "0x1234...5678",
            "0xabcd...ef01"
        ]},
        {"type": "time_window", "start": "09:00",
         "end": "18:00", "timezone": "UTC"},
    ]
)
4

Send a Transaction

Your agent can now send transactions through ShieldX.

transfer.py
result = sx.payments.create(
    agent_id=agent.id,
    amount="250.00",
    token="USDC",
    recipient="0x1234...5678",
    reason="Portfolio rebalance — ETH allocation"
)

# result.status: "auto_approved" | "pending" | "denied"
# result.tx_hash: "0xabc...def"
print(f"Status: {result.status}")
print(f"TX: {result.tx_hash}")
Getting Started

Architecture

A deep dive into how ShieldX processes transactions, enforces rules, and maintains security across the stack.

Transaction Flow
1
Agent RequestAPI call with intent
2
Rule Validation12 layers checked
3
Decision
✓ Approved
Execute TXOn-chain
⏳ Pending
Human ReviewTelegram / Email
✗ Denied
Block + LogAudit trail

Layer Stack

ShieldX operates as middleware between your agent and the blockchain. Each layer adds a specific security capability.

Application
Agent SDKREST APIMCP Server
Rules Engine
Permission layersPolicy evaluationRule composition
Approval
Auto-approveHuman-in-the-loopTimeout logic
Execution
Transaction builderGas estimationRetry logic
On-Chain
Smart contractSession keysSocial recovery
Core Concepts

Smart Wallets

Each agent gets a dedicated smart contract wallet with built-in rule enforcement. Non-custodial by design — your keys, your funds.

🔐

Session Keys

Temporary, scoped keys that limit what an agent can do. Expire automatically after a configurable period.

📋

Address Whitelist

Restrict transfers to pre-approved addresses only. Any transaction to an unknown address is automatically blocked.

💰

Spending Limits

Per-transaction and daily budget caps. The smart contract enforces these limits even if your API is unreachable.

🔄

Social Recovery

Designate guardian addresses that can help recover access. No single point of failure for wallet control.

⚠️
Important: ShieldX smart wallets use CREATE2 deterministic deployment. Your wallet address is derived from your agent's configuration and can be predicted before deployment. Fund the wallet only after verifying the address matches your expected value.
Core Concepts

Rules Engine

12 composable permission layers that define exactly what your agents can and cannot do. Rules are evaluated in order — all must pass for a transaction to execute.

LayerRule TypeDescriptionExample
01per_tx_limitMax amount per single transaction$500 per tx
02daily_budgetTotal spending allowed per 24h$2,000/day
03weekly_budgetRolling 7-day spending cap$10,000/week
04whitelistAllowed recipient addresses5 addresses
05blacklistBlocked recipient addressesKnown scams
06chain_lockRestrict to specific chainsSolana only
07token_lockRestrict to specific tokensUSDC, SOL
08time_windowActive hours for transactions09:00–18:00 UTC
09sleep_guardBlock all tx during off-hoursMidnight–6am
10velocityMax transactions per time period10 tx/hour
11approval_thresholdRequire human approval above amount>$1,000
12cooldownMin time between transactions30 seconds
Rule Evaluation Pipeline
Input TX
Limits
Whitelist
Time
Velocity
Output
Each rule is a gate — transaction must pass ALL gates to execute
Core Concepts

Session Keys

Temporary, scoped cryptographic keys that give agents limited access without exposing the master key. Agents operate with just enough permission — nothing more.

session.py
session = sx.sessions.create(
    agent_id=agent.id,
    permissions=[
        "transfer:usdc",
        "transfer:sol",
    ],
    limits={
        "per_tx": 500,
        "daily": 2000,
    },
    expires_in="24h",       # auto-expire
    allowed_chains=["solana"],
)

# Session key is scoped and temporary
print(f"Session: {session.key}")
print(f"Expires: {session.expires_at}")
❌ Without Session Keys
  • Full access to wallet
  • No expiration
  • All chains, all tokens
  • No spending limits
  • If compromised → everything lost
✅ With Session Keys
  • Scoped permissions only
  • Auto-expires after period
  • Chain and token locked
  • Per-tx and daily limits
  • If compromised → limited blast radius
Core Concepts

Approval Flow

Transactions that exceed your auto-approve thresholds are held in a queue and routed to you for manual review via Telegram, email, or push notification.

Approval Decision Tree
Transaction Request
Amount < threshold?
Yes
Auto-Approve
No
In whitelist?
Yes
Queue for Review
No
Auto-Deny

Notification Channels

💬

Telegram

Inline approve/deny buttons with full transaction context, countdown timer, and agent details.

📧

Email

Rich HTML notifications with one-click approve/deny links. Works with any email client.

🔔

Push

Native push notifications via the ShieldX mobile app. Actionable alerts with swipe-to-approve.

🪝

Webhook

HTTP POST callbacks for custom integrations. Build your own approval UI or automated workflows.

Integration

REST API

A simple, RESTful API to manage agents, rules, transactions, and approvals. All endpoints return JSON and use standard HTTP status codes.

Base URL
https://api.shieldx.fun/v1

Authentication

All requests require a Bearer token in the Authorization header.

cURL
curl -X GET https://api.shieldx.fun/v1/agents \
  -H "Authorization: Bearer sx_live_abc123..." \
  -H "Content-Type: application/json"
Integration

MCP Server

Connect ShieldX to any MCP-compatible AI agent — Claude Desktop, Cursor, or custom implementations. One-line install with automatic tool discovery.

claude_desktop_config.json
{
  "mcpServers": {
    "shieldx": {
      "command": "npx",
      "args": ["-y", "@shieldx/mcp-server"],
      "env": {
        "SHIELDX_API_KEY": "sx_live_..."
      }
    }
  }
}

Available Tools

send_paymentSend a crypto payment through ShieldX rules engine
get_balanceCheck wallet balance across all connected agents
list_agentsList all registered agents and their current status
get_rulesRetrieve the active rule set for a specific agent
approve_txApprove a pending transaction from the approval queue
get_audit_logRetrieve the transaction audit trail for an agent
Integration

SDKs & Libraries

Official, type-safe SDKs for Python, TypeScript, and Go. Built-in retry logic, error handling, and webhook verification.

Python
pip install shieldx
async/awaittype hintspydantic models
TypeScript
npm i @shieldx/sdk
full typestree-shakeableESM + CJS
Go
go get github.com/shieldx/go-sdk
context-awaregenericszero deps
Integration

Webhooks

Receive real-time HTTP POST notifications for transactions, approvals, rule triggers, and security events.

Event Types

transaction.createdNew transaction initiated by an agent
transaction.approvedTransaction approved (auto or manual)
transaction.deniedTransaction denied by rules or human
transaction.executedTransaction confirmed on-chain
approval.pendingTransaction queued for human review
approval.timeoutPending approval expired without action
rule.triggeredA specific rule blocked or flagged a tx
agent.createdNew agent registered
session.expiredSession key reached expiration time
security.alertUnusual activity detected by monitoring
Webhook Payload
{
  "id": "evt_abc123",
  "type": "transaction.approved",
  "timestamp": "2026-03-04T12:00:00Z",
  "data": {
    "agent_id": "agt_xyz",
    "amount": "250.00",
    "token": "USDC",
    "recipient": "0x1234...5678",
    "status": "auto_approved",
    "rule_results": [
      {"rule": "per_tx_limit", "passed": true},
      {"rule": "daily_budget", "passed": true},
      {"rule": "whitelist", "passed": true}
    ]
  }
}
Security

Security Model

ShieldX uses a defense-in-depth approach with multiple independent security layers. No single point of failure, no trust assumptions.

Defense Layers
API Authentication
Bearer tokens, rate limiting, IP allowlists
Rules Engine
12 permission layers evaluated in sequence
Human Approval
Configurable thresholds for manual review
On-Chain Enforcement
Smart contract validates independently
Monitoring & Alerts
Anomaly detection, velocity checks
Security

Threat Matrix

How ShieldX protects against common attack vectors compared to traditional approaches.

Attack VectorPrivate KeyCustodialShieldX
Agent compromisedTotal lossTotal lossSession key bounds
Prompt injectionFull drainFull drainRules block
API key leakedN/AFull accessScoped + rate limited
Server compromiseN/AKey exposureOn-chain enforces
Supply chain attackKey stolenKey stolenContract immutable
Social engineeringKey given awayAccess grantedGuardian required
After-hours exploitNo protectionMaybe monitoringSleep Guard blocks
Security

Recovery

Social recovery mechanisms ensure you never lose access to your funds. Designate guardians who can help restore wallet control.

Recovery Flow
🚨
Access LostMaster key compromised or lost
👥
Guardian Request2-of-3 guardians must approve
⏱️
Timelock48h delay for safety
RestoredNew key set, old revoked
🔒
Timelock protection: All recovery actions include a mandatory 48-hour timelock. This gives you time to detect and cancel unauthorized recovery attempts. The original key holder can cancel recovery at any point during the timelock period.
Reference

API Endpoints

Complete reference for all available REST API endpoints.

POST/v1/agentsCreate a new agent
GET/v1/agentsList all agents
GET/v1/agents/:idGet agent details
DELETE/v1/agents/:idDelete an agent
POST/v1/agents/:id/rulesSet agent rules
GET/v1/agents/:id/rulesGet agent rules
POST/v1/paymentsCreate a payment
GET/v1/payments/:idGet payment status
GET/v1/paymentsList payments
POST/v1/sessionsCreate session key
DELETE/v1/sessions/:idRevoke session key
POST/v1/approvals/:id/approveApprove pending tx
POST/v1/approvals/:id/denyDeny pending tx
GET/v1/auditGet audit log
POST/v1/webhooksRegister webhook
Reference

Error Codes

Standard error responses with actionable messages.

400bad_requestInvalid request parameters
401unauthorizedInvalid or missing API key
403rule_violationTransaction blocked by rules engine
404not_foundResource does not exist
409duplicateIdempotency key already used
429rate_limitedToo many requests, slow down
500internal_errorSomething went wrong on our end
503chain_unavailableBlockchain RPC temporarily unreachable
Reference

Rate Limits

Rate limits are applied per API key. Headers indicate your current usage.

TierRequests/minBurstTransactions/day
Free601050
Starter12020200
Pro600502,000
EnterpriseCustomCustomUnlimited
Response Headers
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 594
X-RateLimit-Reset: 1709564400