Skip to main content

The governance kernel for AI agents. Cost enforcement, policy-as-code, self-healing CI.

Project description

Antigravity OS

The governance kernel for AI agents.

CI License PyPI Python


The Problem

AI agents can write code. But who stops them from:

  • Burning $10,000 on GPU instances overnight?
  • Deploying broken code to production without a plan?
  • Looping forever on a failed task?

The Solution

pip install ag-os && ag-os init && ag-os demo

Antigravity OS is an integrated, opinionated governance kernel that combines:

  • Cost Enforcement -- Block execution when projected spend exceeds budget.
  • Policy-as-Code -- 9 governance rules ("The Constitution") enforced at every state transition.
  • Deterministic State Tracking -- Flight Recorder state machine with full audit trail.
  • Self-Healing CI -- Pre-push hooks and CI gates that prevent broken deployments.

All provider-agnostic. All in one install. No cloud accounts required.


Quick Start

# Install
pip install ag-os

# Initialize (creates antigravity.yaml, Constitution rules, git hooks)
ag-os init --defaults

# See it in action (60-second governance demo)
ag-os demo

# Check solvency before allocating resources
ag-os check 1.0 --tier standard_cpu

# View configured providers
ag-os status

How It Works

Antigravity OS operates through 6 provider surfaces, each with a swappable backend:

Surface Default What It Does
Secrets .env file Hydrate credentials at runtime
Issues Console + JSONL Create and deduplicate governance issues
Cost Local JSON Track spend, enforce budget caps
State SQLite Persist flight recorder state and leases
Telemetry Console Emit traces and metrics
Policy Built-in Evaluate governance rules (The Constitution)

Zero-Dependency Defaults

The default stack requires nothing but Python. No Docker, no cloud accounts, no API tokens. Value in 60 seconds.

Upgrade When Ready

pip install ag-os[mcp]     # MCP Server for AI agent integration
pip install ag-os[gcp]     # GCP Secret Manager, Billing API, Cloud Trace
pip install ag-os[aws]     # AWS Secrets Manager, Cost Explorer
pip install ag-os[jira]    # Jira issue tracking
pip install ag-os[redis]   # Redis state store

MCP Server

Antigravity OS includes a built-in MCP server that exposes governance tools to any MCP-compatible AI agent:

pip install ag-os[mcp]
ag-os serve

Available Tools

Tool What It Does
check_solvency Run the Cost Guard against the budget cap
transition_state Advance the Flight Recorder state machine
evaluate_policy Execute governance rules against operation context
get_status Return current configuration and providers
get_history Retrieve the Flight Recorder audit trail

Client Configuration

Add to your MCP client configuration (e.g. Claude Desktop, Cursor):

{
  "mcpServers": {
    "antigravity-os": {
      "command": "ag-os",
      "args": ["serve"]
    }
  }
}

The Constitution

Antigravity OS enforces 9 governance rules, installed as Markdown files in .agent/rules/:

Rule Name What It Enforces
00 Plan First No code changes without an approved plan
01 Data Contracts All data exchange uses explicit, validated contracts
02 Fail Closed Unknown states halt execution and escalate
03 Zero Trust Dependencies All external inputs/outputs are validated
04 Governance Gate All state transitions pass through the gate
05 Flight Recorder Every operation is tracked through the state machine
06 Agent Handover Structured handover contracts for agent transfers
07 Loop Detection Max retry loops enforced with human escalation
08 Economic Safety The Solvency Gate -- block if over budget

Configuration

All settings live in antigravity.yaml:

version: "1.0"

monthly_cap: 50.00
max_loop_count: 5

providers:
  secrets: local         # local | env | gcp | aws | vault
  issues: console        # console | github | linear | jira
  cost: local            # local | gcp | aws | azure | litellm
  state: sqlite          # sqlite | redis | file
  telemetry: console     # console | file | otlp | gcp | datadog
  policy: builtin        # builtin | opa | cedar

ci:
  platform: local        # local | github | gitlab | bitbucket
  self_healing: true

Environment variable overrides (highest precedence):

export AG_OS_MONTHLY_CAP=100.00
export AG_OS_MAX_LOOPS=10

Writing a Custom Provider

Every provider is a Python class with a @register decorator:

from ag_os.providers.registry import register
from ag_os.providers.cost import CostProvider

@register("cost", "my_cloud")
class MyCloudCostProvider(CostProvider):
    def get_current_spend(self) -> float:
        return self._client.get_month_to_date()

    def get_tier_rate(self, tier: str) -> float:
        return self._rates[tier]

See CONTRIBUTING.md for the full provider development guide.


Project Structure

ag-os/
├── ag_os/
│   ├── cli.py                  # ag-os CLI (init, check, demo, status)
│   ├── config.py               # antigravity.yaml loader
│   ├── core/
│   │   ├── cost_guard.py       # Solvency logic (Rule 08)
│   │   ├── flight_recorder.py  # State machine (Rule 05)
│   │   └── rules_engine.py     # Policy evaluator
│   └── providers/
│       ├── registry.py         # @register + get_provider()
│       ├── secrets/            # SecretsProvider ABC + local, env
│       ├── issues/             # IssueProvider ABC + console
│       ├── cost/               # CostProvider ABC + local
│       ├── state/              # StateProvider ABC + sqlite
│       ├── telemetry/          # TelemetryProvider ABC + console
│       └── policy/             # PolicyProvider ABC + builtin
├── antigravity.yaml
├── pyproject.toml
├── LICENSE
├── CONTRIBUTING.md
├── SECURITY.md
├── CHANGELOG.md
└── ROADMAP.md

Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines.

Key areas where help is needed:

  • New providers (AWS, GCP, Linear, Datadog, OPA)
  • CI template generators (GitLab, Bitbucket)
  • Documentation and tutorials
  • Unit tests

License

MIT -- Daniel Manzela, 2026.


Links

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

ag_os-1.1.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

ag_os-1.1.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file ag_os-1.1.0.tar.gz.

File metadata

  • Download URL: ag_os-1.1.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ag_os-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ee91c639582eb60450f34947151c209fed6403def64bc1b3bc169518d0726935
MD5 f322467d0b30045e44298e044f5427e5
BLAKE2b-256 dd115417af2dde2e2d68cdc4048178fb25e9d168eb41ee9bfe71b656bb33beb6

See more details on using hashes here.

File details

Details for the file ag_os-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ag_os-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ag_os-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61fe1e65ef9386bc915e660c2aaec73bca05c3aaee7fa3037912ec1ea51d3a73
MD5 fe185fa4be7cad696ca38231b1b961b3
BLAKE2b-256 880b9383268296fe148851c22d5393cc9e7405f8ee0a4b0c10e7611ed16d9a1f

See more details on using hashes here.

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