Guide / implementation

How the paid Agentic Finance path works

This guide stays close to implementation: workflow stages, frozen payment terms, deterministic authorization, independent settlement evidence and the boundaries between workflow state and payment state.

Why Pegas uses bounded authority → Vision
01

Request and route

Intake → optional Privacy → Routing

Intake structures the fictional request. Privacy can reduce forwarded context. Routing selects the destination and may choose the paid Legal branch when the scenario requires specialist review.

02

Check authority before payment

Agent Mandate → KYA-lite → AUTH controls

The workflow may request a consultation, but deterministic server logic checks the mandate, agent identity, fixed network, asset, payee, amount and budget constraints before any authorization is allowed.

03

Freeze the first valid payment terms

First 402 → freeze → authorize → settle

The first valid x402 payment challenge defines the terms that are checked and signed. A later response cannot expand or silently change those approved terms.

04

Verify settlement independently

x402 V2 → Solana Devnet → configured RPC / Alchemy evidence

Facilitator success is not treated as final proof on its own. The configured Solana RPC must observe chain evidence matching the approved offer before the paid Legal result is delivered.

05

Keep payment state narrow

Upstash Redis = payment-side state

Redis is used for payment-side idempotency, reservations, budgets/concurrency, receipts and reconciliation. It is not used as the general workflow database.

06

Deliver and review

Legal Advisor → Reviewer → final result

The paid specialist runs only after confirmed payment evidence. The result then returns to Review, while the payment evidence remains inspectable as a separate factual record.

07

Let other agents call Pegas

External agent → MCP /api/mcp → same workflow and AUTH controls

Pegas is also a remote MCP server. Claude, Cursor or any client that supports remote MCP can call three tools: submit_request (free), request_legal_consultation (0.01 test USDC) and get_payment_evidence (read-only). The caller gets a tool, not authority: it holds no keys and cannot change price, seller, network, asset or count. The mandate records the caller as an unverified external agent, and all external agents share one narrower budget lane.

Model runtime

Vercel → Modal → Ollama → qwen3:4b → NVIDIA L4

Self-hosted model inference is separate from deterministic financial controls.

Payment proof

x402 → Solana Devnet → independent evidence

The payment path remains inspectable without turning the model into the authority layer.

Connect your own agent

https://pegas-rouge.vercel.app/api/mcp

In Claude: Customize → Connectors → Add custom connector, paste the URL, choose no sign-in. Then ask Claude to use the Pegas tools. You can also try it without any setup: on the Demo page, switch to "AI agent via MCP".

Try the MCP agent mode on the Demo →

Evaluation

The 12-case workflow evaluation remains standard mode and cannot spend. The older benchmark remains historical single-step evidence.