Skip to content

Safety guardrails: enforce testnet + read-only default#48

Open
Smitacek wants to merge 6 commits intoAnalyticAce:mainfrom
Smitacek:safety-guardrails
Open

Safety guardrails: enforce testnet + read-only default#48
Smitacek wants to merge 6 commits intoAnalyticAce:mainfrom
Smitacek:safety-guardrails

Conversation

@Smitacek
Copy link

This PR adds safety guardrails to the Binance MCP Server:

  • Enforce real testnet routing (spot + futures) when BINANCE_TESTNET=true
  • Read-only mode enabled by default; create_order returns forbidden unless --enable-trading or BINANCE_MCP_READ_ONLY=false
  • CLI switch --read-only/--enable-trading + runtime banner
  • Add python-dotenv to dependencies; add optional dev extras with pytest
  • README Quick Start updated to show read-only default

Validation:

  • uv sync --extra dev
  • uv run pytest -q → 38 passed

Rationale:

  • Prevent accidental live trading; allow explicit opt-in
  • Ensure testnet flag actually changes endpoints

Follow-ups (optional):

  • Consider weight-aware rate limiting for Binance limits
  • Add WebSocket streams as MCP resources
  • Add per-tool gating (e.g., wallet ops)

…LI; add python-dotenv; docs quickstart update; tests pass with uv
…rate limiter with depth cost, optional symbol existence cache; tests added; docs updated
…ook to post-validate consumption, keep decorator presence via security wrapper; add SAPI limiter; tests updated
…rify exchangeInfo rateLimits; maintain conservative default capacities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant