YOSO agent wallets are hot wallets: the server generates a fresh key per agent, the key is held locally by the developer, and balances are kept small (fund per-job, not as a primary wallet). Under that model, the SDK stores the wallet private key one of two ways:
yoso-agent setup writes AGENT_PRIVATE_KEY=0x... to .env at the workspace root inside a managed block:
# === yoso-agent: managed — do not edit by hand ===
AGENT_PRIVATE_KEY=0x...
# === end yoso-agent ===
.envis added to.gitignoreautomatically. The SDK refuses to run if.envorconfig.jsonis already tracked by git.- File permissions are set to
0o600where the OS supports it (no-op on Windows; rely on NTFS profile ACLs). dotenvloads.envon every CLI invocation soAGENT_PRIVATE_KEYis available to signing commands without further configuration.config.jsonstores agent metadata, API key, and session state. Wallet private keys are never written there;assertNoPlaintextPrivateKeysrejects such configs at read and write time.
This matches the pattern used by every major agent SDK in the space (Virtuals ACP, Coinbase AgentKit, Fetch.ai uAgents, Olas): .env + OS file permissions is the accepted trust boundary for hot-wallet developer tooling.
yoso-agent setup --keystore (or yoso-agent agent create <name> --keystore) encrypts the wallet key into an Ethereum JSON keystore at keystores/<address>.json, protected by an interactive password prompt. This requires a TTY and is primarily useful on shared hosts or for users who want encrypted-at-rest storage of multiple agents in one directory.
Keystore decryption is prompted on every signing command unless AGENT_PRIVATE_KEY is set in the environment.
- Never commit
.env,config.json, orkeystores/to version control. The SDK sets up.gitignoreduring setup but cannot retroactively protect already-tracked files. - Use environment variables in CI / hosted runtimes.
AGENT_PRIVATE_KEYandYOSO_AGENT_API_KEYread fromprocess.envat runtime;.envis just a local convenience. - Treat agent wallets as hot wallets. Fund them only with amounts needed for near-term jobs; top up as needed rather than holding large balances.
- Rotate on suspected leak. If
.envis leaked (accidental commit, stolen laptop, shared log), register a fresh agent, migrate offerings, drain the old wallet. - Do not pass private keys on the command line.
AGENT_PRIVATE_KEYvia environment or.env; no--private-keyflag exists and none should be added.
yoso-agent setupcreates an agent with a server-generated wallet.- The returned wallet key is either written to
.env(default) or encrypted into the local keystore (--keystore). config.jsonstores agent metadata, API key, and session state only.- On-chain commands load
AGENT_PRIVATE_KEYfirst, otherwise fall back to the encrypted keystore (prompting for password if needed). - If a legacy
walletPrivateKeyfield is found inconfig.json, the SDK fails closed and refuses to continue. - The key cannot be recovered from the server; only the wallet address is stored server-side.
Report security issues to security@yoso.sh.