
AquaTwin: An Autonomous Flood Emergency Digital Twin on AWS Serverless
How we built an autonomous disaster dispatch digital twin for monsoon floods using European Space Agency Sentinel-1 SAR satellite radar, deterministic graph routing, AWS Lambda, S3, API Gateway, SNS, and the open-source Cedar authorization policy engine to stop AI hallucinations from triggering false evacuations.
The Deadly Dilemma of AI in Disaster Dispatch
Every monsoon season across South Asia, urban streets, underpasses, and arterial highways submerge in a matter of hours. During the catastrophic July 2023 Yamuna River flood in Delhi, water levels shattered a 45-year record, reaching 208.66 meters. Over 25,000 residents were displaced, and critical hospitals like Lok Nayak Hospital (LNJP) faced severe accessibility crises.
In disaster operations centers, emergency managers face an impossible dilemma:
- Optical Satellite Blindness: Standard optical Earth observation satellites (like Sentinel-2 or Landsat) are completely blind beneath dense monsoon cloud cover and torrential rainfall.
- The AI Hallucination Hazard: While Generative AI and LLMs excel at conversational triage and natural language reasoning, giving an LLM direct authority to trigger public evacuation sirens or emergency SMS broadcasts is perilous. A single hallucinated alert or unverified road blockage can cause mass panic, severe traffic gridlock, and divert ambulances away from safe roads into deep water
To solve this, we created AquaTwin—an autonomous flood emergency routing digital twin that marries Copernicus Sentinel-1 Synthetic Aperture Radar (SAR) satellite data, deterministic NetworkX graph algorithms, and AWS's open-source Cedar policy engine on a production AWS Serverless stack
What Does AquaTwin Do?
AquaTwin provides flood control-room dispatchers with a map where every road segment carries a flood probability, plus an AI assistant that finds safe routes and drafts alerts.
Ground Truth from Space: Piercing Monsoon Clouds with Sentinel-1 SAR Optical satellites cannot see standing water under storm clouds. Radar can.
AquaTwin ingests pre-event and peak-event Sentinel-1 C-band SAR backscatter scenes from the European Space Agency:
- Specular Reflection Thresholding: Smooth standing water reflects radar pulses away from the sensor, producing a sharp drop in backscatter.
- Planetary Elevation (HAND): Using Copernicus DEM GLO-30, we compute a simplified Height Above Nearest Drainage (HAND) relative elevation model.
- Scoring: We evaluate physical roads across Delhi, calculating flood probability using SAR Overlap, Low HAND, and Rainfall metrics. Only road segments with confirmed SAR backscatter change receive
validation_source = "Sentinel-1".

How Did We Use AWS?
We decoupled offline planetary-scale geospatial data preparation from the real-time, low-latency online runtime on AWS.
AWS Open Source: Deterministic Routing and the Cedar Formal Safety Gate
A common pitfall in modern AI applications is asking an LLM to "calculate the safest route." Language models frequently hallucinate coordinate waypoints or recommend closed roads. In AquaTwin, the LLM is strictly decoupled from routing mathematics.
We utilized the Strands Agents SDK to orchestrate our Amazon Nova model, allowing it to autonomously call our routing and alert tools.
To eliminate false panic broadcasts, we integrated AWS's open-source Cedar policy language (
cedarpy ). Before any emergency alert can be published to the public, the agent's intent must pass through our formal Cedar policy:plaintext
// AquaTwin Emergency Alert Policy// Rule:// Only an EmergencyManager can dispatch a public broadcast alert.// The segment must have Sentinel-1 radar confirmation (validation_source == "Sentinel-1")// AND the flood probability percentage must exceed 85% (flood_pct > 85).// All other requests are denied by default.permit(principal in Role::"EmergencyManager",action == Action::"SendAlert",resource) when {context.flood_pct > 85 &&context.validation_source == "Sentinel-1"};
The agent's tool call (send_alert) accepts only segment_id and message. The Cedar evaluator reads flood_pct and validation_source directly from verified records loaded from Amazon S3. The LLM cannot forge, tamper with, or bypass this gate.
Feedback: What Fought Back
What I liked:
- Cedar's Isolation: The open-source Cedar policy engine was incredible. Moving the authorization logic entirely outside of the LLM's cognitive loop provided absolute certainty that hallucinated data couldn't trigger an SNS alert. The
cedarpylibrary worked flawlessly within our Lambda environment.
- Amplify Deployment: Deploying the React frontend via AWS Amplify Hosting was seamless and extremely fast, taking the friction out of getting a public URL for our demonstration.
- Nova's Economics: The Amazon Nova family provided an excellent balance of capability and cost, allowing us to build a sophisticated agentic workflow entirely within the free tier credits.
Explore AquaTwin
- Live Deployed Application: https://main.d2qogaiupnpnbe.amplifyapp.com/
- GitHub Repository: https://github.com/omjee45/AquaTwin
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article