Bank-Grade Agent Runtime for Embedded Finance
Staq is a B2B embedded finance platform that provides banking infrastructure across Saudi Arabia, Iraq, and the UAE. They aim to create a B2C autonomous banking app that utilizes multi-agent AI to actively manage user finances, which includes tasks such as canceling subscriptions, providing overdraft protection, executing cash sweeps, and alerting users to fees, all while incorporating human review that can eventually transition to full automation. The challenging aspect was not the AI tools themselves, but rather the integration of AI agents into robust, reliable workflows that handle real financial transactions in regulated markets, ensuring complete traceability, auditability, and compliance with local regulations. Teams lacking orchestration experience often make architectural choices that can lead to significant rework. Spiral Scout facilitated a four-week architecture sprint to establish Staq's Temporal orchestration model, agent lifecycle management, isolation patterns, and audit strategy. The objective was to achieve architectural clarity, enabling Staq's engineers to build with confidence and take full ownership of the platform from the outset. The architecture distinguishes between predefined deterministic agents, which are developed as standard Temporal workflow chains, and interactive chat agents that are kept behind a controlled abstraction layer managed through Wippy. These agents work with opaque IDs instead of raw personally identifiable information (PII). Policy injection using OPA/Rego ensures compliance with country-specific anti-money laundering (AML) regulations, AI safety measures, and budget limits during execution. Tokens scoped by the issuer, managed through Keycloak, limit the access of each agent. Execution guards automatically shut down or checkpoint agent workflows when they exceed designated steps and budget quotas, instead of relying on the language model to self-regulate. Telemetry dashboards track costs and latency, monitoring for saturation, errors, and deviations in the production environment. Staq has implemented Wippy under an open-core model. As a founding partner, they helped shape the production runtime roadmap and fully own the architecture. Their engineers can independently create new agents with no vendor lock-in.