Skip to main content
Real-world examples showing Uniplex in action.

Payments API

The high-stakes demo. AI agents accessing a banking API with:
  • Amount limits (agents have transfer caps)
  • Account isolation (agents can only access their owner’s accounts)
  • Permission scoping (read-only vs transfer)
  • Audit trail with signed attestations
What’s BlockedWhy
Agent tries $500 transfer with $100 limitExceeds permission
Alice’s agent accessing Bob’s accountWrong owner
Read-only agent transferring $1No transfer permission
Agent tries $50k transfer with $10k limitExceeds permission
Total prevented: $50,551 in unauthorized transfers

View on GitHub

Server, client, and full README

Quick Start

git clone https://github.com/uniplexprotocol/Uniplex.git
cd Uniplex/examples/payments
npm install
Terminal 1:
npm run server
Terminal 2:
npm run client

How It Works

Create an agent with transfer limits:
from uniplex import Agent

# Agent can only transfer up to $100
agent = Agent.create('alice-assistant', 
    permissions=[
        'payments:read_balance',
        'payments:transfer:100'
    ]
)
Server checks permissions before executing:
from uniplex import Gate, TrustProfile

gate = Gate(profile=TrustProfile.L1)

def transfer(passport, amount):
    decision = gate.authorize_simple(passport, f'payments:transfer:{amount}')
    
    if not decision.allowed:
        raise PermissionError(f"Denied: {decision.reason_code}")
    
    # Safe to execute transfer

Sample Output

→ Checking Alice's balance...
  ✅ Balance: $5,000.00
  📜 Attestation: att_00170b44ed4c

→ Transferring $50 to Bob...
  ✅ Transfer complete! New balance: $4,950.00
  📜 Attestation: att_e88ae479d429

→ Attempting $500 transfer (SHOULD FAIL)...
  🚫 DENIED: Transfer amount $500 exceeds your limit of $100
     Your limit: $100, Requested: $500

More Examples Coming

  • MCP Weather Server — Basic MCP integration
  • Healthcare Records — Read vs write permissions
  • Trading Agent — Position size limits

Request an Example

Tell us what you’d like to see