Engineering PlanThe system architecture, the AI architecture, the security model for attorney-client-privileged data, and the lean ten-engineer trajectory that funds the whole 15-state, 46-category footprint on a single seed.
System architecture
Clients reach Lawma only through a security perimeter; case data lives in a privileged, tenant-isolated zone walled both by firm and by party; the AI layer sits behind a zero-data-retention boundary; integrations connect through a vetted API edge. All services (category framework, credential verifier, traps engine, advertiser portal, filing-envelope manager) sit in the same application zone, with the advertiser surface isolated from the privileged data zone by schema.
Clients
Lawma platform
Attorney-client privileged — encrypted at rest with a managed key service, tenant-isolated, party-walled, never sold, never used to train outside models. AWS business associate agreement, SOC 2, HIPAA-eligible.
No storage, no training on case data. Every legal-bearing AI output is gated by attorney review.
Integrations · Growth phase
AI architecture
Court forms are generated by deterministic code; legal reasoning is grounded in real sources and gated by an attorney. Two paths, one rule — and a third current: the traps-detection engine runs as deterministic rules over structured case data, with the AI used only to phrase attorney-facing flags.
Court forms — deterministic
Same answers in → same PDF out. Testable, auditable, no invented or omitted fields.
Legal reasoning — grounded AI
Claude paraphrases real sources, not memory. Every legal-bearing output is reviewed by an attorney.
Trap detection — deterministic rules
Detection is rule-based — deterministic, testable. Only the attorney-facing phrasing uses the AI.
Security architecture
Case data is attorney-client privileged. Security is the highest-priority engineering concern: "as strong as banking."
Layer 1 · Identity
Mandatory multi-factor authentication on every account, every login; role-based access control across Client, Attorney, Firm Admin, Implementer, and Advertiser.
Layer 2 · Tenant and party isolation
PostgreSQL row-level security. Firm-level wall plus the per-party wall (petitioner and respondent never see each other's data; conflict-of-interest detection is server-side only).
Layer 3 · Data protection
Encryption in transit and at rest; documents behind short-lived signed URLs; secrets in AWS Secrets Manager, never in source control.
Layer 4 · Privileged AI
Legal-reasoning calls go only to a zero-data-retention provider. No storage, no training on case data. Kovel-style posture.
Layer 5 · Advertiser-zone isolation
Advertiser identities and campaigns live in a separate database schema with no join to privileged tables. The targeting layer enforces that no client-identity signal ever crosses to the advertiser surface.
Layer 6 · Auditability and recovery
Immutable audit log of every case-data access; tested backups; a written breach-response plan.
Technology stack
Next.js + TypeScript + React
One framework for user interface and server rendering; mobile-first. Self-hosted as a container — not tied to a single hosting vendor.
AWS ECS Fargate
Serverless container compute for the application plus the microservices (category service, credential verifier, traps engine, advertiser portal). Auto-scales without managing servers.
AWS Aurora PostgreSQL with pgvector
Managed relational and vector data in one engine. Multi-availability-zone failover, encrypted at rest with a managed key service, row-level security enforces firm and per-party walls.
Auth0
Identity for clients, attorneys, and advertisers — single identity provider, separate role-based-access-control roles. Mandatory multi-factor authentication on every login. FedRAMP-authorized, SOC 2 Type II.
AWS S3 with managed key encryption
Encrypted document storage with versioning and multi-factor-delete protection on production buckets; short-lived pre-signed URLs scoped to authorized users.
AWS CloudFront + WAF + Shield
Edge content-delivery network, web-application firewall, and managed DDoS protection. Public marketing surface cached at the edge; the authenticated application passes through with strict origin policy.
Anthropic Claude under zero-data-retention agreement
Frontier legal reasoning under zero-data-retention terms. Used by the AI-guided intake mode, the attorney-only case analysis, and traps-engine phrasing.
pdf-lib
Pure-JavaScript AcroForm filling and DRAFT-watermarking. A build script generates AcroForm replicas; runtime serves filled PDFs. Federal forms (USCIS, USPTO, Board of Veterans Appeals, IRS) are added to the build pipeline as federal categories launch.
Postmark + Twilio
Postmark for branded transactional email; Twilio for multi-factor SMS and advertiser pacing alerts. Used sparingly.
Sentry, Datadog, CloudWatch, CloudTrail
Error tracking, application observability, platform metrics, and an immutable audit log. Privileged surfaces strip personally-identifiable information before it reaches observability vendors.
Data model
Every privileged-zone table carries a firm_id and a party_side — the keys to database-enforced firm and party-wall isolation. Advertiser tables live in a separate non-privileged schema with no join to the privileged plane.
Engineering team
The single-seed trajectory funds engineering through retained earnings beyond Year 2. Hires are sequenced so each year's new engineer corresponds to a specific capability milestone.
| Year | Headcount | Focus and capability milestones |
|---|---|---|
| Year 1 | 2 engineers | Founding engineer (full-stack lead) and AI/ML engineer. Build the prototype, California family-law category, national bankruptcy product. |
| Year 2 | 4 engineers | Add platform engineer (category framework) and DevOps/security engineer (production cutover from prototype). California full-load and Texas/New York family-law launch. |
| Year 3 | 6 engineers | Add frontend engineer (matchmaking and traps engine) and backend engineer (credential verifier). Florida and Illinois launches; all five states fully loaded. |
| Year 4 | 8 engineers | Add data engineer (corpus and outcome analytics) and integrations engineer (case-management and electronic-filing adapters). Ten-state expansion; Social Security federal. |
| Year 5 | 10 engineers | Add senior architect (Lawma-as-EFSP) and advertiser-platform engineer. Fifteen-state expansion plus immigration, intellectual property, VA, IRS federal. |
By Year 5, roughly 2.15 million paying engagements divided by 10 engineers equals about 215,000 engagements per engineer per year. Achievable only because the AI does the heavy lifting, the deterministic PDF service owns every court form, and category expansions are data changes rather than code changes.
Build sequence
Each milestone ends with tests and a security check. The first eight are the supervised-pipeline prototype. The final five are the platform-leverage milestones surfaced by the requirements audit.
The architecture, security posture, and technology stack described above are the enterprise-grade production stateLawma is being built toward. Some pieces are live today; others activate as we move through the enterprise transition plan we've locked in. This section describes today, and the plan that gets us to the target state.
Where we are today
How we get to enterprise-grade production
A four-phase transition plan governs the move to production posture:
Beyond that: ISO 27001, HIPAA-adjacent posture, or FedRAMP are pursued if and when specific business signals demand them.
The gating principle: engineered scale never outruns engineered trust. We do not ship at scale to real clients without the attestations that back the claims on this page.