StratEdge Research · Reference architecture

Secure Data and System Design for a TPA AI Agent Platform

Treat the model as an untrusted worker: tokenize before prompts, isolate tenants, hash-chain audit logs, and never let the model release payments.

Tarik Zahedi·StratEdge Workflow Systems LLC·

Reference design for engineering and compliance planning—not a certification of any specific production deployment.

A safe TPA agent platform treats participant data as the crown jewels and the AI model as an untrusted worker. Five principles drive the design choices below:

  1. Isolate every client. Each TPA’s data is logically separated at the database, storage, and key level.
  2. Minimize what the model sees. Sensitive identifiers are tokenized before any prompt; the model works on placeholders.
  3. Deterministic code decides money. Rules engines calculate amounts; the model gathers and interprets—it does not compute or release payments.
  4. Every action is attributable. Humans, services, and agents each have distinct identity; every step lands in an append-only audit log.
  5. Assume breach. Encryption everywhere, least privilege, tested recovery, and a rehearsed incident plan.

This document is a reference design for StratEdge-class workflow and distribution platforms—not a description of any single vendor’s production stack. Recovery targets and numeric limits are typical starting points to tune per client.

Reference architecture

Requests flow through a gateway into an orchestrator that coordinates the model, a deterministic rules engine, and human review, with sensitive data held in a separate vault.

The orchestrator is the only component that talks to everything; the model sees only redacted text, and only the vault holds raw identifiers.

ComponentResponsibilityKey control
API gatewayAuthenticate users and systems; block abuseSSO with MFA, WAF, per-tenant rate limits
Agent orchestratorRun each request as an explicit state machineEvery transition logged; model cannot skip states
Redaction and tokenizationSwap identifiers for tokens before promptsRaw values never leave the trust boundary
Rules engineWithholding, RMDs, eligibility mathVersioned, unit-tested; no model involvement
Human review queueExceptions, thresholds, low-confidence casesReviewer cannot approve their own submission
Payment serviceBuild payment instructions for TPA systemsDual approval, limits, bank-change checks
Token vaultStore SSNs and bank account numbersSeparate keys, separate access, heavy audit
Tenant databaseWorkflow records and documentsPer-tenant encryption keys and row-level security
Audit logImmutable history of every actionWrite-once storage, hash-chained entries

Data storage

Data is classified first, then stored with protection matched to its class; the most sensitive fields live only in a separate vault behind tokens.

ClassExamplesWhere it livesProtection
RestrictedSSNs, bank routing/account numbers, dates of birthToken vault onlyField-level encryption; tokenized everywhere else
ConfidentialBalances, distribution amounts, plan documents, uploadsTenant DB and object storagePer-tenant keys, row-level security
InternalWorkflow states, assignments, metricsTenant databaseEncryption at rest, RBAC
AuditEvery action, decision, approvalWrite-once log storageImmutable retention, hash chaining

Tenant isolation

Each TPA receives a logical partition: tenant ID enforced by row-level security, separate storage prefix, and dedicated encryption key. Larger or regulated clients may purchase a dedicated database or cloud account for stronger isolation.

Encryption and keys

  • TLS 1.2+ for all traffic, including service-to-service
  • AES-256 at rest for databases, object storage, and backups
  • Envelope encryption via cloud KMS—separate keys per tenant and data class
  • Key rotation at least annually; optional customer-managed keys
  • Deleting a tenant key supports verifiable erasure at contract end

Tokenization

When a form arrives, the redaction service extracts identifiers, stores them in the vault, and replaces them with tokens (for example SSN_7F3A). The model, most logs, and most services see only tokens. Only the payment service and authorized reviewers may detokenize—and every detokenization is logged.

Documents

Uploads land in object storage with per-tenant keys, malware scanning on ingest, and a SHA-256 hash at intake to detect tampering.

Retention

Plan and distribution records follow the client’s required period—commonly six years or more for ERISA-related records—then delete on schedule. Model prompts and outputs are retained only as long as needed for audit and debugging, in redacted form.

Identity and access

Every human, service, and agent has its own identity with least privilege; nobody has standing access to production participant data.

Users. SSO via the client IdP (SAML/OIDC), mandatory MFA, automatic deprovisioning on termination.

Roles. RBAC (intake, reviewer, approver, admin) plus attributes (tenant, plan, dollar limits). Separation of duties: preparers cannot approve their own payments.

Services and agents. Short-lived credentials scoped to specific tables and actions. The agent may read workflow data and call approved tools—it cannot detokenize, approve, or release payments.

Engineers. No standing production access; just-in-time, approved, time-limited access with logging. Customer data is not copied to laptops; tests use synthetic data.

Break-glass. Emergency access behind two-person approval, alerted and reviewed on every use.

Reviews. Quarterly access reviews per tenant, retained as audit evidence.

AI data handling

The model is capable but untrusted: minimum data, fixed workflow, allow-listed tools only.

Provider terms. Enterprise APIs with zero retention, no training on customer data, US-region processing, signed DPA. Maintain a second approved provider for failover without re-architecture.

Minimize and redact. Prompts carry tokens, not identifiers. Include only fields needed for the current step. Scan outputs for accidental raw identifiers before storage.

Prompt-injection defense. Uploaded forms and email are untrusted: documents are data, never instructions; the model proposes while the orchestrator validates state transitions; tools are allow-listed per step with server-side tenant scope; bank-detail or payee changes always trigger human verification.

Structured outputs. JSON against a strict schema (fields, confidence, source page). Schema failures, low confidence, or rules-engine disagreement route to human review.

Model routing. Economical models for classification and extraction; stronger models for unusual plan language. Pin and record model and prompt version with each decision for reproducibility.

Money-moving controls

No payment releases without deterministic checks and human approval.

  • Dual approval — preparer plus separate approver; higher thresholds need a second approver
  • Bank-change verification — out-of-band confirmation plus hold before first use
  • Limits and velocity — per-payment, per-day, and per-participant caps; alerts on clustered payee changes
  • Idempotency — unique keys so retries cannot double-pay
  • Reconciliation — match released payments to requests and bank confirmations; mismatches open exceptions
  • Kill switch — pause payment release per tenant without stopping the rest of the platform

Audit, observability, and evaluation

Audit log. Each entry records actor, tenant, step, inputs by reference, output, model/prompt version, and timestamp. Hash-chained entries on write-once storage; auditors receive read-only exports.

Observability. Distributed traces; dashboards for latency, errors, review rate, cost per distribution, model spend per tenant; alerts on validation failures or unusual access.

Evaluation. Golden scenarios built with plan experts (synthetic data). No model, prompt, or rule change ships without passing the suite. Production sampling with human re-review measures true error rate.

Security monitoring. Centralized logs; alerts on privilege changes, bulk exports, detokenization spikes, and anomalous logins.

Resilience and operations

AreaTypical target or practice
Recovery point (max data loss)Under 15 minutes with continuous DB backup
Recovery time (max downtime)Under 4 hours; payments paused safely meanwhile
BackupsEncrypted, cross-region, immutable 30+ days; quarterly restore tests
Model provider outageFail over to second provider or queue work
DeploymentsIaC, peer review, staged rollout, instant rollback
DependenciesVulnerability scanning; patch within policy
TestingAnnual third-party pen test; tests after major changes
Incident responseWritten plan, on-call roles, client notification per contract, tabletop drills twice yearly

Peak season (year-end, 1099-R volume) should be load-tested each autumn.

Compliance mapping (starting point)

RequirementWhy clients askControls that satisfy
SOC 2 Type IISecurity over timeAccess control, encryption, monitoring, change management, IR
SOC 1 Type IIFinancial reporting relianceRules engine testing, dual approval, reconciliation, audit log
GLBA safeguardsConsumer financial informationClassification, tokenization, vendor oversight
ERISA recordkeepingLong-lived plan recordsRetention, immutable audit, per-tenant export
HIPAA (if health plans)PHI in scopeBAA, same encryption and access model
State privacy / breach lawsNotification dutiesData maps, incident workflow

Confirm scope with compliance advisers and audit firms for each deployment.

Related StratEdge research

AI Distribution Agents for TPAs: How the Business Works · StratEdge Workflow

Ask StratEdge

Basic product & company questions

Hi — welcome to StratEdge. I can answer basic questions about what we do, who we’re for, demos, and research. What do you want to know?