Tests verify what you anticipated.
Ayentra catches what you forgot.

Write one rule your backend code must never break. Ayentra automatically finds the exact input that breaks it, shrinks the bug to a 2-line reproduction, and tests the fix in a safe sandbox before you merge.

Explore Interactive Demo
$ pip install ayentra
✓ 2-line reproducible bug examples
✓ Zero silent file overwrites
✓ Reproducible bug receipts
✓ Safe sandbox patch testing
Interactive Live Demo

Watch Ayentra Catch and Fix Real Bugs

Pick a real backend bug scenario below and click Run Check to see how Ayentra finds the exact failing input and tests a safe fix.

Shortcut: Ctrl+Enter
examples/scheduler_race.py Thread Safety Rule
Universal Backend (Python, TS, Go)
Bug & Fix Inspector
Sandbox Ready
Why Unit Tests Are Not Enough

Three Production Bugs Normal Tests Miss

Unit tests only check the examples you thought of writing. Ayentra tests thousands of edge cases and thread timings automatically before code reaches production.

⚡

Multi-Thread Race Conditions

Normal tests run one request at a time and pass. In production, two requests arriving together can corrupt balances or double-book tasks. Ayentra tests parallel thread timings to catch races early.

# Tests parallel thread timings automatically @invariant(..., check_concurrency=True) # Catches race conditions before production
🔍

Unexpected Edge-Case Inputs

Developers usually test clean positive numbers and normal strings. Ayentra feeds negative amounts, NaN floats, and empty strings, then shrinks any crash down to a 2-line example.

# Shrunk to a 2-line reproduction: ledger.reserve(units=-1) # Available becomes 101, Reserved becomes -1
🛡️

Fixes That Break Something Else

A quick hotfix often solves one crash while breaking another feature. Ayentra tests every suggested code fix inside an isolated sandbox against your full test suite first.

# 3-step sandbox check before saving: 1. Re-run failing input (PASS) 2. Test 120 random edge cases (PASS) 3. Run your full pytest suite (PASS)
How It Works

From Rule to Verified Fix in 4 Steps

You write the rule once. Ayentra handles the edge-case testing, bug shrinking, and sandbox verification automatically.

Step 01

Write One Rule

Add an @invariant decorator or contract declaration in ayentra.toml stating what must always stay true across your backend.

Step 02

Auto-Generate Inputs

Ayentra reads backend schema models and type contracts across Python, TypeScript, and Go to generate adversarial boundary cases automatically.

Step 03

Shrink to 2 Lines

When an input breaks your rule, Ayentra simplifies it down to the smallest 2-line reproduction so you see the exact cause immediately.

Step 04

Verify Fix in Sandbox

Ayentra generates a clean code patch and tests it in a temporary sandbox against both the bug and your existing backend test suite.

Tool Comparison

How Ayentra Fits Your Workflow

Ayentra works alongside Pytest and Mypy by catching edge-case inputs and race conditions they are not designed to test.

Capability Standard Pytest Type Checkers (Mypy) Ayentra
Checks Business Rules Manual per test Type hints only ✓ Automatic across all inputs
Shrinks Bugs to 2 Lines None None ✓ Minimal 1-2 line example
Catches Thread Race Conditions None None ✓ Parallel thread testing
Generates & Tests Code Fixes None None ✓ Tested in isolated sandbox
Reproducible Bug Receipts None None ✓ Saved with exact seed
Fast Setup

Add to Your Pipeline in 60 Seconds

Drop Ayentra into GitHub Actions, configure with pyproject.toml, or run it locally in your terminal with one command.

.github/workflows/ayentra.yml
# .github/workflows/ayentra.yml
name: Invariant Verification Gate
on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  verify:
    name: Run Invariant Verification
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Runtime Environment
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Ayentra Invariant Gate
        uses: Somay-Saini/ayentra-ai@main
        with:
          target: src/
          fix: true
          sarif-output: ayentra.sarif

      - name: Upload SARIF Report
        uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: ayentra.sarif
Simple Terminal Commands

Run Ayentra on Your Machine

Check rules, view 2-line counterexamples, and test fixes right from your command line.

Terminal: Check Code for Broken Invariants
$ ayentra check examples/ --seed 42
Checking 3 files for invariant violations...
[FAIL] examples/inventory_ledger.py (1 violation found)
[FAIL] examples/scheduler_race.py (1 violation found)
[PASS] examples/data_parser.py (0 violations)
$ ayentra apply-patch examples/inventory_ledger.py --yes
Verified candidate fix passes all 3 sandbox checks.
Patch written to examples/inventory_ledger.py.
Existing pytest suite: 100% PASS.
Automated PR Reviews

Catch Bugs in Pull Requests Before Merge

Ayentra tests pull requests, posts the exact 2-line failing case in a comment, and generates a verified code fix before anyone clicks merge.

Offline PR Review Bot Simulation
$ ayentra check --mock-pr-event
[MOCK PR BOT] Mock PR #101 (ayentra/ayentra-core)
[MOCK PR BOT] Target: a1b2c3d -> main
[MOCK PR BOT] Title: "Enforce Concurrency Invariant Gate"
[MOCK PR BOT] Generated review comment (2,790 bytes)
[MOCK PR BOT] Posted simulated review comment to PR #101 (200 OK)
Offline simulation complete. Zero tokens or network calls required.
Pre-Commit / Stdin Diff Verification Gate
$ git diff HEAD~1 | ayentra check -
Scanning unified diff for invariant boundary defects...
Discovered 1 critical risk: Financial balance leak in payment ledger.
Debiting source balance without destination credit.
Verdict: BLOCKED (Pre-commit gate failed)
A
ayentra-bot[bot] bot comment commented on Pull Request #14 (examples/inventory_ledger.py)
Verification Gate Failed

Ayentra Invariant Verification Gate FAILED: Method InventoryLedger.reserve violated invariant self.available >= 0 and self.reserved >= 0 and self.available + self.reserved == self.initial_total on input {"units": -1}.

Unified Patch Diff (3-Stage Sandbox Verified: +6 / -2 lines)
@@ -15,4 +15,8 @@ def reserve(self, units: int) -> None: - if units <= self.available: - self.available -= units + if units <= 0: + raise ValueError('units must be positive') + if units > self.available: + raise ValueError('Insufficient available for operation') self.available -= units
Sandbox Status: VERIFIED CANDIDATE FIX (Counterexample Replay: PASS | Invariant Sweep: PASS | Pytest: PASS)
$ ayentra apply-patch examples/inventory_ledger.py --yes
Pricing & Plans

Transparent Subscriptions for Engineering Teams

Self-serve monthly plans across Python (live), TypeScript & Go (preview), and Rust (roadmap), backed by Lemon Squeezy Merchant of Record. Cancel anytime.

Open Core

Developer

Free

For individual engineers running local invariant checks and AST guard verification.

  • ✓ Local CLI verification
  • ✓ Property strategy synthesis
  • ✓ 100% offline, zero network calls
  • ✓ Community invariant decorators
$ pip install ayentra
Team Tier

Ayentra Team

$249 / month

Automated CI invariant verification and property shrinking for growing engineering teams.

  • ✓ Up to 1,000 CI verification runs / month
  • ✓ GitHub Action CI integration
  • ✓ OASIS SARIF 2.1.0 security exports
  • ✓ PR review bot comments
Get Ayentra Team
Scale & Pilot

Ayentra Scale

$999 / month

Deep concurrency race detection, TOCTOU exploration, and isolated sandbox auto-repair.

  • ✓ Up to 5,000 CI verification runs / month
  • ✓ Deterministic thread preemption & race exploration
  • ✓ 3-stage sandbox patch verification
  • ✓ Priority engineering SLA & 100% credited to annual contract
Get Ayentra Scale

Enterprise Dedicated ($2,500 to $5,000/mo)

Self-hosted runner integration, custom AST templates, unlimited repositories, and dedicated SLA. Inquiries: ayentra.ai@gmail.com.

Explore Demo
Self-Serve Management

Customer License & Credit Portal

Lookup your Ayentra subscription balance, monitor remaining monthly CI verification runs, and grab your CI pipeline secrets.

Quick Test Keys: •
Active Plan
Ayentra Team
$249 / month
Verification Credits
842 / 1,000 Runs
158 CI runs consumed this cycle
Status & Renewal
Active Subscription
Renews on Dec 13, 2026
Monthly CI Run Allocation Meter 84.2% Available
0 Runs 1,000 Total Monthly Runs
CI Pipeline Setup: 30-Second Quickstart

1. Add your key to GitHub Repository Secrets as AYENTRA_API_KEY.
2. Add this step to your .github/workflows/ci.yml pipeline:

# Ayentra Automated CI Invariant Verification
- name: Run Ayentra Verification
  env:
    AYENTRA_API_KEY: ${{ secrets.AYENTRA_API_KEY }}
  run: |
    pip install ayentra
    ayentra verify --ci --receipt=receipt.json
Need more runs or deeper concurrency trace exploration?
View Plans Upgrade to Scale (5,000 Runs)
Real-World Evidence

7 Production Bugs Ayentra Catches

We tested Ayentra across 7 common architectures spanning financial transfers, rate limiters, thread barriers, and worker queues.

Architectures Tested
7 Targets
Curated real-world architectures
Edge Cases Checked
173 Cases
Boundary and extreme inputs
Bugs Caught
7 Bugs
Shrunk to 2-line reproductions
Safe Fixes Verified
7 Patches (100%)
Zero regression sandbox pass
7 Verified Production Patterns in dogfood_receipt.json Status: ALL 7 PATCHES SANDBOX VERIFIED
Pattern Domain & Target Plain-English Bug Prevented Business Risk Verification
customer_pilot Payment Ledger Negative balance drift in escrow transfer Financial balance corruption VERIFIED
redis_token_bucket Distributed Rate Limiter Token underflow allows unbounded requests Rate limiter bypass / DoS VERIFIED
scheduler_race Thread Task Scheduler TOCTOU race under multi-thread barrier Double-allocation / thread leak VERIFIED
inventory_ledger E-Commerce Inventory Over-reservation drops total inventory count Negative stock overdraft VERIFIED
celery_task_queue Task Pipeline Worker Unacknowledged retries drop active task count Pipeline payload loss VERIFIED
requests_connection_pool HTTP Client Pool Socket exhaustion on timeout release Resource exhaustion VERIFIED
data_parser Sensor Telemetry Stream NaN and infinite values pass unchecked Telemetry data corruption VERIFIED
Speed & Accuracy

Fixes in Under 3 Seconds

Tested on 15 real-world backend targets across data pipelines, payment ledgers, and concurrency schedulers. Every candidate fix is replayed against the bug, checked across hundreds of edge cases, and run through your full test suite in under 3 seconds on average.

Step 1: Replay Bug
27.94 ms
Confirms the failing input is stopped
Step 2: Edge Case Sweep
210.32 ms
Tests hundreds of variations to prevent new bugs
Step 3: Full Test Suite
2,302.62 ms
Existing test suite executed clean
Average Total Time
2,734.07 ms
15 / 15 Targets Verified (100% Pass Rate)
8 Built-In Backend Safety Templates (Universal Invariant Protocol)
decimal_quantize Decimal & precision guard numeric_clamp Numeric range boundary clamping non_empty_str String length and validation guard collection_len Sequence indexing & empty bounds dict_required_keys Dictionary key existence guard none_guard Optional / None value guard uuid_version_check UUID format and version check bytes_bounds Byte string length and format guard
15 Real-World Target Benchmark Results Engine Target: Python 3.14 (Windows amd64) | 100% Sandbox Pass
# Target File Bug Category / Safety Guard Bug Replay Edge Case Sweep Full Test Run Total Time Status
1 customer_pilot.py State Invariant / Conservation Law 8.74 ms 275.56 ms 2,488.94 ms 3,521.99 ms VERIFIED
2 data_parser.py Input Sanitization & Finite Float 7.29 ms 181.01 ms 2,659.19 ms 3,113.94 ms VERIFIED
3 inventory_ledger.py State Invariant / Conservation Law 7.07 ms 221.32 ms 2,455.30 ms 2,913.62 ms VERIFIED
4 scheduler_race.py Concurrency / Thread Schedule Race 211.34 ms 1,124.14 ms 2,492.73 ms 4,355.20 ms VERIFIED
5 celery_task_queue.py Task Queue Counter Underflow 7.36 ms 317.45 ms 2,270.68 ms 2,812.31 ms VERIFIED
6 redis_token_bucket.py Rate Limiter Capacity Boundary 7.64 ms 172.47 ms 2,279.08 ms 2,574.18 ms VERIFIED
7 requests_connection_pool.py Connection Pool Active Leaks 8.07 ms 15.39 ms 2,203.35 ms 2,270.55 ms VERIFIED
8 ratio_calc.py Zero Division / Modulo Guard 6.72 ms 78.86 ms 2,150.74 ms 2,284.06 ms VERIFIED
9 sequence_reader.py collection_len Out-of-Bounds 22.31 ms 112.17 ms 2,157.43 ms 2,411.51 ms VERIFIED
10 mapping_reader.py dict_required_keys Missing Key 23.21 ms 163.93 ms 2,195.83 ms 2,499.42 ms VERIFIED
11 profile_loader.py none_guard Optional Boundary 21.81 ms 98.23 ms 2,195.37 ms 2,395.19 ms VERIFIED
12 financial_split.py decimal_quantize Precision Guard 21.19 ms 78.27 ms 2,290.80 ms 2,518.85 ms VERIFIED
13 timespan_validator.py Timezone Date Chronology Guard 21.33 ms 105.39 ms 2,265.51 ms 2,500.61 ms VERIFIED
14 packet_decoder.py bytes_bounds (bytes/bytearray) 24.55 ms 103.30 ms 2,180.88 ms 2,376.83 ms VERIFIED
15 session_token_validator.py uuid_version_check (uuid.UUID) 20.49 ms 107.35 ms 2,253.54 ms 2,462.85 ms VERIFIED
Enterprise Security & Hash Pinning Safe for Zero-Trust CI

For zero-trust, air-gapped CI runners and security compliance gates, Ayentra publishes verified SHA-256 package digests. Pin these hashes in requirements files to prevent supply-chain tampering.

requirements-security.txt (Hash-Pinned Installation)
# Ayentra Cryptographically Pinned Distribution
ayentra \
  --hash=sha256:<release-wheel-sha256> \
  --hash=sha256:<release-sdist-sha256>
Air-Gapped / Zero-Egress CI Installation Command
$ pip install --require-hashes -r requirements-security.txt
Security & Open Source Trust

Built for Secure, Private Environments

Standard CycloneDX 1.5 JSON manifest, verified wheel packages, zero external telemetry, and offline-first execution.

Distribution
Production
Pure Python wheel + sdist
Automated Tests
139 / 139 PASS
100% automated test pass rate
Runtime Dependencies
3 Packages
hypothesis, pytest, rich (Pure Python)
Network Access
Zero Egress
100% offline, no telemetry or phone-home
requirements-security.txt (Air-Gapped Cryptographic Pinning)
# Ayentra Hash-Pinned Distribution (see docs/sbom_and_provenance_manifest.md)
ayentra \
  --hash=sha256:<release-wheel-sha256> \
  --hash=sha256:<release-sdist-sha256>
Direct Air-Gapped Wheel Check & Local Install
$ sha256sum -c ayentra-release.sha256
$ pip install dist/ayentra-*.whl --no-index --find-links=dist/
Local Web Studio

Prefer a visual workspace in your browser?

Ayentra Studio provides a local interface to inspect bugs, preview code diffs side-by-side, and test fixes with keyboard shortcuts.

$ ayentra studio --port 8420
Opens http://localhost:8420 in your default browser