Metadata-Version: 2.4
Name: irongate
Version: 0.0.2
Summary: Deterministic runtime security layer for AI agents. Enforces policies for file access, network requests, process execution, and tool invocation.
Author-email: Pratik Acharya <pratikacharya468@gmail.com>
License: MIT
Project-URL: repository, https://github.com/pratikacharya1234/Irongate
Project-URL: documentation, https://github.com/pratikacharya1234/Irongate#readme
Project-URL: issues, https://github.com/pratikacharya1234/Irongate/issues
Keywords: security,python,ai,agent,policy-enforcement,sandbox,runtime-protection
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.85
Requires-Dist: uvicorn>=0.18
Requires-Dist: requests>=2.0
Requires-Dist: jsonschema>=4.0
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"

# IronGate

**Deterministic runtime security for Python AI agents**

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org)
[![PyPI version](https://img.shields.io/pypi/v/irongate.svg)](https://pypi.org/project/irongate/)

IronGate is a local, in-process policy enforcement layer for Python-based AI agents. It intercepts file, network, process, and tool operations at the Python API level and applies deterministic allow/review/block decisions based on a JSON policy file.

## Quick Start

```bash
pip install irongate
```

### Protect a Script

```bash
irongate run my_agent.py
```

All file, network, process, and tool operations will be intercepted and enforced against your policy.

### Use as a Library

```python
from agentshield import shield

with shield.protect():
    agent.run(query)
```

## Features

- ✅ **Deterministic enforcement** - No AI/ML heuristics, pure policy-based decisions
- ✅ **Multiple enforcement layers** - Audit hooks + monkeypatching for defense in depth
- ✅ **Local-only runtime** - All processing happens in-process, no external services
- ✅ **Fine-grained control** - Policy rules for file, network, process, and tool operations
- ✅ **Human-in-the-loop** - Dashboard for reviewing and approving operations
- ✅ **Audit trail** - Hash-chained SQLite logs for tamper evidence
- ✅ **Deny-by-default** - Unknown operations are blocked by default

## Intercepted Operations

- **File**: `open()`, `read()`, `write()`, `unlink()`, `rename()`, `mkdir()`, and more
- **Network**: `requests`, `httpx`, `urllib`, `aiohttp`, `socket`, `ssl`
- **Process**: `subprocess`, `os.system`, `os.exec*`, `os.spawn*`
- **Tools**: Custom function invocations through LangChain or generic wrappers

## Installation

```bash
pip install irongate
```

Requires Python 3.8+ (audit hooks introduced in Python 3.8).

## Documentation

- Full documentation: https://github.com/pratikacharya1234/Irongate#readme
- Security model: https://github.com/pratikacharya1234/Irongate/blob/main/SECURITY_MODEL.md
- Threat model: https://github.com/pratikacharya1234/Irongate/blob/main/THREAT_MODEL.md

## License

MIT License - see LICENSE for details.

## Contributing

Contributions welcome! See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.

---

**Status**: Experimental (v0.1.0) for evaluation and feedback. Not recommended for production use without thorough testing.
