Inspiration
Financial-access decisions — onboarding, credit pre-screening, compliance intake — are slow, costly, and opaque. Small operations can't afford a compliance team, and when they bolt AI onto the problem, decisions turn into a black box nobody can audit. We wanted the opposite: let AI operate the workflow end-to-end, but make every decision verifiable with a receipt — so trust is proven, not assumed.
What it does
REX TrustDesk is an AI-native trust desk for financial-access workflows. A case flows through:
case intake → intake agent → risk agent → deterministic policy gate → evidence agent → DecisionReceipt
- Gemini agents extract the case facts, classify risk, and draft the customer follow-up.
- A deterministic policy gate — never the model — makes the final, material routing decision.
- Every agent step logs an AgentEvent, and each case ends in a hashed, tamper-evident DecisionReceipt (
input_hash,agent_trace_hash,receipt_hash, the exact policy rules evaluated, and the human-review status).
It runs live in production on Google Cloud Run, with the AI executing on Vertex AI (Gemini 2.5 Flash). The /health endpoint reports model_mode: "gemini" when the AI path is live, and a self-contained dashboard shows the agent trace, policy table, DecisionID, and receipt hashes for every case.
How we built it
- A TypeScript pnpm monorepo: a receipt engine (canonical hashing), a deterministic policy-gate package, an agent runtime with a pluggable
ModelAdapter, a sharedprocessCase()orchestrator, and a JSONL evidence store. - The
ModelAdapterhas two Google backends — Vertex AI (keyless, via the Cloud Run service account) and the Google AI API — plus a deterministic fallback. Model output is validated before it can touch policy, using Gemini's nativeresponseSchemaplus our own validators. - Fastify API + a zero-build dashboard, packaged in a single container and deployed to Cloud Run.
- Keyless CI/CD: GitHub Actions + Workload Identity Federation builds from source with Cloud Build and deploys on every push to
main, then smoke-tests/health,/cases, and/evidence/summary.
Challenges we ran into
- Safety of AI decisions. An LLM must not be able to approve anyone. We made the policy gate the sole decision authority and designed the model path to fail closed: on any model failure or invalid output, it falls back to deterministic logic and escalates risk to manual review — a broken model call can never produce an approval.
- Keyless auth under strict org policy. The Google Cloud org blocks service-account key creation. We moved the whole pipeline to Workload Identity Federation, so there are no secrets anywhere — not in the repo, not in GitHub.
- Not leaking raw data. Only derived, hashed artifacts ever leave the trust boundary; raw payloads are never logged or persisted.
What we learned
Making AI auditable is a design constraint, not an afterthought. The strongest pattern was "the model advises, the policy gate decides," with a hashed receipt as the contract between them — it keeps the system AI-native and trustworthy at the same time.
What's next
Onboarding paid pilots with small financial operators, durable evidence storage (Firestore/BigQuery), and richer risk policies — while keeping the auditable spine unchanged.
Synthetic demo data throughout — no real customer documents or PII. REX TrustDesk produces auditable candidate decisions with a human-review path; it does not auto-approve credit and makes no guarantee of regulatory compliance.
Built With
- cloud-build
- docker
- fastify
- gemini
- gemini-2.5-flash
- github-actions
- google-cloud
- google-cloud-run
- node.js
- pnpm
- typescript
- vertex-ai
- workload-identity-federation
Log in or sign up for Devpost to join the conversation.