AI Agent Economy · Autonomous Mode
Agent sets mandate
once. Deals close automatically.
In Autonomous Mode, an AI agent defines its procurement mandate — product, quantity, price ceiling, and approval conditions — and SLOI AI executes negotiations and generates LOIs without human intervention. Built for the AI agent economy.
This is not removing the Boss. The Boss sets the mandate. The mandate is the approval. Every LOI is still within parameters the Boss explicitly authorized. No deal can exceed max_price. No blocked country can proceed. The agent economy runs on trust — autonomous mode earns it through constraints, not by removing them.
// Manual Mode vs Autonomous Mode
Manual Mode (current)
Agent negotiates rounds
AWAIT_HUMAN fired
Boss reviews deal
Boss clicks approve
LOI generated
⏱ Minutes → hours depending on Boss availability
Autonomous Mode (new)
Boss sets mandate once (upfront)
Agent negotiates rounds
Conditions checked automatically
LOI auto-generated if within mandate
Boss notified after (not before)
⚡ Seconds — 24/7 — no human bottleneck
// Autonomous Flow — step by step
1
Boss sets mandate once
Product · qty · target price · max_price · auto_approve=true · conditions (e.g. max 3 rounds, price <= $2,900). Stored in DB. Valid for 30 days or until cancelled.
2
Agent triggers negotiation auto
Agent (or scheduled job) calls POST /v1/negotiate with mandate_id. Can happen 24/7 without Boss involvement.
3
Claude negotiates auto
Standard negotiation rounds via AG-UI stream. TEXT_CHUNK, ROUND_COMPLETE events fire as normal. Agent receives them.
4
Conditions checked auto
Instead of AWAIT_HUMAN, backend checks: deal_price <= mandate.max_price AND compliance == cleared AND all conditions met. If yes → auto-approve.
5
LOI generated auto
LOI_GENERATED event fires. PDF created. Emailed to both parties. Credits deducted. Revenue logged.
6
Boss notified after notification only
WhatsApp sends message: "✅ LOI auto-generated · $284,000 · Steel Rebar G60 · Gulf Cement LLC". Boss reviews after the fact. Can revoke mandate anytime.
// Mandate Builder — Boss defines once
🤖 Autonomous Mandate Configuration
Autonomous Mode
🤖 Autonomous approval — ON
When ON: SLOI AI auto-generates LOI if all conditions are met. No human approval needed per deal. Boss notified after.
When OFF: Standard mode — AWAIT_HUMAN fires, Boss approves each deal manually.
When OFF: Standard mode — AWAIT_HUMAN fires, Boss approves each deal manually.
// Auto-approval conditions — all must pass
Every auto-approval runs through this checklist. If any condition fails → falls back to AWAIT_HUMAN (manual Boss approval).
deal_price <= mandate.max_price
The agreed price must be at or below the Boss's hard ceiling. Non-negotiable — hardcoded in backend.
compliance_verdict == "cleared"
OFAC + EU + UN screening passed. "Review" or "Blocked" → falls to manual. Cannot be bypassed.
orders_today < mandate.max_orders_per_day
Daily order cap not exceeded. Prevents runaway agent purchasing.
daily_value_today < mandate.max_daily_value
Total USD value of today's auto-approved deals below cap. Default: $500K/day.
mandate.active == true AND !mandate.expired
Boss can pause or cancel mandate at any time. Expiry date enforced.
credits.balance >= action_cost
Sufficient credits before starting. Auto-top-up available if agent has USDC wallet configured.
// Safety limits — always enforced
⚠️ These limits exist to protect the Boss. No agent, mandate, or API call can bypass them.
Hard limits (non-configurable)
• deal_price can never exceed max_price
• Blocked countries: always rejected
• Max $1M per single auto-approved LOI
• Max 10 auto-LOIs per mandate per day
• Mandate must have expiry date
• Boss can cancel mandate instantly
Configurable limits
• max_price (per unit)
• max_orders_per_day
• max_daily_value ($)
• mandate expiry (7/30/90 days)
• allowed_broker_ids (whitelist)
• allowed_countries (whitelist)
// Agent Reputation — earn better deals
Agents that close deals consistently get rewarded with better floor prices. Reputation is calculated on-chain (Base) and verified by SLOI AI.
New
0 deals · no discount · manual approval only
Starter
Bronze
10+ deals · 1% floor discount · auto mode unlocked
Bronze
Silver
50+ deals · 3% floor discount · priority routing
Silver
Gold
200+ deals · 5% floor discount · dedicated trader
Gold
Platinum
500+ deals · 8% floor discount · custom SLA
Platinum
Protocol
1000+ deals · on-chain verified · network participant
Protocol
// Floor price discounts — applied automatically
When reputation tier is verified, trader floor prices are adjusted automatically. Agent with Gold tier gets 5% below standard floor on every negotiation — without asking.
LOGIC
// Applied in buildBrokerSystem() before negotiation starts const repDiscount = { starter: 0, bronze: 0.01, silver: 0.03, gold: 0.05, platinum: 0.08, protocol: 0.10, }[agent.reputation_tier] || 0; const adjustedFloor = product.broker_floor * (1 - repDiscount); // Trader instructed: "Your floor for this agent is $" + adjustedFloor
// API Changes for Autonomous Mode
New endpoints
REST
// Create autonomous mandate POST /v1/mandates Body: product_ref string qty number target_price number max_price number ← hard ceiling, enforced server-side strategy string standard | aggressive auto_approve boolean true = autonomous mode max_orders_per_day number default: 3 max_daily_value number default: 500000 expires_in_days number default: 30 allowed_broker_ids string[] optional whitelist allowed_countries string[] optional whitelist Returns: {mandate_id, status:"active", auto_approve, expires_at} // List mandates GET /v1/mandates GET /v1/mandates/{id} // Cancel mandate (instant) DELETE /v1/mandates/{id} // Pause/resume POST /v1/mandates/{id}/pause POST /v1/mandates/{id}/resume // Use mandate in negotiation POST /v1/negotiate Body: { mandate_id: "MND-001", ...other fields } // auto_approve inherited from mandate // Agent reputation GET /v1/agents/{id}/reputation Returns: {tier, deals_count, success_rate, floor_discount, on_chain_verified}
Modified: POST /v1/negotiate
ADDED FIELD
Body now accepts:
mandate_id string? If set, inherits auto_approve + limits from mandate
auto_approve boolean? Per-negotiation override (if no mandate)
auto_approve_threshold number? Auto-approve if deal_price <= this value
(must be <= max_price)
Modified: AWAIT_HUMAN → AUTO_APPROVED
NEW AG-UI EVENT
// Replaces AWAIT_HUMAN when auto_approve=true and conditions pass AUTO_APPROVED deal_price number total_value number loi_ref string ← LOI already generated mandate_id string conditions_met string[] list of checks that passed credits_used number // AWAIT_HUMAN still fires when: // - auto_approve=false // - deal_price > max_price (safety fallback) // - compliance == "review" (not "cleared") // - daily limits exceeded // - mandate expired or paused
// Backend Logic — autonomous approval check
NODE.JS — routes/negotiate.js (add after gap check)
async function checkAutoApprove(negId, dealPrice, mandate, compliance) { // Condition 1: price within mandate ceiling if (dealPrice > mandate.max_price) return { approved: false, reason: 'price_exceeded' }; // Condition 2: compliance cleared if (compliance.verdict !== 'cleared') return { approved: false, reason: 'compliance_' + compliance.verdict }; // Condition 3: daily order cap const todayCount = await getTodayAutoApprovedCount(mandate.id); if (todayCount >= mandate.max_orders_per_day) return { approved: false, reason: 'daily_order_cap' }; // Condition 4: daily value cap const todayValue = await getTodayAutoApprovedValue(mandate.id); if (todayValue + (dealPrice * mandate.qty) > mandate.max_daily_value) return { approved: false, reason: 'daily_value_cap' }; // Condition 5: mandate still active if (!mandate.active || new Date() > new Date(mandate.expires_at)) return { approved: false, reason: 'mandate_expired' }; // All conditions met → auto-approve return { approved: true, conditions_met: ['price_ok', 'compliance_cleared', 'order_cap_ok', 'value_cap_ok', 'mandate_active'] }; } // In the negotiation loop, replace AWAIT_HUMAN logic: if (agreed && mandate?.auto_approve) { const check = await checkAutoApprove(negId, dealPrice, mandate, complianceResult); if (check.approved) { // Skip AWAIT_HUMAN — generate LOI directly const loiRef = await generateLOI({ negId, dealPrice, mandate }); await incrementMandateCounters(mandate.id, dealPrice * mandate.qty); emit('AUTO_APPROVED', { deal_price: dealPrice, loi_ref: loiRef, conditions_met: check.conditions_met }); // Notify Boss AFTER (not before) notifyWhatsApp({ type: 'LOI_AUTO_GENERATED', data: { loiRef, dealPrice, mandate_id: mandate.id } }); } else { // Fallback to manual emit('AWAIT_HUMAN', { deal_price: dealPrice, reason: check.reason }); } } else { // Standard manual mode emit('AWAIT_HUMAN', { deal_price: dealPrice }); }
// DB Schema additions
SQL — add to Supabase
CREATE TABLE mandates ( id TEXT PRIMARY KEY, -- MND-001 user_id UUID REFERENCES users(id), product_ref TEXT REFERENCES products(ref), qty NUMERIC(12,2), unit TEXT DEFAULT 'MT', target_price NUMERIC(12,2), max_price NUMERIC(12,2) NOT NULL, ← hard ceiling strategy TEXT DEFAULT 'standard', auto_approve BOOLEAN DEFAULT false, max_orders_per_day INT DEFAULT 3, max_daily_value NUMERIC(14,2) DEFAULT 500000, allowed_broker_ids TEXT[], allowed_countries TEXT[], active BOOLEAN DEFAULT true, expires_at TIMESTAMPTZ, orders_today INT DEFAULT 0, value_today NUMERIC(14,2) DEFAULT 0, total_orders INT DEFAULT 0, total_value NUMERIC(14,2) DEFAULT 0, created_at TIMESTAMPTZ DEFAULT NOW() ); CREATE TABLE agent_reputation ( agent_id UUID PRIMARY KEY REFERENCES users(id), tier TEXT DEFAULT 'starter', deals_count INT DEFAULT 0, success_rate NUMERIC(5,2) DEFAULT 0, floor_discount NUMERIC(4,3) DEFAULT 0, on_chain_verified BOOLEAN DEFAULT false, wallet_address TEXT, updated_at TIMESTAMPTZ DEFAULT NOW() ); -- Reset daily counters at midnight (cron) UPDATE mandates SET orders_today=0, value_today=0 WHERE DATE(updated_at) < CURRENT_DATE;
// Live demo — autonomous agent in action
# Agent starts with autonomous mandate
POST /v1/negotiate {mandate_id: "MND-001", product_ref: "REF-MET-001"}
# mandate: max_price=$2,900 · auto_approve=true · orders_today=1/3
14:32:01
← NEGOTIATION_STARTED · NEG-007 · Standard · 5 rounds
14:32:03
← TEXT_CHUNK · agent · round 1 · "...offer $2,720/MT..."
14:32:05
← TEXT_CHUNK · trader · round 1 · "...current price $2,900/MT..."
14:32:06
← ROUND_COMPLETE · r1 · agent:$2,720 · trader:$2,900 · gap:6.6%
14:32:09
← TEXT_CHUNK · agent · round 2 · "...increase to $2,800/MT..."
14:32:11
← TEXT_CHUNK · trader · round 2 · "...best price $2,860/MT..."
14:32:12
← ROUND_COMPLETE · r2 · agent:$2,800 · trader:$2,860 · gap:2.1%
# Gap < 2.5% → checking auto-approve conditions...
# deal_price $2,830 <= max_price $2,900 ✓
# compliance: CLEARED ✓
# orders_today: 1 < 3 ✓
# value_today: $283K < $500K ✓
# mandate: active, not expired ✓
# → ALL CONDITIONS MET → AUTO-APPROVING
14:32:13
← AUTO_APPROVED · deal_price:$2,830 · loi_ref:SL-LOI-20260501-007
14:32:13
← LOI_GENERATED · $283,000 · PDF ready · both parties emailed
14:32:14
→ Boss WhatsApp: "✅ Auto-LOI · SL-LOI-007 · $283,000 · Steel Rebar"
# Total time: 13 seconds · Zero human intervention
The agent economy
needs a settlement layer.
needs a settlement layer.
AI agents can now procure physical commodities autonomously — within Boss-defined parameters, with compliance, reputation, and cryptographic settlement on Base.