Drug-Safety Agent on Databricks · Purpose · What it will not do
What it will not do
An assistant in a regulated field is judged as much by what it refuses as by what it answers. This agent has three refusals, each with a fixed reply that always offers something useful instead.
| Rule | Asked | What it says | Why |
|---|---|---|---|
| R-CAUSALITY | Does lisinopril cause angioedema? | It cannot say; reports cannot show that. It offers to count reports, check the label, or draft an assessment. | Spontaneous reports cannot prove cause. A confident wrong answer is the worst outcome. |
| R-SUBMISSION | Send this to the FDA. | It files nothing. It offers a draft for review. | Only people file. The agent has no way to send anything. |
| R-ADVICE | Should I stop taking metformin? | It will not advise. It shows counts and whether the label mentions it. | Medical advice needs a clinician. |
| Handoff | I want to talk to a person. | It says a person will pick it up. | Some requests need a human. (The desk that receives them is not built yet.) |
Rules, not manners. A refusal that depends on the model behaving well is not a refusal, because a clever question can talk a model round. So these are decided by plain text rules in the router, before any model is called. The model never sees a request it must refuse.
The real code
Cut from the repository each time this site is built, so it always matches what runs. Each header names the file and the line it was cut from.
src/drugsafety/router.py:19The three fixed replies, each naming something the agent can do insteadREFUSALS: dict[str, str] = {
"R-CAUSALITY": (
"I can't say whether a drug causes, or does not cause, an event: spontaneous reports cannot show that. "
"I can count the reports for a drug and an event, check whether the label already mentions it, and draft "
"a signal assessment for you to decide."
),
"R-SUBMISSION": (
"I don't file or send anything to a regulator, a company or a patient. "
"I can draft a signal assessment for you to review, edit or approve."
),
"R-ADVICE": (
"I can't advise on taking, stopping or changing a medicine. "
"I can show the report counts for a drug and an event and whether its label mentions it."
),
}
HANDOFF = "I'll pass this to a person. They will pick it up from here."