Judgment where it helps, rules where it counts
The model does the one thing rules cannot: read an unfamiliar document and say what it is. Everything that decides an outcome stays deterministic, testable and explainable.
A governed multi-agent workflow that checks whether a clinical-study evidence package is complete and traceable, then hands it to a person. The model proposes. Deterministic rules decide. A human always makes the call.
{
"status": "NOT_READY_FOR_HUMAN_REVIEW",
"human_review_required": true,
"missing_requirement_ids": ["REQ-003"],
"blocking_findings": [
"No complete evidence available
for REQ-003"
],
"rules": {
"all_required_..._complete_evidence": false,
"no_blocking_quality_findings": false,
"human_review_required": true
}
}
The request
Agents analyze. Rules validate. Humans decide.
Before a clinical-study package reaches a qualified reviewer, someone has to check the basics: is the protocol there, are the device verification results there, is the adverse event reconciliation record there and signed off, is the site completion summary there? It is tedious, easy to get wrong, and a natural job for AI, if the AI can be kept on a short leash.
The brief was a reference implementation an enterprise could reuse, with firm boundaries:
How it was delivered
The repository carries the intent, the rules, the fixtures and the proof, so the next agent starts from what already works.
intents/Feature.md set the agent roles, their “must not” lists, six release rules and the only two allowed verdicts before any code was written.
AI-assisted engineering produced the orchestrator, five workers, the intake prompt, the upload page and the AgentCore entry point, each scoped to its permission list.
Tests decided what stayed: three synthetic PDF scenarios, plus malformed replies, bad statuses, provider errors, invented IDs and duplicates.
Every step writes a JSON artifact. Docs record what is verified, what is not, and the order of the next work, so nothing is rediscovered.
A fail-closed validator, a response model that only allows two statuses, document text treated as data, and synthetic data only.
The agentic workflow
One orchestrator owns the workflow state. It builds each agent’s input by hand from that agent’s read permissions, records what comes back, and moves on. No agent sees another agent’s working notes, a chat history, or anything it was not given.
One call per PDF. Proposes which requirement the document is evidence for, and whether it presents itself as final.
document-intake.jsonNormalizes the protocol requirements into a structured checklist the rest of the run can count against.
requirements.jsonMaps every requirement to the documents that claim to support it, carrying source file and status.
evidence-map.jsonRaises blocking findings for missing evidence, drafts, duplicate evidence IDs and unknown requirement IDs.
quality-findings.jsonPrepares the handoff: coverage counts, unresolved issues, and the decision boundary in plain words.
review-summary.jsonThe only code that sets the status. Ready only if every required item has final evidence and nothing is blocking.
validation-result.jsonScenario 3, from upload to verdict. Every step below left a file on disk that a reviewer can open.
incomplete.NOT_READY_FOR_HUMAN_REVIEW, naming REQ-003.The guardrails
The model is the one step that can surprise you, so its boundary is where the design is strictest. Anything the intake agent cannot trust becomes “no requirements, incomplete”. A model that invents a requirement is not quietly corrected: the made-up ID is passed through so the Quality step blocks it in plain sight.
NOT_READY_FOR_HUMAN_REVIEW.The output
Drop a folder of PDFs on the upload page and get a verdict with its reasons. These are the real results for the three synthetic scenarios that ship with the repository.
The evidence
| 21 tests passing | VERIFIEDThe full suite passes in mock mode with no credentials: the workflow, the three PDF scenarios, the upload endpoint, both runtime adapters and the AgentCore entry point. |
|---|---|
| Fails closed on bad model behavior | VERIFIEDTests feed the intake agent non-JSON, a wrong field type, an “approved” status, an invented REQ-999 and a provider exception. Every one ends in NOT_READY_FOR_HUMAN_REVIEW. |
| Same answer locally and in AgentCore | VERIFIEDA test runs the local and AgentCore adapters on the same package and checks that the domain result is identical. |
| AgentCore package builds | VERIFIEDagentcore package produces a CodeZip that serves /ping and /invocations correctly on Linux ARM64 with Python 3.12. |
| Real Bedrock error path | VERIFIEDA live Bedrock call that AWS rejected was caught per document, and the package was marked not ready. |
| Claude classification quality | NOT YETThe Bedrock provider is code complete, but model access is not enabled on the AWS account, so accuracy has not been measured. A labeled evaluation set is the next step. |
| AWS deployment | NOT YETThe deploy dry run needs CloudFormation permissions for the deploying identity. Nothing is claimed as deployed until it is. |
The architecture
Only agentcore_app.py imports the AgentCore SDK, and only the Bedrock provider imports the Bedrock client. The clinical workflow depends on small platform contracts, so moving to another runtime or model vendor is an adapter, not a rewrite.
Why it matters
The model does the one thing rules cannot: read an unfamiliar document and say what it is. Everything that decides an outcome stays deterministic, testable and explainable.
Six JSON artifacts per run tie every verdict to a requirement ID, an evidence ID and a source file. A reviewer or an auditor can follow the reasoning without asking the AI to explain itself.
Orchestration, providers and runtime adapters are shared. The next use case should bring only its requirements, an intake prompt, its rules and labeled test documents, not a new platform.
From a written intent to a governed, tested multi-agent workflow, with fail-closed rules, an audit trail for every run, and a clear line where the human takes over.
Talk to RepogenicReference implementation on synthetic data only. It checks package completeness and traceability; it does not make clinical, safety or regulatory decisions.