Skip to main content

Cross-Cutting Concerns

These proposed controls apply across the platform. Older detailed modules illustrate the India launch case; core infrastructure should be jurisdiction-neutral. See Jurisdiction Model and Assurance Design.

Security​

ConcernBehavior
TransportTLS 1.2+ everywhere, HSTS enabled
AuthenticationJWT access tokens (short-lived) + rotating refresh tokens, see Auth & Identity
AuthorizationRole-based, evaluated per-request at the API Gateway and re-checked at the service layer
Tenant isolationfirm-scoped shared PostgreSQL tables with RLS, resolved from the authenticated token, never from a client-supplied header alone
SecretsStored in a secrets manager, never in application config or source
Data at restDatabase and object storage encrypted at rest
Sensitive recordsFinancial documents, tax identifiers (e.g. Indian PAN/GSTIN), PII and audit evidence are isolated client/firm data; no cross-tenant analytics or model training
Operational controlsPrivileged MFA, least privilege, access reviews, secure changes, incident response, restore drills and vendor assessments are proposed control objectives
Evidence integrityHash source versions; pin rule/config versions; retain append-only decision records with restricted privileged access
Payment boundaryHosted/tokenized billing and a documented PCI DSS data-flow and third-party responsibility decision; audit uploads are scanned for unexpected sensitive payment data

Idempotency​

Every state-changing API endpoint that can be safely retried (file upload, rule run trigger, report generation) accepts an Idempotency-Key header. A repeated request with the same key returns the original result rather than re-executing the operation — critical for uploads over unreliable connections and for webhook delivery from the payment gateway.

Error taxonomy​

HTTP statusMeaningExample
400Validation failureMalformed file, missing required field
401Not authenticatedMissing/expired token
403Authenticated but not authorizedWrong role, wrong tenant
404Not found (or exists in a different tenant)Prevents tenant-existence leakage
409ConflictDuplicate upload, concurrent edit
422Semantically invalidFile parses but violates a business rule
429Rate limitedPlan-tier API rate limit exceeded
5xxServer faultLogged with a correlation ID surfaced to the caller

Observability​

  • Every request carries a correlation ID, propagated through the event bus so a file.uploaded event can be traced to its resulting rules.completed event and every finding it produced.
  • Structured logs (JSON), one log line per state transition, not per internal step.
  • Metrics: request latency per endpoint, event-bus consumer lag, rule-run duration, ingestion parse failure rate — surfaced to the Dashboard & Analytics module for tenant-facing health, and to an internal ops dashboard for platform health.

Determinism guarantee (audit-specific)​

The ingestion → normalization → rule engine path contains no LLM and no non-deterministic component. The same input file set, run twice, produces byte-identical findings. This is a hard constraint, not a performance goal — a partner's sign-off depends on being able to reproduce a finding from the same inputs at any later date. See Rule Engine.

Internationalization​

The reusable core stores timestamps in UTC and handles explicit jurisdiction, locale, fiscal-calendar, timezone and ISO 4217 currency fields. India pilot defaults may be INR, April–March, IST and English; these are not hard-coded universal constraints. New languages and country rule packs require future validation. Never silently convert financial amounts in statutory checks.