πŸ›‘οΈ IRONCLAD SENTINEL

Autonomous Construction Finance Audit & Statutory Prompt-Pay Defense Engine

Built with AWS Strands Agents SDK & Amazon Bedrock AgentCore | Professional Agents Track


πŸ’‘ Inspiration: The $1.4 Trillion Manual Panic

In commercial construction finance, a single billing mistake doesn't just result in an accounting adjustmentβ€”it shuts down active jobsites, voids mechanics lien protections, and triggers ruinous statutory interest penalties under state Prompt Payment Acts.

Across the United States, commercial construction represents a $1.4 trillion annual billing ecosystem that still relies heavily on manual invoice reviews, error-prone spreadsheet calculations, and paper lien waivers chased across chaotic email threads. This structural fragility exposes General Contractors and property owners to three existential failure vectors:

  1. Retainage Miscalculation & Double-Payment Exposure: On a $4.2M subcontract with a 10% contractual retainage escrow, a subtle arithmetic or rounding discrepancy across multiple draw cycles routinely creates tens of thousands of dollars in unearned disbursementsβ€”often remaining undetected until final project closeout.
  2. Pre-Dated Notary Lien Fraud: Unscrupulous or negligent actors frequently submit statutory lien waivers where the notary acknowledgment date precedes the actual check payment date. An improperly executed waiver is legally defective, leaving property titles clouded and exposing owners to catastrophic mechanics lien foreclosures.
  3. Statutory Prompt-Payment Penalties: Almost every US jurisdiction enforces mandatory Prompt Payment Acts (e.g., Texas Property Code Chapter 28, California Civil Code Β§Β§ 8800–8822) levying non-waivable interest penalties of 1.5% to 2.0% per month on legitimately owed but withheld funds. A 90-day administrative delay on a $380,000 payment application accumulates upwards of $17,100 in statutory interest liability.

The Catastrophic Failure of the "Chatbot" Paradigm

When Generative AI arrived, the tech industry’s knee-jerk reaction was to deploy conversational chatbots. But in institutional construction finance, chatbots are a catastrophic anti-pattern:

  • LLMs routinely hallucinate floating-point arithmetic ($0.1 + 0.2 = 0.30000000000000004$), fabricating phantom variances that trigger spurious compliance holds.
  • General-purpose LLMs soften non-negotiable statutory deadlines, offering conversational "legal opinions" rather than deterministic statutory calculations.
  • Chatbots waste valuable executive time chatting back and forth when busy project executives simply need autonomous execution.

We asked a fundamental question aligned with the core spirit of the AWS Agents for Humans Hackathon: What if an AI agent didn't ask you to babysit another chat window, but ran silently in the background, verified 100% of mathematical and legal compliance deterministically, and surfaced ONLY when an authenticated human decision was required?

This vision led to IRONCLAD Sentinel.


βš™οΈ What It Does: Zero-Chat Autonomous Compliance

IRONCLAD Sentinel completely replaces the conversational chatbot with a Zero-Chat Autonomous Audit Engine.

When an AIA G702/G703 payment application packet and accompanying lien waivers are submitted, IRONCLAD ingests the unstructured documents, executes rigorous multi-agent verification, and renders a single, actionable C-Suite Executive Decision Card.

The 5 Inviolable System Invariants

To guarantee institutional fintech grade safety, IRONCLAD enforces 5 immutable invariants directly in code:

  1. Zero Payment Rails: The system holds zero bindings to banking rails, ACH, or wire transfers. It produces decision artifacts; it cannot move capital autonomously.
  2. Zero-LLM Deterministic Math: Large Language Models are strictly prohibited from calculating retainage, taxes, or line-item sums. 100% of arithmetic is executed in Python using exact Decimal precision.
  3. Silence-Over-Guessing: If an invoice number, notary stamp, or retainage clause is illegible or missing, the agent is structurally forbidden from inferring a value. It immediately logs a typed Discrepancy and halts clean release.
  4. Document Reference Immutability: Ingested source PDFs and contract riders remain immutable read-only records protected against modification.
  5. Statutory Clock Integrity: Prompt-payment countdown clocks cannot be softened or suppressed to favor General Contractors over trade subcontractors.

The 1-Click Authenticated HITL Decision Gate

Rather than an unmanaged loop, the audit pauses durably at an authenticated Human-in-the-Loop (HITL) gate presenting three definitive options:

  • APPROVE_RELEASE: Enabled strictly when zero discrepancies exist and the lien chain is verified VALID. The button is programmatically code-locked if any compliance flag is active.
  • HOLD_REQUEST_CORRECTION: Automatically generates and dispatches a formal discrepancy notice to the trade subcontractor while preserving the draw checkpoint.
  • ESCALATE_LEGAL: Automatically triggered on critical fraud indicators (e.g., pre-dated notary execution), routing the immutable audit packet directly to construction legal counsel.

πŸ—οΈ How We Built It: Tri-Track Multi-Agent Topology

IRONCLAD Sentinel is architected as an asynchronous, non-blocking Directed Acyclic Graph (DAG) leveraging the AWS Strands Agents SDK (GraphBuilder) and containerized for Amazon Bedrock AgentCore Runtime.

                       [ Incoming Draw Packet (PDFs / AIA G702 / Waivers) ]
                                                β”‚
                                    ( Ingress Validation )
                                                β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β–Ό                                                             β–Ό
   [ ForensicAuditSentinel ]                                     [ FairPayStatutoryGuardian ]
   Track: Professional Agents                                    Track: Good Neighbor Agents
   β€’ Form-aware line-item OCR                                    β€’ Subcontract Rider classification
   β€’ Zero-LLM Retainage Math (Decimal)                           β€’ 14-State statutory clock & penalties
   β€’ Chronological Notary Fraud check                            β€’ Prompt-Pay countdown calculation
                 β”‚                                                             β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚ (Barrier State Reduction)
                                                β–Ό
                                [ EverydayDecisionCardEmitter ]
                                Track: Everyday Agents
                                β€’ Deterministic findings synthesis
                                β€’ Zero-chat executive card assembly
                                β€’ Automated stakeholder dispatch
                                                β”‚
                                                β–Ό
                                 [ Durable HITL Interrupt Gate ]
                                 (Single-Writer State Reducer)
                                                β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                           β–Ό                           β–Ό
          [ APPROVE RELEASE ]       [ HOLD / CORRECTION ]       [ ESCALATE TO LEGAL ]

1. Tri-Track Agent Orchestration Cascade

  • ForensicAuditSentinel (Professional Track): Ingests AIA G702/G703 continuation sheets, normalizes line items via Pydantic V2 structured outputs, invokes audit_retainage_math with exact Python Decimal quantization, and runs chronological date cross-examinations (verify_lien_chain_integrity) against county disbursement records.
  • FairPayStatutoryGuardian (Good Neighbor Track): Ingests subcontract payment riders, classifies conditional clauses (pay-if-paid vs. pay-when-paid), and references a deterministic 14-jurisdiction Prompt Payment catalog (Texas Prop. Code Β§ 28, California Civil Code, NY Prompt Pay) to compute statutory countdowns and interest liabilities without LLM bias.
  • EverydayDecisionCardEmitter (Everyday Track): Awaits concurrent upstream completion across an explicit fan-in barrier, merges state through single-writer reducers, synthesizes the Executive Decision Card payload, and freezes execution at the durable HITL interrupt.

2. Enterprise Multi-Cloud Provider Abstraction

To prevent single-cloud vendor lock-in and enable seamless evaluation, we engineered an air-gapped Provider Abstraction Layer (BaseRuntimeProtocol):

  • Production Deployment: Targets Amazon Bedrock AgentCore Runtime orchestrating Anthropic Claude 3.5 Sonnet (us.anthropic.claude-3-5-sonnet-20241022-v2:0) via cross-region inference profiles with microVM session isolation.
  • Live Interactive Staging Engine: Dynamically invokes Google Gemini 3.5 Flash Lite (gemini-3.5-flash-lite) via the official google-genai SDK, powering our publicly accessible Streamlit Community Cloud sandbox with 100% live inference uptime and zero AWS credential barrier for evaluators.
  • The Deterministic Invariant: Because 100% of retainage arithmetic, lien chronological math, and statutory countdowns are executed in pure Python tools, switching reasoning runtimes introduces ZERO arithmetic variance.

3. Dual-Interface Presentation Layer

  • Flagship C-Suite Console (frontend/): Built with Next.js 16 (React 19, Turbopack, Tailwind CSS), communicating with an asynchronous FastAPI Server Bridge (src/server.py) via high-throughput Server-Sent Events (SSE /api/audit/stream).
  • Live Public Sandbox (src/ui/app.py): Deployed to Streamlit Community Cloud, allowing judges to test canonical scenarios (Clean Texas Masonry, Pre-Dated Notary Fraud, and Edge Cases) in 1 click without installing dependencies.

4. Observability & Telemetry

Full OpenTelemetry GenAI Semantic Convention instrumentation dual-exported to AWS CloudWatch (bedrock-agentcore namespace) and Langfuse, capturing distributed trace spans, token usage, execution latencies, and structured HITL reviewer feedback annotations.


πŸ§— Challenges We Faced

  1. Floating-Point Drift in Financial Auditing: Standard Python floats and JSON numeric types introduce IEEE 754 precision artifacts ($0.1 + 0.2 \neq 0.3$). In construction billing, a 1-cent mismatch invalidates a notarized payment certificate. We enforced strict string-serialized Python Decimal quantization across all Pydantic V2 tool contracts and state channels.
  2. Preventing Cross-Agent State Contamination: In concurrent fan-out architectures, parallel agents writing to shared state risk race conditions. We architected a Programmatic State Reducer System (src/state/reducers.py) with caller_node identity validation. If an unauthorized node attempts to mutate another agent's state channel, StateValidationError is raised immediately.
  3. Resilient Public Sandboxing Under Strict Quotas: During live hackathon demonstrations, external API rate limits (such as Google AI Studio's 20 RPD on preview models) can cause unexpected demo failures. We engineered a dynamic model resolution layer in src/models.py with automatic 429/503 failover resilience to gemini-3.5-flash-lite, preserving 500 RPD throughput while keeping our Next.js UI badges completely synchronized.

πŸ† Accomplishments That We're Proud Of

  • 162 Automated Tests (100% Pass Rate): Built under institutional software engineering rigor, our test matrix spans 22 files covering unit logic, integration DAG execution, adversarial prompt injection defenses (OWASP LLM01), and LLM tool-calling evals (uv run pytest passes 162/162 in ~12s).
  • Sub-Second Turbopack Build: The Next.js 16 Executive Console compiles cleanly with 0 TypeScript errors in 293ms.
  • Real Pre-Dated Notary Interception: Successfully demonstrated an end-to-end fraud intercept where waiver W-002's execution date preceded the payment disbursement date, immediately locking the approval button and freezing release recommendations at $0.00.
  • True Multi-Agent AWS Strands Implementation: A non-trivial, non-monolithic DAG implementation demonstrating genuine fan-out/fan-in barriers, single-writer state reducers, and durable HITL checkpoint resumption.

πŸ“š What We Learned

Building IRONCLAD Sentinel deepened our appreciation for defensive agentic architecture. We learned that the most reliable enterprise AI agents are those that recognize their own cognitive limitations: offloading arithmetic and chronological validation to deterministic code, while focusing neural reasoning exclusively on semantic document understanding, ambiguity detection, and statutory clause classification.


πŸš€ What's Next for IRONCLAD Sentinel

  • Autonomous ERP Integrations (Read-Only): Building pre-built connectors for Procore, Autodesk Construction Cloud, and Oracle Textura to ingest draw packets directly from existing contractor workflows.
  • Multimodal Stamp & Seal Vision Verifiers: Expanding ForensicAuditSentinel to run visual tamper-detection on county recorder embossments and notary ink stamps using multimodal Bedrock vision models.
  • 50-State Statutory Expansion: Broadening our statutory prompt-payment and mechanics lien catalog from 14 states to all 50 US jurisdictions and Canadian provincial Prompt Payment statutes.

πŸ“° Official AWS Builder Trilogy (+0.6 Max Bonus Series)

  1. Part 1 (Overview): Building IRONCLAD Sentinel: Autonomous Construction Billing Audit with AWS Strands Agents | Agents for Humans
  2. Part 2 (Multi-Agent DAG): Deep Dive: Orchestrating Multi-Agent Construction Audits with AWS Strands Agents SDK | Agents for Humans
  3. Part 3 (Zero-Hallucination Math): Zero-Hallucination Construction Finance: Deploying Bedrock AgentCore & Deterministic Math | Agents for Humans

Built With

  • amazon-bedrock
  • aws-strands-agents-sdk
  • bedrock-agentcore
  • claude-3.5-sonnet
  • docker
  • fastapi
  • gemini-3.5-flash
  • google-genai
  • langfuse
  • next.js-16
  • opentelemetry
  • pydantic-v2
  • pytest
  • python-3.11
  • streamlit
  • tailwind-css
  • turbopack
  • typescript
Share this project:

Updates

Submission history