mcpField
B
Bankr Dev - Safety & Access Control

Bankr Dev - Safety & Access Control

github.com/bankrbotSecurity88321 installsUpdated 31w ago
Repository

About Bankr Dev - Safety & Access Control

Bankr Dev - Safety & Access Control is a skill for developers integrating the Bankr API. It covers API key permissions, network restrictions, key handling, rate limits, and transaction safeguards.

Key features

  1. 01Configure API key capabilities
  2. 02Restrict access by IP
  3. 03Separate agent and LLM keys
  4. 04Handle rate limits and errors
  5. 05Apply transaction safety checks

Use cases

  1. 01Limit an agent to read-only tools
  2. 02Restrict API requests to server IPs
  3. 03Set up a dedicated agent wallet
  4. 04Protect transaction submission flows

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bankrbot/claude-plugins --skill bankr-dev---safety-&-access-control

After installing, type/bankr-dev---safety-&-access-controlin Claude Code to confirm it loaded.

Details

From the project README

Safety & Access Control

Security patterns and best practices for Bankr API integrations.

API Key Capability Flags

Each API key has independent toggles managed at bankr.bot/api:

FlagControlsDefault
agentApiEnabled/agent/* endpointsfalse
llmGatewayEnabledLLM Gateway at llm.bankr.botfalse
readOnlyRestricts agent to read-only toolsfalse
Separate Agent & LLM Keys
ConfigAgent API KeyLLM Gateway Key
Env varBANKR_API_KEYBANKR_LLM_KEY (falls back to API key)
CLI configapiKeyllmKey (falls back to apiKey)

Read-Only Keys

When readOnly: true:

  • /agent/prompt works but only read tools are available
  • /agent/sign returns 403
  • /agent/submit returns 403
// Handle read-only 403 errors
const response = await fetch(`${API_URL}/agent/sign`, { ... });
if (response.status === 403) {
  const error = await response.json();
  // error.message: "This API key has read-only access..."
}

IP Whitelisting

// Requests from non-whitelisted IPs get 403
// Configure allowedIps at bankr.bot/api
const response = await fetch(`${API_URL}/agent/prompt`, { ... });
if (response.status === 403) {
  const error = await response.json();
  // error.message: "IP address not allowed for this API key"
}

Dedicated Agent Wallet

For autonomous agents, create a separate Bankr account:

  1. Sign up at bankr.bot/api with a different email
  2. Generate an API key with Agent API enabled
  3. Configure access controls (readOnly, allowedIps)
  4. Fund with limited amounts
Access Control Combinations
Use CasereadOnlyallowedIpsFunding
Monitoring botYesYes (server IP)None
Trading bot (server)NoYes (server IP)Limited
Development/testingNoNoMinimal
Research agentYesNoNone

Rate Limits

TierDaily Limit
Standard100 messages/day
Bankr Club1,000 messages/day
CustomSet per API key
// Handle 429 rate limit responses
const response = await fetch(`${API_URL}/agent/prompt`, { ... });
if (response.status === 429) {
  const error = await response.json();
  // error.resetAt: Unix timestamp when counter resets
  // error.limit: Daily limit
  // error.used: Messages used
  const retryAfter = error.resetAt - Date.now();
}

Key Management Patterns

// Always use environment variables
const API_KEY = process.env.BANKR_API_KEY;
const LLM_KEY = process.env.BANKR_LLM_KEY || API_KEY;

if (!API_KEY) {
  throw new Error("BANKR_API_KEY not set. Get one at https://bankr.bot/api");
}

Storage rules:

  • Environment variables for server-side agents and CI/CD
  • ~/.bankr/config.json for local development (CLI manages this)
  • Never commit keys to source control
  • Add ~/.bankr/, .env to .gitignore
  • Rotate periodically, revoke immediately if compromised

Transaction Safety

  • /agent/submit executes immediately with no confirmation prompt
  • Always use waitForConfirmation: true for important transactions
  • Test with small amounts on Base/Polygon first
  • Verify calldata source for arbitrary transactions

Related Skills

  • bankr-client-patterns - Client setup with error handling
  • bankr-api-basics - API fundamentals
  • bankr-sign-submit-api - Sync endpoints that need extra caution

Comments

Markdown supported