Skip to main content

AION: The Self-Evolving Code Engine. Code Once, Live Forever.

Project description

AION

PyPI version CI Coverage Docs AION Auto-Update

Code Once, Live Forever.

AION is an autonomous code-immunity control plane for Python services. It turns repository scanning into a staged remediation workflow: detect incidents, generate deterministic patches, verify them in isolated sandboxes, orchestrate events through queues and webhooks, and produce rollout plus runtime-defense decisions.

What Ships Today

  • Context-aware Python scanning with repository profiling, Semgrep triage, and optional LLM explanation
  • Deterministic remediation for raw_sqlite_query, hardcoded_secret, and missing_auth_decorator
  • Verification with syntax checks, Semgrep re-scan, built-in assertions, and staged project commands
  • Event-driven control-plane primitives: inbox, webhook ingress, queue processing, sandbox orchestration
  • Release candidate management with approval, phased rollout, rejection, and rollback
  • Runtime containment planning covering gateway blocks, WAF rules, feature flags, dependency pins, and code-patch follow-up

Architecture

Layer Implemented capabilities
Sensor Repository scan, JSON event ingestion, persistent inbox, webhook POST /events
Decision Incident detection, remediation planning, policy gating, rollout recommendation
Execution Patch artifact generation, file or repository sandbox staging, verification command execution
Assurance Repair records, queue metrics, release candidates, rollback decisions, runtime defense plans

Installation

Install from PyPI:

pip install aion-evolve

Or install as a uv tool:

uv tool install aion-evolve

For local development:

git clone https://github.com/shenxianpeng/aion.git
cd aion
uv sync --group dev --group docs
uv run aion --help

Quick Start

Choose at least one LLM provider for scan:

export OPENAI_API_KEY=your_key
# or
export ANTHROPIC_API_KEY=your_key
# or
export DEEPSEEK_API_KEY=your_key
# or
export QWEN_API_KEY=your_key
# or
export GEMINI_API_KEY=your_key

Scan a repository:

aion scan ./path/to/repo --output json

If you are running from the cloned repository instead of an installed package, use uv run aion ....

Plan and verify a deterministic repair:

aion repair ./path/to/file.py \
  --context-file ./context.json \
  --artifact-path ./artifact.json \
  --record-path ./repair-record.json

aion verify --artifact-path ./artifact.json

Process an orchestration event inside a sandbox:

aion process-event ./event.json \
  --result-path ./orchestration.json \
  --output json

Promote a verified result into staged rollout control:

aion create-release-candidate ./.aion/inbox/results/<event>.json
aion approve-release <candidate-id> --approver alice
aion advance-release <candidate-id>

Configuration

AION uses a flat .aion.yaml config:

Supported Providers

Provider Env Variable Default Model
Anthropic ANTHROPIC_API_KEY claude-3-5-sonnet-latest
OpenAI OPENAI_API_KEY gpt-4.1
DeepSeek DEEPSEEK_API_KEY deepseek-chat
Qwen (Tongyi) QWEN_API_KEY qwen-plus
Gemini GEMINI_API_KEY gemini-2.0-flash
Azure OpenAI AZURE_OPENAI_API_KEY gpt-4

Config example

directory: "/"
schedule:
  interval: "weekly"
  day: "monday"
  time: "09:00"
  timezone: "UTC"
provider: openai
model: gpt-4.1
ignore_paths:
  - tests/*
  - scripts/generated_*.py
auto_repair_issue_types:
  - raw_sqlite_query
  - hardcoded_secret
  - missing_auth_decorator
auto_repair_min_confidence: 0.90
sandbox_mode: repository
sandbox_verification_commands:
  - python -m pytest tests/unit
auto_approve_verified_fixes: false
rollback_on_verification_failure: true
open_pull_requests_limit: 5
labels:
  - "aion"
  - "security"
reviewers:
  - "team:security"
assignees:
  - "username"
target_branch: "main"
commit_message_prefix: "[AION]"

CLI flags override equivalent settings from .aion.yaml.

GitHub Action

AION ships as a reusable GitHub Action. Add it to any workflow:

# .github/workflows/aion.yml
name: AION Auto-Update
on:
  schedule:
    - cron: '0 9 * * 1'  # Weekly on Monday at 09:00 UTC
  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  auto-update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: shenxianpeng/aion@main
        with:
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          # or use deepseek, qwen, anthropic, gemini:
          # deepseek_api_key: ${{ secrets.DEEPSEEK_API_KEY }}
          # qwen_api_key: ${{ secrets.QWEN_API_KEY }}

Or run it locally:

aion auto-update --target ./ --dry-run   # Preview
aion auto-update --target ./              # Live

CLI flags override equivalent settings from .aion.yaml.

Command Surface

Core analysis:

  • aion scan
  • aion repair
  • aion verify
  • aion run-incident
  • aion repair-eval
  • aion auto-updatescan → fix → PR

Control plane:

  • aion process-event
  • aion process-event-queue
  • aion enqueue-event
  • aion list-inbox
  • aion process-inbox
  • aion serve-webhook

Release and defense:

  • aion create-release-candidate
  • aion list-releases
  • aion approve-release
  • aion reject-release
  • aion advance-release
  • aion rollback-release
  • aion plan-defense

Drift and monitoring:

  • aion snapshot
  • aion drift
  • aion watch
  • aion status

Documentation

Documentation is published at shenxianpeng.github.io/aion. The docs site uses native Material for MkDocs language switching backed by the mkdocs-static-i18n plugin, so the language selector and sidebar navigation are generated per locale instead of being patched in with custom JavaScript.

Current Scope

  • AION produces patch artifacts and staged decisions. It does not hot-patch live production code in place.
  • External integrations for production queues, gateways, WAF providers, feature flags, and deployment systems remain adapter work on top of the shipped interfaces.
  • The current implementation is Python-only by design.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aion_evolve-1.4.0.tar.gz (309.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aion_evolve-1.4.0-py3-none-any.whl (69.7 kB view details)

Uploaded Python 3

File details

Details for the file aion_evolve-1.4.0.tar.gz.

File metadata

  • Download URL: aion_evolve-1.4.0.tar.gz
  • Upload date:
  • Size: 309.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aion_evolve-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9b813fa9626f02d7f3080b0b97fc6770ad823dba9036e5868774ac1cd1ed5500
MD5 00478935fdff478a27c8d42d8f3c787c
BLAKE2b-256 59da38f78d4bdce7ff9a9e6140e67a2c53c6bda1c8a5c0edab100810187a3430

See more details on using hashes here.

Provenance

The following attestation bundles were made for aion_evolve-1.4.0.tar.gz:

Publisher: publish.yml on shenxianpeng/aion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aion_evolve-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: aion_evolve-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 69.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aion_evolve-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fcf84b0a85ec6fb60285cd91434465d5636193d8a74c37f320b68c80f1fca96
MD5 59983d27b007bb2927f886961208f682
BLAKE2b-256 41401c856d05f3c5f879c8eaa505e59c0c1d40b43d51cf3e173c5e95ea306d60

See more details on using hashes here.

Provenance

The following attestation bundles were made for aion_evolve-1.4.0-py3-none-any.whl:

Publisher: publish.yml on shenxianpeng/aion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page