GateX

Technical architecture

GateX system design

Control/data flows, trust boundaries, and component ownership for the AgentiX deployment. Card MCP–first; one-time XSGD cards; hash-chained audit.

Download ARCHITECTURE.mdOpenAPI gateway.yaml/controls/demo

01 · Context

System context

Humans fund and freeze. Equipped agents only talk to the gateway. GateX talks to StraitsX Card MCP and Avalanche; optional OpenAI for Q-LLM extract.

02 · Components

In-process map

UI routes call API routes; domain libs own policy, identity, CaMeL, cards, settlement, and audit. Policy + receipts persist in SQLite (data/gatex.sqlite).

ModulePathRole
Policysrc/lib/policy/store.tsCaps, ledger, freeze
Mandatesrc/lib/mandate/evaluateMandate codes
Identitysrc/lib/identity/did:key registry
CaMeLsrc/lib/camel/Quarantine + assert
Cards / MCPsrc/lib/payments/Issue · RHA · revoke
x402 / XSGDsrc/lib/payments/x402.tsSettle + Snowtrace
Auditsrc/lib/audit/Hash-linked chain
Runsrc/lib/run/Demo SSE pipeline

03 · Sequence

Equipped agent spend

Mandatory skill path: check → (deny or) pay → receipt. Pay always revokes the one-time card before returning.

Trust zones

  • Trusted — controls, gateway, P-LLM/mandate, audit
  • Untrusted — supplier HTML, injection strings
  • External — Card MCP, Avalanche RPC

04 · Control

Freeze → deny

Also: CAP · DAY · WEEK · RATE · MERCHANT · SKU · APPROVAL · EXPIRED

05 · Isolation

CaMeL control vs data

Dual-LLM pattern (DeepMind CaMeL): untrusted page never reaches the privileged planner as free text that can become a tool.

Ref: arXiv:2503.18813

06 · Rails

Card MCP → Avalanche

EnvRole
STRAITSX_CARD_MCP_URLMCP SSE
AGENT_WALLET_ADDRESSMCP wallet + balanceOf
AGENT_PRIVATE_KEYEIP-3009 signer
MERCHANT_WALLET_ADDRESSx402 payTo
X402_NETWORKeip155:43113 / 43114

07 · Demo

Theater pipeline

POST /api/run streams runLane over SSE. Keys 1–4 map to identity, injection, execute, audit.

08 · Schema

Logical data model

Today these are in-process maps. Production maps 1:1 onto Postgres / DynamoDB rows so freeze + receipts survive restart.

09 · AuthN

Signed gateway requests

Shipped: optional shared x-gatex-key. Design next: per-agent Ed25519 over intent + timestamp + nonce so a leaked org key alone cannot spend.

10 · Target

AWS persistence shape

Hackathon: Amplify Hosting (memory on SSR) + local SQLite. Hire-signal target: RDS for policy/spend, DynamoDB or Postgres JSONB for audit links, Secrets Manager for keys, ECS/App Runner for the Next process.

ConcernNowAWS
Policy / freezeSQLite (local file)RDS Postgres
Spend ledgerSQLitePostgres / DynamoDB
Audit chainSQLiteDynamoDB or JSONB + S3
Secrets.envSecrets Manager

11 · Threats

Threat → mitigation

ThreatMitigation
Spoofed agentDID registry + planned signed intents
Prompt injection → toolCaMeL quarantine; P-LLM never sees HTML
Frozen agent still paysevaluateMandate / RHA refuse FROZEN
Standing card theftOne-time card + mandatory revoke
Tampered receiptverifyChain hash links

Gateway API

Machine-readable contract: /openapi/gateway.yaml

Source of truth: ARCHITECTURE.md. Hackathon MCP notes: see repo HACKATHON-LINKS.md.