case studies

NC · case study

Taking a Pharma AI Platform From Prototype to Enterprise Pilot Approval

Seven weeks as fractional CTO and security architect on a multi-tenant AI platform for pharmaceutical manufacturers, then ten weeks watching its live pilot: what was checked, fixed and monitored, and what it does not claim.

by Nic Chinupdated 10 min readAI Security / Compliance / Case Study

in plain English

A software company serving drug manufacturers was about to put its AI product in front of large pharma customers, and it was not ready: it had security holes, and nobody would have been told if it broke. I closed the serious holes, set up the alarms and the regular health reports, and then watched its first live pilot for about ten weeks. It ran the final four weeks without a single restart.

role
Fractional CTO and security architect
length
7 weeks to pilot approval, then about 10 weeks watching the live pilot
result
Approved for an enterprise pilot. The pilot ran, and finished its final 28 days with zero restarts
fixed
2 critical and 4 high security findings, including one customer being able to read another customer’s documents
watched by
8 alarms that email named people, a weekly health check and a written monthly report

the short versionseven weeks of work, ten of watching

Not ready for customers, then approved for an enterprise pilot in 7 weeks.

All 22 contracted deliverables were completed, each with an evidence artifact. The pilot was then watched for about ten weeks, and every production service ran the final 28 days with zero restarts.

the recordby milestone

M1 · weeks 1-2

Application security and observability

  • Access tokens cut from 7 days to 8 hours
  • Cross-tenant document endpoint fixed
  • API documentation removed from production; 7 security headers added
  • 8 alarms, log retention, health and readiness endpoints

M2 · weeks 3-4

Platform hardening and data protection

  • 6 deployments hardened: non-root, capabilities dropped
  • 0 critical findings in the container scans
  • Encryption verified at rest and in transit
  • A vector-store isolation gap identified and documented

M3 · weeks 5-6

Audit trail and AI security

  • 12+ critical actions logged, append-only, kept 365 days
  • Guardrails on input and output, 15+ test cases
  • Every model call traced to its tenant, user and request
  • A compliance gap memo. It is not a certification.

M4 · week 7

Load testing, recovery and handover

  • 5 concurrent users, 0.98% error rate
  • Backup and restore in about 45 minutes, against a target under 1 hour
  • Rollback in under 2 minutes
  • 10 runbooks

Not claimed: a certification, a penetration test, round-the-clock cover, or that every finding was fixed. In the pilot I watched, triaged and recommended; the client’s engineers owned the fixes.

FIG. 02
engagement record
AI platform for pharmaceutical manufacturers
client anonymised
Completed engagement
a record, not live data
7 weeks, then about 10
the build-up, then the pilot

The short version: a multi-tenant AI platform for pharmaceutical manufacturers was heading into pilots with large pharma organisations. It worked, but it was functional rather than production-ready, and if it had broken, a customer would have been the first to know. Over 7 weeks and 4 milestones I ran 26 security checks, fixed both critical and all four high findings, hardened the platform and its infrastructure, and set up the monitoring: 8 alarms that email named people, central logs, health checks and 10 runbooks. All 22 of 22 contracted deliverables were completed, each with an evidence artifact, and the platform was approved for enterprise pilot deployment with pharmaceutical clients.

I then watched the live pilot for about ten weeks, with scheduled health checks and a written report at each interval, so faults were caught and routed to the client’s engineers early. 12 issues surfaced, the serious ones were fixed within one release cycle, and every production service ran the final 28 days with zero restarts. How the monitoring worked.

I worked as fractional CTO and security architect on a fixed-price, milestone-based statement of work, delivering every change as a pull request. The client is anonymised and the evidence is under NDA, so nothing here links to it. The evidence table says how each claim was verified and where it lives.

The Starting Point: The Gaps

The platform reads manufacturing and quality documents, runs root cause analysis and answers questions through a RAG chatbot over pgvector. Each customer is a tenant. Before a pharma buyer would put its data in, these gaps had to close:

  • Access tokens lasted 7 days. A stolen token meant a week of access to sensitive manufacturing data.
  • Cross-tenant access. One tenant could read another tenant’s documents.
  • No central logging, alerting or health checks. Nothing would have told the team the platform was down or under attack.
  • No audit trail, no traceability for AI calls, and no compliance path.
  • Kubernetes pods ran as root, and access control was undocumented.
  • No load testing, no tested backup and restore, no disaster recovery procedure.

What Was Checked

The assessment was 26 pass/fail checks following OWASP methodology, across the Django application, the API, the Kubernetes deployments on EKS and the AWS account around them. On top of that I scanned container images with Trivy and infrastructure code with Checkov, verified encryption at rest and in transit, tested tenant isolation across the API, and looked at the AI layer specifically: what goes into the model, what comes out, and whether anyone could reconstruct a given answer afterwards.

The checks found 2 critical, 4 high and 3 medium issues. The two critical ones were the token lifetime and the cross-tenant document endpoint.

What Was Found and Fixed, by Milestone

Milestone 1 - Application security and observability (weeks 1-2)

  • Access tokens cut from 7 days to 8 hours, one work shift. Short enough to defend to a security team, long enough that users are not logging in every hour.
  • The cross-tenant document endpoint fixed with entity-scoped query filters, so a document request only ever returns the caller’s tenant’s data.
  • Public API documentation (Swagger and ReDoc) removed from production.
  • 7 HTTP security headers added at the NGINX layer.
  • 8 CloudWatch alarms covering security and infrastructure, application log groups with retention, and health and readiness endpoints for Kubernetes probes. The detail is in the monitoring section.

Milestone 2 - EKS and AWS hardening, data protection (weeks 3-4)

  • 6 Kubernetes deployments hardened: run as non-root, all Linux capabilities dropped, privilege escalation disabled, RuntimeDefault seccomp profiles.
  • 0 critical findings in the Trivy container scans.
  • An access-control matrix documented, with admin access limited to named accounts.
  • Encryption verified for object storage, the database at rest, and TLS in transit.
  • Tenant isolation tested across all API paths. A separate isolation gap in the RAG pipeline’s vector store was identified and documented for the client.

Milestone 3 - Audit trail and AI/LLM security (weeks 5-6)

  • An audit trail covering 12+ critical actions - authentication events, document changes and AI queries - with a request ID carried through every service, and logs kept append-only for 365 days. I chose CloudWatch here because individual log events cannot be edited or deleted, which is the property a pharmaceutical buyer asks about.
  • Input guardrails for prompt injection, role manipulation, jailbreak attempts and data-exfiltration patterns, and output guardrails for personal data and credentials or secrets, validated by 15+ test cases. Each guardrail can block or only log, so sensitivity could be tuned in production without a deploy.
  • Every model call traced to its tenant, user and request, with latency and token counts.
  • A compliance gap memo mapping the platform against SOC 2 Type II, ISO 27001 and FDA 21 CFR Part 11. It is a gap memo: it says which technical controls exist and what is still missing. It is not a certification.

Milestone 4 - Load testing, disaster recovery and handover (week 7)

  • Load tested at the pilot target of 5 concurrent users: 0.98% error rate, with all the statement of work’s targets met. Autoscaling configured for the application, frontend, workers and cluster.
  • Backup and restore drilled: about 45 minutes end to end, against a target of under an hour. Kubernetes rollback validated at under 2 minutes.
  • 10 operational runbooks, including CPU, database, Redis, certificates, nodes, workers, guardrails and rollback.

What It Took to Get to Pilot Approval

Most of the fixes were not difficult. What got the platform approved was that every one could be shown. Each milestone had written deliverables in the statement of work - 22 in total - and each was closed with evidence: a pull request, a scan result, a test run, a drill log. Delivery was pull-request only: 17+ pull requests, 7 of them in the first milestone, and no change reached the codebase any other way.

A few decisions mattered more than the rest:

  • Harden the existing tenant isolation rather than rewrite it. A move to database row-level security was the riskier change to make before a pilot. Tightening the entity-scoped filters and then testing every API path closed the hole.
  • Use CloudWatch instead of adding a third-party APM: no marginal cost, and most of what an APM would have given.
  • Make the guardrails configurable. A guardrail that blocks too much gets switched off. A switch between logging and blocking lets sensitivity be tuned against real traffic.

The platform went from “functional but not production-ready” to approved for enterprise pilots in 7 weeks.

Monitoring: Alarms, Health Checks and Reports at Intervals

Every live application fails at some point. What decides the cost is how long it takes someone to notice, and whether that person knows what to do next. At the start this platform had no central logs, no alerts and no health checks, so the first sign of a fault would have been a customer. For any system going live, this is the work I would put first.

Set up before the pilot

  • 8 alarms, each emailing named people. Five watch for security events: repeated failed logins, forbidden-access attempts, reads of stored secrets, changes to access roles, and pod creation in the cluster. Three watch the infrastructure: database CPU, database connections, and unhealthy hosts behind the load balancer. Each has a threshold, for example more than 10 failed logins in 5 minutes.
  • Proven to fire. The statement of work asked for at least eight alerts configured and shown to trigger. One was captured in its alarm state as that proof, and the email subscriptions were confirmed by the people receiving them.
  • Central logs. Four application log groups (API, authentication, background jobs and errors) kept for 12 months, plus the cluster’s control-plane logs with 8 metric filters feeding the alarms.
  • Health and readiness endpoints, so Kubernetes restarts a process that has died and keeps traffic away from one that is not ready.
  • 10 runbooks for the failures most likely to wake someone: CPU, database, Redis, certificates, nodes, workers, storage, document processing, guardrails and rollback. An alert is only useful if the person who gets it knows the first steps.

Watching the live pilot

After approval the client kept me on for the pilot as a separate monitoring engagement, about ten weeks from go-live. It ran on a fixed rhythm, so a health report arrived whether or not anything had gone wrong:

  • Three scheduled review windows a week, each covering the same six inputs: application error logs, API error rates, latency, resource use, background-job failures and deployment anomalies.
  • Reports at intervals: a weekly health check, a written monthly report, and a closing summary of the risks and readiness gaps seen.
  • A response commitment: critical issues answered the same business day, others the next. Each incident was written up with what happened, its severity, the downstream impact and a recommended fix, then routed to the client’s developer.

What that caught:

  • 12 issues surfaced over the pilot. The serious application bugs were diagnosed, reported and fixed by the client’s engineers within one release cycle.
  • A fault fixed the same day. A user reported that uploads were not producing their download files. I traced it to a configuration setting, and the client’s developer shipped the fix that evening.
  • Automated probing of the API. Bots were scanning for exposed files and credentials. Every probe returned 404 and nothing was exposed; I recommended rate limiting and a web application firewall before commercial launch.
  • A blind spot in the monitoring itself. Logs from the web workers and 15 application loggers were being dropped without any error. Once that was fixed, visibility was complete for the rest of the pilot.
  • A slow page traced to its cause. The document list took 4 to 5 seconds because the database sat in a different region from the application. A migration was scoped.
  • A stable finish. Application errors were effectively zero over the final two weeks, and every production service ran the final 28 days with zero restarts.

My role in the pilot was to watch, triage and recommend. The client’s engineers owned the fixes and the production system throughout.

Evidence

None of this evidence is public. The client is under NDA, so the table says how each claim was verified and where the evidence sits, rather than linking to it.

Claims, how each was verified, and where the evidence is
ClaimHow verifiedWhere
26 checks run; 2 critical, 4 high and 3 medium findingsSecurity assessment report, accepted by the clientPrivate, under NDA
Both critical and all four high findings fixedMerged pull requests, accepted against the statement of workClient repository, private
22 of 22 contracted deliverables completed across 4 milestonesProduction readiness checklist, each deliverable linked to its evidenceEngagement record, private
0.98% error rate at the pilot target of 5 concurrent usersLoad test report, accepted by the clientPrivate, under NDA
About 45-minute restore against a target under 1 hour; rollback under 2 minutesBackup/restore drill and rollback test, accepted by the clientPrivate, under NDA
Approved for enterprise pilot deploymentClient decisionNot public
8 alarms with email notification, configured and shown to triggerMilestone report with alarm and notification screenshots, accepted by the clientPrivate, under NDA
Pilot monitored for about ten weeks: weekly health checks, a monthly report and a closing summaryThe reports themselves, delivered to the clientPrivate, under NDA
12 issues surfaced in the pilot; zero restarts across the final 28 daysPost-pilot summary, delivered to the clientPrivate, under NDA
SOC 2, ISO 27001 or 21 CFR Part 11 certificationNot claimedNone
Penetration testNot claimedNone

What This Does Not Claim

No certification, no penetration test, no round-the-clock cover and no public evidence. The full list of limits is below.

The eight limits, in full
  • No certification. The platform is not SOC 2, ISO 27001 or 21 CFR Part 11 certified on the strength of this work. The memo identifies gaps; a formal audit or validation is a separate step for the client and an accredited auditor.
  • No penetration test. This was a structured security and architecture assessment, not an adversarial test by a specialist firm.
  • Not every finding was fixed. The critical and high findings were. I do not claim the same for the three medium ones, for every Checkov finding, or for the vector-store isolation gap, which was documented rather than closed.
  • Pilot scale, not production scale. The load test was at the pilot target of 5 concurrent users.
  • No round-the-clock cover. The pilot monitoring was scheduled review windows on business days, not 24/7 on-call.
  • No measured response time. Alarms, health checks and regular reports shorten the path from a fault to its fix. I did not measure by how much, so no figure is given.
  • Stable at pilot load only. The pilot’s clean finish says nothing about commercial load, and the closing summary told the client so.
  • The evidence is private. You are taking these figures from me, not from a public artefact.

Who This Is Relevant For

AI SaaS teams in the UK, US and Europe who are about to put a regulated buyer’s data into a multi-tenant product - pharma and life sciences especially - and have a pilot, a security questionnaire or a procurement review between them and the contract. The platform is usually fine. What is missing is tenant isolation someone has tested, an audit trail, guardrails on the model, and evidence for each.

The shorter version of this work is the AI security and architecture review: the same checks and a prioritised list of fixes, from £2,000 over 1-4 weeks. If you need someone to stay and fix things as well, as here, that is a fractional AI CTO engagement.

Request a security review →

Related reading: the LLM security checklist lists the checks behind an assessment like this one; multi-tenant RAG isolation covers the vector-store gap; prompt injection defence for RAG covers the input guardrails; what to log in an LLM audit trail covers milestone 3; and validating an LLM system under 21 CFR Part 11 covers what comes after a gap memo.

Ready to discuss your AI project?

Built with AI tools, or by a developer you can't fully check? Book a 45-minute call, at no charge, and find out what to check first. Or if you already have a codebase, get an instant architecture report at SystemAudit.dev No technical knowledge needed, results in 3 minutes.

Or describe your project in the chat, or email nic.chin@nicchin.com

About the Author

Nic Chin is an independent AI consultant and fractional CTO who helps companies design and deploy production AI systems including RAG pipelines, multi-agent systems, and AI automation platforms. He has delivered enterprise AI solutions across the UK, US, and Europe, and works with companies as an AI consultant in the UK and the US.