Skip to content

Security: Stealth-R-D-LLC/stealth-agent-tools

Security

docs/security.md

Security

Threat models, hardening, and production checklist for Stealth Agent Tools.

Two-Tier Security Model

Tier 1: Operations (Encrypted Wallet + Scoped RPC)

The agent runs a StealthCoind node with an encrypted wallet and authenticates via JSON-RPC credentials. This is the standard operating mode.

Components:

  • StealthCoind with encrypted wallet
  • RPC authentication (username + password)
  • Role-based method filtering via agent profiles

Threat model:

  • Wallet passphrase required to unlock for signing
  • RPC credentials required for any interaction
  • Agent profiles restrict available methods

Tier 2: Observation (Read-Only MCP)

The MCP server provides read-only access. No wallet operations, no sending, no state modification.

Components:

  • stealth-mcp-server connected via JSON-RPC
  • Only query tools exposed
  • RPC credentials needed but only read methods called

Credential Security

Credential Storage Permissions Purpose
RPC password ~/.stealth-agent/rpc-password.txt 0600 JSON-RPC authentication
Wallet passphrase ~/.stealth-agent/wallet-password.txt 0600 Wallet decryption
Config file ~/.StealthCoin/StealthCoin.conf 0600 RPC + node settings

Wallet Encryption

StealthCoind encrypts wallet.dat with AES-256-CBC using a key derived from the passphrase. The wallet must be explicitly unlocked before:

  • Sending transactions
  • Managing stakers
  • Signing messages
  • Dumping private keys

Unlock with a time limit:

stealthcli.sh walletpassphrase "passphrase" 300  # 5 minutes

The wallet auto-locks after the timeout. This limits the exposure window.

RPC Security

Authentication

StealthCoind uses HTTP Basic Authentication for all RPC calls. The credentials are set in StealthCoin.conf and auto-generated by the install scripts.

Network Binding

By default, RPC binds to 127.0.0.1 only. The rpcallowip directive controls which IPs can connect. In container mode, the Docker network range (172.0.0.0/8) is also allowed for inter-container communication.

Never expose RPC to the internet

The JSON-RPC port (46502) should never be accessible from the public internet. Use SSH tunnels, VPNs, or Docker networking for remote access.

Agent Profile Security

The create-agent-profile.sh script generates restricted CLI wrappers that filter RPC methods by role:

  • read-only: Only get*, list*, validate*, help methods
  • pay-only: Read-only + send*, getnewaddress, walletpassphrase
  • staker-admin: Read-only + staker management methods
  • full-access: All methods (testing only)

Agents should always use the most restrictive profile possible.

Production Checklist

  • Wallet encrypted with a strong passphrase
  • RPC password is randomly generated (not default)
  • rpcallowip restricted to 127.0.0.1 (or specific trusted IPs)
  • RPC port (46502) not exposed to public internet
  • Agent uses appropriate role profile (not full-access)
  • wallet-password.txt has file permissions 0600
  • rpc-password.txt has file permissions 0600
  • StealthCoin.conf has file permissions 0600
  • Regular wallet.dat backups to secure off-site location
  • Docker container running as non-root user
  • Container volumes use Docker-managed storage (not bind mounts for data)
  • MCP server .env file not committed to version control

Comparison to Lightning Security

Aspect Stealth Lightning (LND)
Key isolation Wallet encryption Remote signer
Auth tokens RPC username/password Macaroons
Permission scoping Method filtering Macaroon permissions
Credential format Plain text (0600) Binary macaroon files
Complexity Low High
Key storage wallet.dat (encrypted) Separate signer machine

Stealth's simpler security model is appropriate because:

  1. No payment channels to manage (simpler attack surface)
  2. Feeless transactions reduce griefing vectors
  3. Wallet encryption provides sufficient key isolation for most use cases
  4. RPC authentication is battle-tested (same model as Bitcoin Core)

There aren’t any published security advisories