Security¶
BNB Agent Studio is designed around five commitments. The security model follows from architectural boundaries, not optional settings.
Core commitments¶
- Agent project code is user-owned — recipe-emitted files are yours; studio never silently rewrites them.
- Private keys live only in user-controlled environments — the keystore never leaves your Agent via public channels; the keyless Service never holds it.
- MCP is read-only — no signing, no on-chain state change (exception: domain-locked SIWE
personal_sign, never persisted). - The SDK protocol layer stays pure — studio opinions never pollute
bnbagent-sdk. - You can jump ship — emitted code is yours to fork; no closed-source SaaS or OAuth lock-in.
Keystore posture¶
| Location | Who reads it | Deploy path |
|---|---|---|
Workspace root .studio/wallets/ |
Layer A Agent only | Injected via AWS Secrets Manager (WALLET_KEYSTORE_JSON) |
app/service/ |
Never | Service zip excludes all .env* and keystore paths |
The keystore sits outside app/agent/ (the AgentCore codeLocation) so no packaging path — including raw agentcore deploy — can bundle it into an artifact.
WALLET_PASSWORD lives in environment variables only (.env.local for local dev, Secrets Manager injection for deploy). It is never written to studio.toml.
Signing boundary¶
All on-chain signing is fixed entrypoint code in app/agent/signing.py — never an LLM-callable tool. The Agent:
- Receives action envelopes (
quote/fulfill/settle) from the keyless Service - Clamps prices to
[min_price, max_price]instudio.tomlbefore signing - Re-validates chain state before every submission
The keyless Service can only request signatures via InvokeAgentRuntime; it cannot sign directly.
SigningPolicy (EIP-712)¶
EVMWalletProvider.sign_typed_data is policy-gated by default:
- Allowed by default: EIP-3009
TransferWithAuthorization/ReceiveWithAuthorizationagainst network-default deployments - Denied by default: ERC-2612
Permit, Permit2PermitSingle/PermitBatch— even if your code mistakenly allowlists them
Extend signing for new contracts or primary types via app/agent/studio.toml:
[wallet.signing]
extra_domains = [...]
extra_primary_types = [...]
Also configure [payments.x402].allowed_hosts before the x402 buyer fetches from new servers. Both gates require editing toml + restart.
Diagnose policy issues:
bag wallet policy show
MCP read-only guarantee¶
The MCP server (bag mcp serve) exposes 15 tools — all read-only:
- Wallet address and balances (no transfer)
- Network, block, and transaction queries
- ERC-8004 and ERC-8183 job reads
- Pieverse usage visibility
WALLET_PASSWORD is used only to resolve the keystore address for balance queries — the MCP server never signs.
Budget and auto-topup¶
bag budget enable opts into wallet-funded LLM credit renewal via x402 — it lets the Agent
auto-pay $U from your wallet when credits run low. It is off by default: a non-interactive
bag init records no [budget] section, so wallet-funded renewal stays off until you enable it
explicitly. Note that an interactive bag init does ask (Enable auto-topup? [Y/n]) and treats a
bare Enter as yes — run bag budget show if you are unsure which path you took. This is separate
from the managed-model auto-renew hook ([llm.auto_renew], on by default), which never spends from
your wallet — it only reallocates credit already sitting in your Pieverse Account Balance. Requires:
- Funded BSC mainnet U balance for auto-renew flows (Pieverse settles on mainnet only — testnet U cannot pay for LLM credits)
WALLET_PASSWORDinjected at Agent runtime deploy time
Without runtime password injection, the Agent falls back to allocate-only mode — no wallet spend, no error. Disable with bag budget disable.
Audit log¶
On-chain actions are recorded in a local audit log (bag audit ls). Sensitive values (passwords, private keys) are never logged.
AWS deploy responsibility¶
Deploying provisions resources in your AWS account. Published IAM reference policies are provided AS IS — you remain responsible for scoping, costs, and security. See DISCLAIMER.md.
Recommendations¶
- Start on BSC testnet until you understand the signing and deploy flow
- Run
bag doctorbefore every deploy - Use
--secrets-mode secretsmanager(default) on any network with real funds - Keep the Service zip free of Agent secrets —
bag deploy packageenforces this - Review
[wallet.signing]before extending beyond default EIP-3009 allowlist