Inspiration

As AI agents gain the ability to execute real-world actions — calling APIs, moving money, triggering workflows — we saw a growing gap in security and accountability. Traditional API gateways validate requests, but they don’t provide cryptographic guarantees or immutable audit trails.

Sentinel Auth was inspired by the hastle of going back and forth between API websites determing how much it would cost.

We wanted to build a Stateful Security Gateway where AI decisions aren’t just logged in a database but in fact they’re backed by fast, low-cost blockchain finality. By leveraging Solana’s speed and efficiency, we make AI agent activity financially safe, policy-aware, and provable in real time.

Sentinel Auth is a real-time AI Security Gate with added dashboard functionality.

It can:

  • Verifies agent identity via API keys
  • Enforces policy-based authorization
  • Applies real-time budget and rate limits
  • Triggers a 402 Payment Required intercept for high-risk actions

Every request follows this lifecycle:

  1. Identity verification
  2. Policy retrieval
  3. Pricing lookup
  4. High-risk threshold analysis (x402 flow)
  5. Budget + rate limit validation
  6. On-chain receipt anchoring

When an action is approved, Sentinel generates an Action Hash and writes a proof-of-action receipt to Solana. This ensures:

  • The action cannot be retroactively modified
  • The financial state at that moment is verifiable
  • There is immutable evidence stored on-chain

The result: AI agents cannot exceed spending limits, bypass policies, or act without leaving a cryptographic trace secured by Solana.


How we built it

Backend Engine (src/main.py)

  • FastAPI-based authorization engine
  • /v1/authorize endpoint
  • Wallet signature verification
  • High-risk intercept flow tied to blockchain approval
  • Startup lifespan hook to enforce runtime schema compatibility

The wallet verification ensures that high-cost actions are explicitly approved before execution.

Database Layer (src/db_models.py, src/store.py)

  • SQLAlchemy ORM
  • Accounts, Policies, API Keys, and Pricing models
  • Composite unique index on (client_id, api_link)
  • Real-time budget tracking before on-chain anchoring

The database tracks live financial state, while Solana provides the immutable verification layer.

Production Fix

We encountered a critical production issue where a missing primary key column caused ORM updates to fail.

To fix this permanently, we:

  • Rebuilt the api_key_pricing table with correct indexing
  • Enforced composite uniqueness constraints
  • Added a runtime schema validation hook
  • Ensured receipts are only anchored after schema validation

This guarantees that off-chain enforcement and on-chain records remain consistent.


Running the code

Pattern A: Manual Handshake

Low-level integration:

Sentinel.authorize(action) → IF ALLOWED → Groq.call(prompt)

Here, Sentinel performs policy checks, budget validation, and blockchain receipt anchoring before the LLM call executes.

Pattern B: Safe SDK (Protected Wrapper)

Developers simply call:

groq.chat.completions.create()

Under the hood:

  • The SDK intercepts the request
  • Calls Sentinel
  • Verifies policy and wallet authorization
  • Anchors a receipt on Solana
  • Executes the LLM call only if authorization succeeds

The developer interface remains unchanged — but every action now carries a verifiable proof.


Challenges we ran into

  • Keeping wallet verification within tight API latency constraints
  • Designing a 402 flow that integrates blockchain approval seamlessly
  • Ensuring on-chain anchoring feels instant to users
  • Preventing race conditions between database updates and receipt writes
  • Fixing production schema corruption without breaking audit guarantees

The hardest challenge: synchronizing real-time financial state with immutable blockchain records.


Accomplishments that we're proud of

  • Built a fully stateful AI policy gateway
  • Implemented real-time financial caps that cannot be bypassed
  • Designed a high-risk wallet approval intercept (x402 flow)
  • Anchored AI action receipts to Solana Devnet
  • Created a Safe SDK that integrates blockchain security invisibly
  • Ensured production schema stability to protect audit integrity

Sentinel Auth now provides both off-chain enforcement and on-chain verification.


What we learned

  • Stateless API security is insufficient for AI agents
  • Financial enforcement must happen before execution
  • Fast blockchain finality enables real-time verification
  • Blockchain works best as a proof layer, not a data store
  • Developer UX determines whether security systems get adopted

We learned that AI safety should not depend on trust — it should depend on cryptographic proof.


What's next for Sentinel

  • Production deployment beyond Devnet
  • Mainnet integration for stronger guarantees
  • Advanced permission tokens tied to wallet ownership
  • Stripe integration for automated pay-per-safety flows
  • Enterprise governance controls
  • On-chain anomaly detection based on receipt patterns

Our vision is to make Sentinel the default blockchain-backed security layer for autonomous AI agents.

Built With

Share this project:

Updates

Submission history