AWS Builder Center
Building BeforeBell for Agents for Humans: Autonomous School Coverage with Human Judgment

Building BeforeBell for Agents for Humans: Autonomous School Coverage with Human Judgment

How I built BeforeBell, a school-operations agent that coordinates teacher-absence coverage with Strands Agents and Amazon Bedrock AgentCore, while deterministic policy controls routine decisions, human judgment handles exceptions, and DynamoDB preserves authoritative workflow evidence.

The problem I wanted to solve

A teacher calling in absent before the school day starts might sound like a simple problem until you actually think about everything that needs to happen afterwards.
Someone has to figure out which periods are affected, identify teachers who are eligible to cover them, check their availability and workload, make sure there are no conflicts, respect protected planning periods, confirm the coverage, and also know when the situation has gone beyond what should be resolved automatically.
That was basically the problem I wanted to solve with BeforeBell.
BeforeBell is a school operations agent I built for the Agents for Humans Hackathon. The idea is simple: routine decisions should happen automatically, while decisions that genuinely require human judgment should remain with humans.
That is also why I entered it in the Good Neighbor Agents track. Schools are one of those environments where what looks like a small operational issue can quickly affect a lot of people if it is not resolved early enough.
The principle behind BeforeBell is:
Safe routine decisions happen automatically. Judgment stays human.

I did not want to build another chatbot

One of the first decisions I made was that BeforeBell should not just sit there and tell an administrator what could be done.
I wanted it to actually do the work.
For a normal coverage case, BeforeBell should be able to identify the affected periods, evaluate eligible teachers, check availability and workload constraints, detect conflicts, create a safe coverage plan, persist routine assignments, respond when someone accepts or declines, replan when necessary, and keep evidence of everything that happened.
But I was also very intentional about one thing: I did not want the AI model itself to become the policy engine.
Things like eligibility, protected planning periods, assignment safety, conflicts, workflow invariants, and final state transitions should not depend on whatever an AI model happens to think at that moment.
Those parts are deterministic.
The agent coordinates the workflow and can reason about what needs to happen, but the application logic owns the rules that must remain predictable and testable.
That separation became one of the most important architectural decisions in the project.

How AWS and Strands fit into the architecture

The main flow is:
Next.js application → BeforeBell server gateway → Amazon Bedrock AgentCore Runtime → Strands Agent
The Strands Agent was built with the Strands Agents SDK and coordinates the workflow.
It can use an Amazon Bedrock model for reasoning and natural-language understanding, but when something policy-sensitive needs to happen, it invokes deterministic BeforeBell tools instead of allowing the model to directly decide what the application state should become.
Those tools handle things like:
  • finding the best eligible coverage candidate;
  • checking eligibility;
  • detecting conflicts;
  • proposing coverage plans;
  • creating routine assignments when policy permits; and
  • identifying situations that have crossed a policy boundary.
The authoritative application state is stored in Amazon DynamoDB.
Cases, assignments, policies, human decisions, and workflow events are persisted there.
This part was important to me because I did not want the UI to display something simply because an assistant said it happened.
The dashboard should be able to read the actual persisted state and show what really happened.
That eventually became another principle in the project:
Evidence, not inference.

The part where I deliberately stop the agent

The most interesting BeforeBell scenario is actually one the agent cannot finish by itself.
For the demo, I created a synthetic scenario where Daniel Reed, a Grade 7 Science teacher, is absent for periods P2, P3, and P5.
BeforeBell can safely cover P2 and P3 using the normal policy.
P5 is different.
Resolving P5 would require crossing a protected planning boundary, so I did not want the agent to simply pick whichever option looked convenient and continue.
Instead, the deterministic policy layer identifies that the normal workflow can no longer safely finish the job, and the Strands workflow reaches a human-in-the-loop boundary.
The administrator is then presented with three permitted options:
  1. use a protected planning period for P5;
  1. request an external substitute for P5; or
  1. combine coverage groups for P5.
Even there, the browser is not allowed to invent an arbitrary coverage decision.
The administrator can only choose from the options returned by the trusted workflow.
For the demo, the administrator chooses to request an external substitute.
And this is where another rule became extremely important.

Approval is authorization, not execution

If the administrator approves the external substitute option, BeforeBell does not immediately pretend that P5 has been covered.
Approval simply means the administrator has authorized that path.
It does not mean the system has successfully executed it.
So, after the administrator approves the option, the case still remains only 2 out of 3 periods covered, and P5 still has no confirmed assignment.
A separate trusted fulfillment step has to confirm that the external substitute can actually be provided. Only after that happens does BeforeBell revalidate the approved action, create the P5 assignment, and move the case to resolved.
In the demo, Morgan Ellis becomes the substitute for P5.
This distinction might sound small at first, but I think it matters a lot once an agent is allowed to change real application state.
A human saying “yes, this is what we should do” and the system proving that the thing can actually be done are not the same event.
So I treated them as separate authorities.

Building an auditable workflow

I also wanted that separation to be visible in the actual evidence, not just in the UI.
The final Scenario B trace looks like this:
  • 06:09 — the agent requests human judgment;
  • 06:10 — the administrator approves the external substitute option;
  • P5 still remains unassigned, and the case stays 2/3 covered;
  • 06:12 — the trusted fulfillment path creates the assignment;
  • 06:12:01 — the case moves from partially covered to resolved.
Those are separate events because they represent separate responsibilities.
The administrator owns the judgment.
The trusted fulfillment step proves that the approved path can actually be executed.
The deterministic application layer owns the final assignment and state transition.
And DynamoDB preserves the evidence across all of those boundaries.
For me, that is much stronger than treating “human approved” and “system executed” as if they were the same thing.

What was actually difficult

The hardest part of BeforeBell was not getting an agent to produce a reasonable answer.
AI models can already do that pretty well.
The difficult part was making sure a reasonable answer could not automatically become an authorized state change.
That affected almost every part of the architecture.
I had to constantly think about questions like:
  • What information is advisory, and what information is authoritative?
  • Which part of the system is actually allowed to create an assignment?
  • What should happen when routine policy can no longer finish the job?
  • How do I prove that human approval happened before fulfillment?
  • How do I prevent approval itself from becoming execution?
  • What should the UI display while fulfillment is still pending?
  • What needs to be persisted so the workflow can later be reconstructed from evidence rather than generated narration?
The human-in-the-loop flow needed particular care.
The Strands Agent owns the orchestration and interruption. The model and deterministic tools can support the workflow, but they do not independently own HITL.
The exception path has to reach the agent-controlled interruption before an administrator gets to make the decision.
It might look like a small architectural distinction on a diagram, but it matters a lot when the system is capable of changing real application state.

Designing for things going wrong

I also did not want BeforeBell to only look good when everything goes according to plan.
A separate synthetic scenario handles a coverage candidate declining.
Once the decline happens, it becomes authoritative state.
BeforeBell does not continue as though the original plan somehow succeeded.
It replans without that candidate, evaluates the remaining eligible options, and continues safely.
That scenario reinforced something I think is easy to overlook when building agentic systems:
An agentic workflow needs explicit state, invariants, idempotency, and recovery semantics just as much as it needs reasoning.
The agent can coordinate the process, but the application underneath it still needs to know what is allowed, what has already happened, and what needs to happen next.

Testing the boundaries

Because BeforeBell performs state-changing workflow operations, I spent a lot of time testing it.
The project currently has:
27 test files and 186 automated tests.
The tests cover areas including:
  • coverage eligibility;
  • planning;
  • exceptions;
  • case state transitions;
  • invariants;
  • offer creation and responses;
  • assignment safety;
  • reconciliation;
  • idempotency;
  • DynamoDB persistence;
  • human exception decisions;
  • trusted fulfillment; and
  • end-to-end synthetic workflow scenarios.
Before preparing the submission, I reran the complete quality gate:
  • ESLint;
  • TypeScript validation;
  • the full Vitest suite; and
  • a production Next.js build.
All 27 test files and all 186 tests passed.
For me, the testing layer is part of the agent architecture itself.
If I am going to allow an autonomous system to perform operational work, then the boundaries around that autonomy should also have executable evidence proving that they work.

What I learned from building BeforeBell

The biggest lesson for me was that useful agent autonomy is not the same thing as giving the AI model control over as many decisions as possible.
BeforeBell actually became more trustworthy as I moved certain responsibilities away from the model.
The model helps with reasoning.
Strands coordinates the workflow, tools, and interruptions.
The deterministic safety layer owns policy-sensitive rules.
Administrators own exceptional judgment.
Trusted fulfillment proves that an authorized action can actually be executed.
DynamoDB owns the authoritative state and evidence.
Once those boundaries became clear, the entire system became much easier to reason about. It also changed the way I think about human-in-the-loop systems.
HITL should not simply mean showing an “Are you sure?” dialog before an autonomous action.
A human decision should have a precise meaning in the application state, and the system should still prove that the approved action remains valid before changing authoritative state.

Where I would take it next

BeforeBell is currently a hackathon prototype using synthetic school, teacher, schedule, and case data. The next stage would be connecting the same workflow boundaries to real production systems: authenticated school roles, durable and resumable interruptions, real scheduling and staff integrations, notification providers, and production-grade fulfillment adapters.
But the principle behind the architecture would remain the same:
The agent coordinates. Deterministic policy protects routine operations. Humans own judgment. State changes remain auditable.
And I think the opportunity goes beyond teacher absence coverage.
Schools have a lot of repetitive coordination work where administrators spend time moving information between people and different systems, even though their judgment is only genuinely needed at certain points.
An agent should remove the routine coordination around those people, not remove those people from decisions that actually require judgment.
That is basically what I wanted BeforeBell to demonstrate.

Closing thought

BeforeBell started with one simple question:
How much of a school-morning coverage problem can an agent safely handle before a human actually needs to become involved?
The answer eventually became the architecture.
Routine work can happen automatically.
Policy can remain deterministic.
The agent can stop when judgment matters.
Approval can remain separate from execution.
And every important state transition can leave evidence behind.
BeforeBell — School coverage, handled before the first bell. #AgentsforHumans
  1. Article #1 — Building BeforeBell for Agents for Humans: Autonomous School Coverage with Human Judgment
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article