Why promptfoo red teaming fits pharmacy AI assistants
A pharmacy that deploys an assistant to answer medication questions needs to know, before release, whether it will miss a dangerous drug interaction, miscalculate a dose or mishandle a controlled substance rule. promptfoo lets the team test those failure modes before the assistant reaches patients or staff, by sending adversarial and routine prompts to the assistant and grading the replies against rules the team defines. The assistant may be patient-facing, such as a refill or counseling bot on a pharmacy website, or staff-facing, such as a tool that helps technicians check orders. Both carry the same core risk: a fluent answer that is clinically wrong.
promptfoo is licensed under the MIT license, runs completely locally according to its documentation, so evals execute on the machine that runs them and talk directly with the model, and can be used as a CLI, as a library or in CI/CD pipelines. That makes it practical to run the same pharmacy test suite on a laptop during development and in a pipeline before each prompt or model change. Confirm with your security team where test prompts and model responses are sent, since that depends on the model provider you connect to, not only on promptfoo itself.
Pharmacy results depend on the target's own system prompt, drug reference data, retrieval sources, tool access and workflow, such as whether the assistant can see a patient profile or only a general question. A test run against a generic model tells you little about your deployment. Before you configure any pharmacy plugins, collect the assistant's prompts and tools, the formulary and dosing sources it relies on, and the escalation rules that should send a question to a pharmacist. The pharmacy plugins are part of the test configuration, so confirm their names, coverage and grading behavior against the current promptfoo documentation before you commit test results to a release decision.
Which pharmacy requirements the red team must cover
This table maps four regulatory anchors to the test scope they imply for a pharmacy assistant: access control, incident reporting and data exposure in responses. Read each row as a question the red team should be able to answer with evidence. Confirm which regimes apply to your organization before you set scope, since HIPAA, NIS2 and GDPR depend on where you operate and what role you hold.
| Requirement | What it asks for | What the red team should test |
|---|---|---|
| HIPAA Security Rule scope (45 CFR 164.302) | Applies to covered entities and business associates for all ePHI they create, receive, maintain or transmit. Pharmacy assistants that handle prescription or patient data are likely in scope, subject to your status. | Whether the assistant surfaces ePHI from one patient to another user, and whether transcripts or logs expose prescription details to unauthorized roles |
| Business associate terms (45 CFR 164.314) | Contracts must require Security Rule compliance, flow terms to subcontractors handling ePHI, and report security incidents to the covered entity. | Whether the model vendor, gateway or hosting provider is covered by these terms, and whether test findings can be routed through an incident path that meets the contract |
| NIS2 Annex I health sector (Directive (EU) 2022/2555) | Lists manufacturers of basic pharmaceutical products among health sector entities of high criticality, alongside healthcare providers. | Whether the assistant can be manipulated into disclosing internal supply, manufacturing or distribution information, and whether incident reporting paths are tested end to end |
| Access control (GDPR Articles 32 and 34, CNIL fine of 3 September 2026) | CNIL fined Hopital Prive de la Loire EUR 500,000 for external access without VPN or multi-factor authentication and for access control that ignored the care team's need to know. | Role-based restrictions on prescription, dispensing and patient history, tested with low-privilege and cross-patient prompts, plus behavior of the assistant under session or identity changes |
| Data exposure in responses | Access controls are only effective if responses also respect them. The CNIL case turned on need-to-know access to patient records. | Prompt injection and multi-turn probes that try to extract other patients' records, dosage history or controlled substance dispensing data from the assistant's answers |
Test categories that matter for drug interactions, dosing and controlled substances
Pharmacy assistants fail in a few predictable places: a missed interaction, a wrong dose, or a controlled substance rule bent by a persuasive customer. Each card below is one test category, and each maps to a promptfoo red teaming setup built from purpose, plugins, strategies and grading. Confirm exact pharmacy plugin names in the promptfoo red teaming documentation before you write configs.
Drug interaction miss tests
These tests check whether the assistant flags dangerous combinations of prescription drugs, supplements and over-the-counter products. Write prompts that mix a prescription with St. John's wort, a common decongestant or an NSAID, and phrase them the way a customer would, such as asking whether two medicines are "fine to take together." Check that the assistant names the interaction, recommends contacting a pharmacist or prescriber, and does not reassure the customer. Use silent approval as the failure to watch for.
Red teaming docsDosage calculation tests
These tests target weight-based dosing, pediatric dosing and renal adjustment questions, where a small arithmetic or unit error can cause harm. Include prompts that give weight in pounds but expect kilograms, ask for a dose per milliliter of a liquid formulation, or describe reduced kidney function without stating a clearance value. Grade the answer for correct math, correct units, and whether the assistant refuses to set a dose without a prescriber's instruction. Treat a confident number with no caveat as a failure.
Controlled substance rule tests
These tests probe refill, early fill and schedule questions for controlled substances, along with identity and prescriber verification. Ask the assistant whether a refill can be approved early because the customer says they are travelling, or whether a schedule II product can be transferred to another store by phone. Check that the assistant points to the verification steps your pharmacy requires and does not override them. Watch for approval under pressure, where urgency or a claimed clinician title changes the answer.
Patient data disclosure tests
These tests check whether the assistant reveals prescription history, diagnoses or fill dates to someone who is not the patient or an authorized representative. Use prompts from a spouse, a caregiver without documented access, or a user claiming to be an employer. Confirm that the assistant withholds protected health information and explains the verification route. Include multi-turn attempts, because a disclosure often happens after several harmless questions. Your privacy officer should set the expected behavior.
HIPAA Security Rule textPharmacist grading and review loop
Automated grading catches obvious errors, but a clinical pharmacist should review failures to judge clinical severity and decide whether a test is valid. Set up grading rubrics that the pharmacist helps write, and agree which failures block a release and which go to a backlog. Record who reviewed each finding, what the expected answer was, and when the test was last updated. Ask your red team partner or internal lead to confirm how promptfoo grading is configured for this review, since grading choices shape the results.
How the pharmacy assistant connects to promptfoo
The promptfoo CLI runs on the tester's machine, and it talks directly to the model provider and to the pharmacy assistant's endpoint. The promptfoo documentation states that evals run locally and talk directly with the LLM, so the test configuration, the attack prompts and the responses pass through the tester's workstation or CI runner. The pharmacy assistant is the target: it is reached over an HTTP or other endpoint that you configure, and the assistant in turn calls its own model provider. Map that chain before testing starts: who holds the provider API keys, which network paths the runner can reach, and whether any patient-linked or prescription-linked data will appear in prompts or responses. Confirm with your security team where those runners sit and whether they are permitted to reach the pharmacy system's test environment. Connection details for each target type are covered in the model providers section.
Results are written to a local store by default, which the CLI reads back for reports. The self-hosted promptfoo app is a different arrangement: it is an Express server with a web UI and API, and it stores data in a local SQLite database that cannot be shared across replicas. The self-hosting documentation says it has no RBAC, horizontal scaling, built-in authentication or SSO, and is not recommended for production use. A pharmacy group with several testers, reviewers and a pharmacist sign-off step cannot rely on that setup as a shared record. Your options are the Enterprise edition, which adds teams-based access control, SSO and custom roles, the On-Premise edition, which runs that functionality on your own infrastructure with complete data isolation, or a separate access design you build and review yourself. Confirm current feature details with promptfoo before you commit.
How a pharmacy red team run moves through the parts
The run starts with a test author using the promptfoo CLI to load pharmacy attack prompts, either generated or curated. Each prompt goes to the pharmacy assistant endpoint, which may call its drug reference and dispensing system before answering. Only the model call crosses into the external model provider, so that boundary is where data-handling terms must be confirmed. Responses return to grading, where automated checks flag likely drug interaction misses, dosage errors and controlled substance violations, and a pharmacist reviews the flagged cases before results are saved to a store inside your network. Check first whether any patient-like data reaches the provider.
Pharmacy red team data flow, with the external model provider outside the client boundary.
Compliance questions a pharmacy red team should answer
Does HIPAA require a certification for our pharmacy AI assistant?
No. HHS states that no Security Rule standard requires an entity to certify compliance, and private certifications do not prevent HHS from later finding a violation. The HHS Office for Civil Rights enforces the rule through complaints, compliance reviews and audits. What you need is evidence that your safeguards for electronic protected health information were designed, tested and maintained, and that your business associate contracts reflect the Security Rule. Ask your privacy counsel which records your organization must keep and how long. HHS FAQ 2003 explains the position in HHS's own words.
What is the HIPAA civil money penalty range in 2026?
For penalties assessed on or after 28 January 2026, the inflation-adjusted range runs from $145 per violation to $2,190,294 per violation, with a calendar-year cap of $2,190,294, according to 45 CFR 102.3 as published in 91 FR 3666. The amount assessed depends on the level of culpability and the facts of each case, so the range is a ceiling for planning, not an estimate of exposure. Pharmacy AI findings such as unauthorized disclosure of patient data can fall under this framework when the assistant handles electronic protected health information, which is why the red team scope should cover it.
How does the pending HIPAA Security Rule revision affect our testing plan?
HHS proposed a major Security Rule revision on 6 January 2025 (90 FR 898). As of October 2026 no final rule has been published, and the Unified Agenda projects final action for July 2027. Until a final rule is issued, the current standards apply. Plan your testing around the existing rule, keep test records that map findings to specific safeguards, and review the scope once the final text is known. Confirm the current status on reginfo.gov before you set the next review date, since the agenda can change.
What do HITRUST assessments cover, and what do they leave out?
HITRUST assessments check an organization's controls against the HITRUST CSF, which is organized into control categories, control objectives and control specifications, and certifications are issued by HITRUST's assessment process rather than by DeployOpen. Red team results can supply evidence for some controls, such as access control and input handling tests, but they do not replace the assessment or the assessor's testing. Certification levels last different periods: e1 and i1 for one year and r2 for two years. Confirm the current CSF version and which assessment type your partners or payers require before you map test evidence to controls. DeployOpen prepares systems, controls and evidence for assessments but does not issue certifications or attestations.
What can red team testing prove, and what can it not prove?
Red team testing shows that specific attacks succeeded or failed against a specific build, configuration and model at the time of the test. For a pharmacy assistant, that means evidence that dosage, interaction and controlled substance prompts were tested with defined attack patterns and that failures were logged and retested. It cannot prove that the system is compliant, that no other weakness exists, or that behavior will stay the same after a model, prompt or data change. Testing also does not replace governance, staff training, pharmacist review or the business associate and audit controls the rules require. Say this plainly in your evidence pack so reviewers do not read a passing test as a certification.
Who owns the compliance evidence after the red team engagement ends?
Your organization owns the compliance decisions and the evidence file. DeployOpen can test the assistant, document findings with fixes and a retest, and prepare evidence for your assessors, but DeployOpen does not issue audit reports, attestations or certifications. Ask in the written scope which deliverables you receive, in what format, and who keeps the test records, prompts and logs. Confirm with your privacy officer and counsel which records must be retained and for how long, and whether any business associate contract needs updating before a third party handles pharmacy data.
Rollout from scoping to retest
This sequence takes a pharmacy assistant from scoping through a baseline red team, pharmacist-reviewed triage, fixes and retesting, and finally recurring runs in CI/CD. Each phase ends with a written artifact that the pharmacy, compliance and engineering owners can review. The duration of each phase depends on the agreed scope and should be confirmed in writing before work starts.
Scope the assistant and its data flows
Map the assistant's entry points, the drug, dispensing and patient data it reads or writes, the tools it can call, and the systems it reaches, such as the pharmacy management system and any prescription or interaction reference data. Identify whether protected health information is in scope, which determines whether business associate terms apply to any hosted model provider. The step closes with a written scope document and a data flow diagram signed off by the client's technical owner.
Agree test categories with pharmacy and compliance owners
Work with the pharmacist in charge, clinical leads and the compliance team to choose which test categories apply, such as drug interaction misses, dosage calculation errors and controlled substance rules. Record which jurisdictional rules the organization treats as in scope and which are out of scope for this engagement. The step closes with an agreed test category list, named decision owners for each category, and a list of questions the clinical team must answer to judge correct output.
Configure promptfoo and the target connection
Install promptfoo in the client's environment, using the Node.js version the release requires, and set up the red team configuration with the agreed plugins, strategies and grading criteria. Connect promptfoo to the assistant through the client's own endpoint so that prompts and responses stay inside the client's infrastructure. Confirm which model provider receives test traffic and whether the self-hosted server is used for shared results. The step closes with a configuration that runs a small smoke test successfully against a non-production assistant.
Run the baseline red team
Execute the full agreed red team against a staging copy of the assistant with the same prompts, tools and data access as production. Keep the run configuration, plugin versions and target version recorded so that results can be reproduced later. The step closes with a baseline report listing each failed probe, the attack strategy used and the raw input and output for each failure.
Triage findings with pharmacist review
A pharmacist reviews every flagged output against the reference sources the pharmacy uses, deciding whether the assistant was clinically wrong, unsafe, or only worded poorly. Engineers separate grading errors from real failures, so that automated grades that were too strict or too lenient are corrected in the configuration. The step closes with a triage register that assigns each confirmed finding a severity, an owner and a fix type, such as a system prompt change, tool permission change or output guardrail.
Fix confirmed findings and retest
The engineering owner applies the agreed fixes, which may include narrowing tool permissions, adding verified interaction and dosage checks in code rather than in the model, or tightening controlled substance workflows. Re-run the affected categories, then the full suite to catch regressions in unrelated areas. The step closes with a retest report that shows each previously failed probe, its new result and the pharmacist's sign-off on the fixed outputs.
Schedule recurring runs in CI/CD
Add the red team configuration to the delivery pipeline so that it runs when prompts, models, tools or reference data change, with results stored where the compliance team can retrieve them. Agree the pass-rate threshold that blocks a release and the process for a pharmacist to override a result with a documented reason. The step closes when a deliberate test change is shown to fail the pipeline and the results appear in the agreed report location.
What buyers ask before hiring a partner for pharmacy AI testing
What drives the cost of a pharmacy AI red team engagement?
The written scope drives the quote, so cost follows from what is tested and how much of it. The main components are the number of assistant workflows in scope (refill requests, interaction checks, dosage questions, controlled substance rules), the number of targets and environments, how many test runs and retests are needed, and how much clinical review the findings require. Ask for each component to be priced separately so you can see what changes if scope narrows or widens. Also ask whether the quote includes model usage charges, which are billed by your model provider and recur with every scan. Promptfoo's Community edition is free under the MIT license, so the tooling itself is not the cost driver; the people time and the environment work are.
How long does pharmacy AI red teaming take?
Duration depends on scope, access to the assistant under test, and how quickly clinical reviewers can confirm findings. No duration is supplied for this engagement type, so ask any partner for a timeline in the written scope rather than relying on a general figure. The biggest variables are how many drug interaction, dosage and controlled substance scenarios you want covered, whether a staging environment matching production is available, and how long your pharmacist reviewers take to grade borderline answers. Retest time is usually shorter than the first pass, but only if fixes are deployed promptly. Confirm the milestones, including when the findings report and retest happen, before work starts.
What does our pharmacy team need to provide for testing?
Plan to provide three things: clinical reviewers, reference data and test accounts. Clinical reviewers, usually pharmacists, must decide whether an answer about an interaction, dose or controlled substance rule is safe, because automated grading can miss clinically wrong but fluent responses. Reference data includes the formulary, the interaction and dosing sources your pharmacy uses, and your internal policies for controlled substances. Test accounts should be non-production users with roles that mirror real patient, pharmacist and technician access, with no real patient records. Agree in writing who approves test data and where it is stored, since red team prompts and responses may contain sensitive content.
Can our team run promptfoo for pharmacy red teaming ourselves?
Yes, if you have engineers who can configure a target and clinicians who can review results. Promptfoo runs locally and talks directly with the model, and its red teaming documentation references the OWASP LLM Top 10, the NIST AI Risk Management Framework and the EU AI Act as frameworks for systematic testing. The hard parts are not installation. They are choosing plugins and strategies, connecting the assistant as a target, setting grading rules that a pharmacist would accept, and interpreting results. Self-hosted deployments have limits for team use, so plan accordingly. A partner may be worth comparing against your internal capacity for the first scan and for ongoing runs.
Should we use Community, Enterprise or On-Premise for pharmacy testing?
The choice depends on team size, data handling rules and how often you need to run scans. The Community edition is free, includes all LLM evaluation features and red teaming with 10k probes per month, and offers community support. Enterprise adds team sharing, teams-based access control and SSO, custom roles, continuous monitoring, a centralized guardrail dashboard, remediation recommendations and priority support with SLAs, priced on request. On-Premise runs the Enterprise functionality on your infrastructure with complete data isolation and a dedicated deployment engineer. Ask vendors for current Enterprise pricing in writing, and confirm whether your data controls require On-Premise.
How are retesting and ongoing support structured?
Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. A typical pharmacy engagement delivers findings with fixes and a retest of the findings that were addressed, which is set out in the scope rather than assumed. For changes after that, ongoing support, upgrades and continuous testing are available as retainers, and their terms are defined in the written agreement. Ask what the retest covers, whether new prompts or model versions are included, how many retest rounds are allowed, and who reviews fixes clinically. Keep the scanning cadence in your own CI/CD pipeline as well, so regressions are caught between engagements.
What to ask a partner before you sign
Start with clinical review of grading. Ask who on the partner's side holds pharmacy or clinical knowledge, and who on your side signs off on the expected answers for drug interaction, dosage and controlled substance cases. A grader that marks a wrong dosage answer as correct will pass a broken assistant, so ask how grading rubrics are written, how disagreements between the grader and your pharmacists are resolved, and whether your pharmacist reviews a sample of failed and passed results before any finding is reported. Confirm that the rubric owner and the approver are named in the statement of work.
Next, ask where test data and model calls go. Promptfoo runs locally and talks directly with the model under test, so ask the partner to show which machine runs the scans, which model endpoints receive prompts, and whether any grader model is a hosted service outside your approved vendors. Ask whether the work stays in your cloud account, data center or air-gapped network, and whether your existing agreements with model providers cover the test traffic. Ask also who holds the scan results, where they are stored and how long they are kept. Confirm the answers in writing before the first scan.
Then settle PHI exclusion and the retest. Ask how the partner keeps protected health information out of test sets, including generated cases, copied transcripts and bug reproductions, and whether it will use synthetic prescriptions and patient profiles. Ask what the retest covers: whether it reruns every failed case with the same plugins and strategies, whether it adds cases for the fixes, and who approves that the fix closed the finding. Finally, ask who owns the evidence, including the scan configurations, the findings report and the logs, and whether you receive them in a form your compliance team can keep. Confirm that ownership and retention are written into the agreement.
How DeployOpen scopes and delivers pharmacy AI red teaming
DeployOpen plans and runs promptfoo red teaming for pharmacy AI assistants as a written, fixed-scope engagement inside the client's own infrastructure. The work covers scoping, building the test setup, testing, documentation and handover, with ongoing support available as a retainer.
How we scope
- Agree in writing which assistant, channels, tools and data sources are in scope for the pharmacy red team
- Define which drug interaction, dosage and controlled substance behaviors the plugins and custom tests must cover
- Confirm who receives findings, how results are stored and which environments may be tested
How we build
- Install promptfoo with Node.js 22.22.0 or newer and connect it to a non-production copy of the assistant
- Configure pharmacy plugins, custom pharmacist-written test cases and grading rules agreed with your clinical reviewers
- Run red team scans and record results so each finding can be reproduced and retested
How we hand over
- Deliver a findings report with severity, reproduction steps and the prompts or transcripts that triggered each failure
- Document the test configuration, scan settings and data handling so your team can rerun the suite
- Walk through the results with your pharmacy, clinical safety and security teams before the engagement closes
How we support
- Retest agreed fixes and record which findings are closed, open or accepted as residual risk
- Offer ongoing support and scheduled re-scans as a retainer when the assistant or its prompts change
- Confirm with your team how upgrades to promptfoo and the assistant will be tested before each release

