Home / Platform / Security

Security enforced by the platform, not by user discipline

Security that depends on people remembering to be careful is not security. Every control here is structural — enforced by the architecture and checked by the build pipeline — and where something is a target or a roadmap item rather than a shipped control, this page says so.

01

Zero trust

Being inside the network grants nothing. Every request carries its own proof, and every check runs again at the point of use rather than at the perimeter.

Identity first

Every request proves who it is

No endpoint infers authority from network location, VPN membership or an internal hostname. Tokens carry the tenant claim, and services scope every query by it, so a valid token from one deployment returns nothing in another.

token tenant claim · re-checked per query · cross-deployment replay answers empty
Context-aware authorization

RBAC, then ABAC on top

Permissions are evaluated with context — assignment, admission state, ward, shift, time of day. "A doctor may edit only admitted patients assigned to them today" is a policy expression, not code someone has to remember to write.

policy engine · authorization matrix tested endpoint × role in CI
Separate planes

Patients cannot reach staff APIs

Patients authenticate on a cryptographically separate identity plane. A portal token is not merely unauthorized against a staff endpoint — it is unusable, because it is not the same kind of credential.

separate token plane · no shared session surface
Strong authentication

Passwordless first

Passkeys and WebAuthn as the flagship staff login, with TOTP and one-time codes as fallbacks and SSO where you already have an identity provider. Passkey cloning is detected by counter regression and flags the credential permanently.

passkeys · TOTP · OTP · OIDC SSO · lockout and rate limiting
No enumeration

The system does not leak who exists

One-time-code requests, password resets and method lookups answer identically whether or not the account exists, so an attacker cannot harvest valid usernames before attempting anything else.

uniform responses · single-use expiring codes · purpose isolation
Never auto-provision

SSO cannot create staff

A federated login matches an existing staff record or it fails. An identity provider — or anyone who compromises one — cannot mint a new user in your hospital, and a locked account stays locked through SSO.

signed short-lived state · nonce · match existing staff only

02

Multi-tenancy & data isolation

The strongest isolation guarantee is the one where the data is not there to be returned. Three independent layers, so a failure in any one does not expose anything.

LAYER 1

One database per hospital

Physical separation, not a tenant column. There is no query that could return another hospital's rows, because those rows are in a different database — self-hosted on your infrastructure if you prefer.

isolation by topology, not by filter

LAYER 2

Token-scoped services

Every service scopes each query by the tenant claim carried in the token. Co-resident lookups and cross-deployment token replay both return nothing rather than an error that confirms existence.

verified by cross-tenant integration tests

LAYER 3

Row-level security

Postgres RLS keyed to the hospital context set per transaction, beneath the application entirely — so an application defect cannot bypass it.

defence in depth at the database

Tenant administration is bounded too: a hospital administrator can edit only the policies their own tenant owns, and platform-wide policies are invisible to them. A suspended tenant stops serving at the gate, before routing. Each of these is proven by a test that runs on every commit, not by a paragraph in a document.

03

Encryption

Encryption is only as good as what it covers and who holds the keys. Both are stated here precisely, including one thing we have deliberately not done yet.

What is encrypted

  • Personal data at rest — AES-256-GCM on identifying fields, held in dedicated encrypted columns rather than encrypting whole tables indiscriminately.
  • Backup archives — encrypted with a dedicated key family, separate from the data-encryption key, so backup theft does not yield live data.
  • Credentials and second factors — passwords, TOTP secrets and passkey material held under the same protection as clinical PII.
  • In transit — TLS to the platform and between platform components; teleconsult media is peer-to-peer and never traverses the server at all.

What we do not claim

  • Log storage is not encrypted at the application layer. Logs are protected by redaction at the point of emission — personal data never enters a log line — with storage-level encryption treated as a deployment concern.
  • This is a recorded, revisitable decision in our threat model rather than an oversight, and it is scheduled for review at the operations-hardening phase.
  • We would rather tell you this than let you discover it during your own security review.

04

Key management

Three independent key families — data encryption, audit integrity and backup — never shared, never in the repository, and rotated as versions rather than as a risky cutover.

Provider chain

Keys never live in code

Secrets resolve through a provider abstraction: environment values in development, mounted files or a vault or cloud KMS in production. No vendor is hard-wired — the provider is deployment configuration behind a stable port.

env (dev) · mounted file · vault / KMS (production)
Production refuses to start

Weak configuration fails closed

A production boot refuses to run unless the token-signing, data-encryption and audit keys arrive as real secret references from a non-environment provider. There is no development default that can accidentally reach production.

boot assertion · secret-scan gate blocks committed credentials
Rotation

Versions, not cutovers

The active key version signs and encrypts; retired versions inside an overlap window continue to verify and decrypt. Rotation is therefore a rolling change with no window where existing data becomes unreadable.

key ids on tokens, ciphertexts and audit records
Rehearsed

The rotation drill runs in CI

A drill rehearses rotation across all three key families on every gate run. Rotation is exercised continuously rather than attempted for the first time during an incident.

rotation drill on every build
Escrow

The backup key is the one to guard

A lost backup key makes every archive permanently unreadable. It is generated separately, stored with the same care as the data-encryption key, and belongs in your key-escrow procedure — we say so in the runbook rather than leaving you to find out.

separate key family · documented escrow obligation
Self-hosted

You can hold your own keys

On a self-hosted deployment the secrets provider is yours: your vault, your KMS, your rotation policy. We do not require custody of your keys in order for the platform to function.

bring your own vault / KMS

05

Audit

An audit log that can be edited is a record of what someone was willing to leave behind. Ospia's is hash-chained, so tampering is detectable rather than merely discouraged.

How it works

  • Every mutation is written to an append-only audit log, each entry cryptographically chained to the one before it.
  • Alter a historical entry and every subsequent link fails verification — you cannot quietly rewrite one row.
  • The chain is re-verifiable end to end on demand, and verification is part of the restore procedure, so a restored database proves its own integrity.
  • Entries carry the key version that signed them, so verification survives key rotation.

What it covers

  • Clinical and financial mutations, with the actor, the time and the task that produced them.
  • Every AI action, via the decision ledger — model, prompt version, inputs, output, approver, and what executed.
  • Security events: authentication failures, permission denials, unmasked-PII reads and anomaly detections, emitted in a SIEM-consumable format.
  • Configuration changes, including autonomy-level promotions, which are audited decisions with a name attached.

The permanent event store sits alongside the audit chain: every action is an event, and events are retained rather than rotated away. That is what makes "replay what happened in March" a query instead of an archaeology project — and it is the same mechanism your assessors and insurers will ask about.

06

Backup & disaster recovery

Backups that have never been restored are a hypothesis. Ours are exercised automatically, and the targets below are the ones we plan around rather than aspire to.

RPO

24 hours, tightenable

The starting target for a single-node deployment, with at least daily backups. Where a hospital's risk tolerance requires closer, write-ahead-log archiving or managed-Postgres point-in-time recovery tightens it.

target — contracted per deployment

RTO

Under 1 hour per tenant

Decrypt, restore and verify is I/O-bound; the remaining budget covers provisioning a fresh database or host. Per tenant, because tenants are separate databases and recover independently.

target — contracted per deployment

DRILL

Rehearsed on every build

Back up, wipe, restore, verify the audit chain, compare row counts — run automatically as part of the gate ladder, not annually by hand.

a restore proves data and chain integrity

Archives are encrypted with a dedicated key family separate from live data, so a stolen backup is not a breach of the database. Restores are performed into a freshly migrated database with audit triggers quiesced, so the hash chain restores byte-identical rather than being re-signed — a restored system can still prove nobody altered its history. See also: migration & cutover →

07

Secure development lifecycle

Security controls that are not tested are intentions. These run on every change, and a failure blocks the merge rather than raising a ticket.

Threat model

STRIDE per surface. Every threat resolves to a mitigation in code with its reference, or to an explicitly accepted risk with an owner and a revisit milestone.

Proof required

A mitigation without a verification hook is treated as unproven. Where a test proves a control, the threat model names that test.

Authorization matrix

Endpoints tested against roles, so a permission regression cannot ship silently.

Secret scanning

Credentials committed to the repository fail the build. Production additionally refuses to boot on environment-supplied keys.

Dependency audit

Known-vulnerable dependencies fail the build rather than appearing in a report nobody reads.

Boundary gates

Module isolation and SQL ownership are enforced by CI, which is what keeps the blast radius of any single defect inside one module.

Anomaly detection is deliberately deterministic and threshold-configured — no machine-learning pretences in the security pipeline. Each firing is itself an auditable security event. In this phase it is detection-only: we do not yet trigger automated lockout or step-up from the pipeline, and we would rather say so than imply a response capability we have not shipped.

08

Testing, assurance & compliance roadmap

This is the section most vendors write optimistically. Here is the actual status of each item, with nothing described as complete that is not.

Item
Status
Cadence
Notes
Threat model (STRIDE)
In place
Per phase
Maintained per surface; modules extend it for module-specific threats.
Automated security gates
In place
Every commit
Secret scan, dependency audit, authorization matrix, boundary and SQL-ownership gates.
Backup / restore drill
In place
Every build
Backup, wipe, restore, chain verification and row-count comparison.
Key rotation drill
In place
Every build
Rehearsed across all three key families.
Independent penetration test
Not yet conducted
Before first production go-live
Scheduled ahead of the first production deployment, then at least annually and after significant architectural change. Reports shared with customers under NDA.
Responsible disclosure
Open now
Continuous
Report anything to security@ospia.in. We will acknowledge, keep you updated, and credit you if you wish.
ISO 27001
Roadmap
Not certified. Controls are being built to align, and we will not describe alignment as certification.
HIPAA
Readiness
Architecture supports the safeguards; formal readiness assessment not yet completed.
DPDP Act 2023
By design
Continuous
Consent ledger consulted before use; personal data minimised and encrypted at rest.
ABDM · NABH · NMC · GST
Supported / enforced
Continuous
See the compliance page for how each is met by mechanism.

Status labels are used strictly. "In place" means shipped and exercised by automation. "Roadmap" and "readiness" mean not yet achieved. If a status here ever reads better than reality, that is a defect and we want to be told.

Security questionnaires, architecture review sessions and the threat model itself are available to prospective customers — including the accepted-risk register, which is usually the part that tells you most about how a vendor actually works. Request a security review →

Next step

See your hospital running on Ospia

An executive demonstration takes forty-five minutes. We seed a hospital with synthetic data shaped like yours, put the digital workforce on duty, and answer the hard questions with the architecture open.

Book your hospital simulation Architecture deep-dive

synthetic data · zero real patients
self-hosted or managed cloud
one database per hospital