Skip to content
A

AETHELGARD

Sandbox the action. Verify the commit.

Created on 25th October 2026

•

A

AETHELGARD

Sandbox the action. Verify the commit.

The problem AETHELGARD solves

Giving AI agents direct write access to production is dangerous. A single hallucination or prompt injection can wipe out customer tables, trigger hidden foreign-key cascades, issue uncapped refunds, or leak sensitive data.

AETHELGARD is a pre-commit blast shield between AI agents and live systems. Instead of trusting an LLM to behave, it intercepts every action, runs it in an isolated shadow environment, measures the fallout, and cryptographically locks the approved payload before touching production.

What You Can Do With It
Catch Destructive SQL: Preview database mutations in a shadow clone to spot mass deletes and foreign-key cascades before committing.

Guard Financial Actions: Calculate the exact dollar exposure of proposed refunds or ledger updates before money moves.

Validate Infra & Outbound Calls: Dry-run config changes and filter automated emails or webhooks before they leave the server.

Auto-Patch Bad Queries: Rewrite risky AST operations on the fly (like injecting missing WHERE clauses or clamping refund bounds) and re-test them automatically.

See the Blast Radius in 3D: Visualize affected tables and services on an interactive Three.js topology map.

How It Works
If an agent tries to run a risky DELETE on inactive accounts that could wipe out linked billing history, AETHELGARD steps in:

Intercept: Catches the raw SQL or tool call mid-flight.

Simulate: Executes the query against an isolated SQLite shadow copy.

Measure: Diffs the state to count affected rows, cascades, and dollar exposure.

Remediate: Rewrites unsafe syntax trees into safe alternatives and re-simulates.

Authorize: Issues an HMAC-SHA256 token tied to the exact query and database state hash.

Verify & Commit: Checks the signature, blocks replays, confirms production state hasn't drifted, and commits.

What Makes It Different?
Most guardrails rely on regex blocklists or asking a second LLM if an action "looks safe." AETHELGARD doesn't guess—it runs the code in a sandbox and checks the math:

Live Shadow Execution: Tests against actual database clones, not static rules.

Hard Metrics: Judges risk by real row diffs, cascade depth, and dollar amounts.

TOCTOU Protection: Cryptographic state locking prevents race conditions, payload tampering, and token replays between preview and commit.

AST Self-Healing: Fixes broken queries instead of just throwing "Access Denied" errors.

Adversarial Testing: Backed by test suites for concurrency, state drift, and red-team prompt injections.

Who It’s For
AI Agent Builders & DevOps: Put a deterministic checkpoint between LLM tool calls and live databases or configs.

Fintech & Security Teams: Enforce hard dollar limits and stress-test autonomous workflows against prompt injection and state drift.

The Core Idea
Don't ask an AI agent what it intends to do. Run what it's about to do in a sandbox, measure the damage, and verify the state before letting it touch production.

Challenges we ran into

Building AETHELGARD wasn't just about catching bad AI outputs before they ran. The hard part was designing a sandbox that could actually run destructive operations, measure the real-world fallout, and lock down the execution pipeline so nothing unsafe could slip through to production.

  1. Measuring Real Damage Without Nuking Production
    A basic EXPLAIN query or dry-run parser rarely tells the whole story. If an agent runs a DELETE query, static analysis won't easily show you the twenty foreign-key cascades that wipe out billing history three tables over.

How we solved it: We used SQLite’s native backup API to spin up an isolated shadow database on the fly. When an agent proposes a mutation, we run the query against the shadow copy first. This lets us inspect the exact row diffs, catch cascading deletes, and calculate financial exposure down to the cent—without touching live data.

  1. Ditching Hardcoded "Demo Magic"
    A lot of hackathon safety tools cheat by hardcoding blast-radius scores for a few preset demo queries. We wanted AETHELGARD to handle arbitrary, unseen SQL and judge the risk based on what is actually inside the database right now.

How we solved it: We ripped out static lookup tables and built the simulator around live schema inspection and execution diffs. If an agent hallucinates a column name or targets a missing table, the sandbox doesn't fake a fallback score—it catches the exact engine error and returns hard diagnostics.

  1. Closing the TOCTOU (Time-of-Check to Time-of-Use) Gap
    Just because an action looks safe in the sandbox doesn't mean it's safe five seconds later when it hits production. Payloads can be tampered with in transit, or the underlying database might change while waiting for approval. Asking the LLM "Are you sure?" doesn't fix a race condition.

How we solved it: We built a cryptographic preview-and-commit handshake using HMAC-SHA256 tokens. When a simulation passes, the system signs a token tied to the exact query hash and a snapshot of the current database state. At commit time, the execution gate checks the signature, blocks token replays, and verifies that the target tables haven't drifted since the preview ran.

  1. Fixing Bad Code Instead of Just Blocking It
    A firewall that just yells "Access Denied" makes for a terrible developer experience, and letting an AI agent blindly retry a blocked query usually results in the exact same mistake.

How we solved it: We built an AST-based self-healing engine that rewrites dangerous queries into safe ones. Instead of flat-out rejecting a risky command, it parses the syntax tree and patches the problem—like injecting missing WHERE clauses, capping runaway loops, or clamping an out-of-bounds refund amount. The patched query then goes right back through the shadow sandbox to prove it's safe before executing.

  1. Stress-Testing Beyond the Happy Path
    A safety gate that only blocks obvious DROP TABLE commands isn't much of a safety gate. We needed to know it wouldn't buckle under concurrent requests, weird state drift, or deliberate prompt injections.

How we solved it: We wrote dedicated test suites targeting race conditions, token forgery, state drift, and dynamic SQL edge cases. On top of that, we put together a 24-case benchmark covering database migrations, financial transfers, and external API calls, plus a 5-vector red-team suite designed specifically to try and bypass the sandbox.

  1. Making Database Blast Radiuses Obvious at a Glance
    Staring at raw SQL diffs, affected row counts, and JSON logs makes it tough for a human operator to quickly judge whether an agent is about to break something critical.

How we solved it: We built an interactive 3D topology map in Three.js that visualizes the infrastructure as a live node graph. When the shadow simulation runs, the UI renders visual shockwaves across the affected tables and services, scaling with the severity of the mutation so you can literally see the blast radius before hitting approve.

What We Learned
The biggest takeaway from building AETHELGARD is that you cannot prompt-engineer your way to AI safety. System prompts and LLM self-reflection are great, but real safety has to be enforced mathematically and deterministically at the execution boundary.

Giving autonomous agents real-world write access requires a zero-trust pipeline: sandbox the action, measure the exact fallout, cryptographically lock the state, auto-patch what you can, and verify everything again right before commit.

Tracks Applied (1)

Agentic AI

Traditional AI generally responds to a prompt. Agentic AI can go further by pursuing a goal, deciding which tools to use...Read More

Discussion

Builders also viewed

See more projects on Devfolio