Skip to content

sauravbhattacharya001/ai

Repository files navigation

🤖 AI Replication Sandbox

A contract-enforced, sandboxed system for studying AI agent self-replication

CI CodeQL Docker License: MIT Python 3.10+ Code style: flake8 codecov PyPI Docs GitHub stars GitHub issues PRs Welcome Last Commit Repo Size Security Policy Dependabot


Overview

AI Replication Sandbox models a replication-aware worker system where autonomous agents can self-replicate under strict, auditable constraints. It provides a simulator-friendly environment for testing replication policies without requiring Docker or Podman — while documenting the exact resource and network boundaries each worker would get in production.

Why does this exist? As AI agents gain autonomy, controlling how and when they spawn copies of themselves is a critical safety challenge. This project provides a testbed for designing and validating those controls.

Architecture

┌─────────────────────────────────────────────────────┐
│                   Controller                        │
│  ┌──────────┐  ┌──────────┐  ┌────────────────┐    │
│  │ Contract │  │ Registry │  │ Kill Switch    │    │
│  │ Engine   │  │ & Quotas │  │ & Audit Trail  │    │
│  └──────────┘  └──────────┘  └────────────────┘    │
│         ▲            ▲               ▲              │
│         │ sign       │ register      │ kill         │
│         │            │               │              │
│  ┌──────┴────────────┴───────────────┴──────────┐  │
│  │              Manifest (HMAC-signed)          │

Getting Started

Installation

pip install ai-replication-sandbox

Quick Start

from ai_sandbox import Sandbox

# Initialize a controlled environment
sandbox = Sandbox(quota={"max_children": 2, "max_depth": 1})

# Run an agent under a replication contract
sandbox.run("agent_script.py")

License

This project is licensed under the MIT License - see the LICENSE file for details.