Risk management for AI agents. Wallets, rules, credit scoring, and spend controls.
Install the Kredit SDK for your platform.
# Install the Kredit CLIcurl -sSL https://kredit.sh/install | sh# Verify installationkredit --version
You need an API key to use Kredit. Get one from the dashboard (API Key → Create New Key) or via the CLI login flow.
# Option 1: Login via browser (recommended)# Opens your browser, authenticates via WorkOS, creates an API key,# and saves it to ~/.kredit/config automaticallykredit login# Your key is saved at ~/.kredit/configcat ~/.kredit/config# → api_key=kr_live_962c08a1cb9314d2...# Option 2: Set manually via environment variableexport KREDIT_API_KEY=kr_live_...# All kredit commands will use this key automaticallykredit orgs list
Organizations group agents together. Create an org first, then add agents to it.
# Create an organizationkredit orgs create --name=research-team# List all organizationskredit orgs list
Create agents with wallet limits, priority levels, and spending rules. Agents can be API callers or procurement/spend bots.
# Create agent with org name, priority, wallet, and ruleskredit agents create --org-name=research-team --name=bot-01# List agentskredit agents list --org-id=ORG_ID
Rules define per-action spending limits. Each rule has a match pattern (e.g. openai.*, flight.*, *) and limits for cost per transaction, daily spend, and hourly call rate. Multiple rules can match — most restrictive wins.
# List rules for an agentkredit rules list --agent-id=AGT_ID# Add a rulekredit rules add --agent-id=AGT_ID \--name="OpenAI daily cap" \--match="openai.*" \--max-cost-per-txn=5.00 \--daily-spend-limit=100.00 \--hourly-rate-limit=50# Remove a rulekredit rules remove --agent-id=AGT_ID --rule-id=RULE_ID
Each agent has a wallet with balance, budget, and global limits (max per transaction, daily spend cap). Wallet limits are checked before rules.
# Get wallet balancekredit wallet --agent-id=AGT_ID
Before an agent spends money, call check. After the action, report the outcome. The block_reason tells you exactly which rule was violated.
# Risk check before an actionkredit check --agent-id=AGT_ID --action=flight.booking --estimated-cost=450.00# Response:# {# "transaction_id": "69d1...",# "status": "allowed",# "risk_level": "low",# "wallet_balance": 4550.00,# "credit_score": 742# }
Agents earn a credit score (300-850) based on success rate, cost efficiency, and compliance. Scores update on every reported outcome.
# Get agent credit scorekredit score --agent-id=AGT_ID# Score range: 300-850# 600+ = active, 400-600 = throttled, <400 = frozen
Fleet overview gives you aggregate stats across all agents. Transactions are the audit log of every risk check. Events track agent state changes like score updates, status transitions, and rule modifications.
# Fleet and transaction logs are available in the dashboard# https://kredit.sh/dashboard# Or query via API / SDK
{"id": "69d1...","name": "travel-bot-01","status": "active", // "active" | "throttled" | "frozen""priority": "high", // "normal" | "high" | "critical""wallet": { ... },"rules": [ ... ],"credit": {"score": 742,"task_success_rate": 0.92,"cost_efficiency": 0.88,"violation_count": 3,"total_tasks": 156}}
{"balance": 4500.00, // current balance (dollars)"budget": 5000.00, // total allocated (dollars)"max_per_txn": 1000.00, // global max per transaction, 0 = unlimited"daily_spend_limit": 5000.00 // global max spend per day, 0 = unlimited}
{"id": "rule_a1b2c3","name": "Flight booking limit","match": "flight.*", // fnmatch pattern against action name"max_cost_per_txn": 800.00, // max dollars per call, 0 = unlimited"daily_spend_limit": 3000.00, // max dollars per day, 0 = unlimited"hourly_rate_limit": 10, // max calls per hour, 0 = unlimited"enabled": true}
// "normal" — blocked when limits hit// "high" — auto-increase wallet by 50% when balance < 10% of budget// "critical" — never blocked, always allowed (logs warning)
// 1. Priority override (critical → always allow)// 2. Frozen status check// 3. High priority auto-increase// 4. Global wallet: max_per_txn// 5. Global wallet: daily_spend_limit// 6. Wallet balance// 7. Rules: match action pattern → check limits// 8. Credit score < 400 → block// 9. Anomaly detection (10x avg cost)// 10. Score-based risk escalation
kredit loginAuthenticate via browser, create and save API keykredit logoutRemove saved API keykredit checkRisk check before an actionkredit reportReport outcome after an actionkredit agents listList agents in an orgkredit agents createCreate an agentkredit orgs listList all organizationskredit orgs createCreate an organizationkredit rules listList rules for an agentkredit rules addAdd a spending rulekredit rules removeRemove a rulekredit scoreGet agent credit scorekredit walletGet agent wallet infokredit demoRun 1-hour simulation with sample agents