Iron SDK
Pythonic SDK layer for Iron Cage agent protection with decorators and framework integrations.
Installation
pip install iron-sdk
About Dependencies:
The iron-cage package (containing the Rust runtime) is automatically installed as a dependency - you never need to install or interact with it directly.
Package Hierarchy:
What you install: pip install iron-sdk
What you import: from iron_sdk import protect_agent
Automatic (internal): iron-cage (Rust runtime, auto-installed)
Internal (never seen): iron_runtime (Rust crate)
Quick Start
from iron_sdk import protect_agent, BudgetConfig, SafetyConfig
@protect_agent(
budget=BudgetConfig(max_usd=50.0),
safety=SafetyConfig(pii_detection=True),
)
def my_agent(input: str) -> str:
# Your agent code here
return llm.generate(input)
Architecture
Visual Guide:
- Left (Developer Zone): Agent, iron_sdk, Runtime (Safety/Cost/Audit), Gateway - 100% local
- Middle (Management Plane): Control Panel - NOT in data path
- Right (Provider Zone): LLM provider receives only prompts with IP Token
See root readme for detailed architecture explanation.
Key Features
@protect_agentdecorator for function-level protection- Context managers (
with Budget(...),with Protection(...)) - Framework integrations (LangChain, CrewAI, AutoGPT)
- Typed configuration classes
- Async/await support
Optional Dependencies
# LangChain integration
pip install iron-sdk[langchain]
# CrewAI integration
pip install iron-sdk[crewai]
# AutoGPT integration
pip install iron-sdk[autogpt]
# All integrations
pip install iron-sdk[all]
Examples
See examples/ directory for 20+ runnable examples:
examples/langchain/- LangChain integration examplesexamples/crewai/- CrewAI integration examplesexamples/autogpt/- AutoGPT integration examplesexamples/patterns/- Protection pattern examplesexamples/raw_api/- Direct API usage examples
Run examples:
python examples/langchain/simple_chat.py
Development Status & Roadmap
Current Phase: Initial scaffolding
Pending Implementation:
- Core decorator (@protect_agent)
- Context managers (Budget, Protection)
- Configuration classes
- Framework integrations (LangChain, CrewAI, AutoGPT)
Scope & Boundaries
Responsibilities: Provides a clean, Pythonic API for protecting AI agents with budget tracking, PII detection, and reliability patterns. Wraps the low-level PyO3 bindings from iron_runtime with decorators, context managers, and typed configurations for ergonomic Python usage.
In Scope:
@protect_agentdecorator for function-level protection- Context managers (
with Budget(...),with Protection(...)) - Typed configuration classes (BudgetConfig, SafetyConfig, ReliabilityConfig)
- Framework integrations (LangChain, CrewAI, AutoGPT)
- Async/await support for async agents
- Error handling with Python exceptions
Out of Scope:
- PyO3 FFI bindings (see iron_runtime)
- Budget calculation logic (see iron_cost)
- PII detection patterns (see iron_safety)
- Circuit breaker implementation (see iron_reliability)
Documentation
- Specification: See
spec.mdfor complete technical requirements - API Reference: Coming soon
- Examples: See
examples/directory for runnable examples
License
Apache-2.0 - See license file for details
Metadata
Release files for iron-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iron_sdk-0.2.0.tar.gz | 5.6 kB | Without provenance | Details for iron_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iron_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for iron_sdk-0.2.0-py3-none-any.whl |
Total release size: 10.9 kB
Release files / iron_sdk-0.2.0.tar.gz
| Download URL | iron_sdk-0.2.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f12df12267508039879c1fe29b9b25c4f740d7afbbcd49be5717b2acdcea9210
|
|
BLAKE2b-256 checksum How to use checksums |
9f2861658cdaa87a269d43a12ccce98678401394b5dccc9d020981e93227ca89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iron_sdk-0.2.0-py3-none-any.whl
| Download URL | iron_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
967df1b1a9dbbdfc340385c1ec0ef88864159ca48d321395dcf29d5cb8d1db07
|
|
BLAKE2b-256 checksum How to use checksums |
3948f5f4fdb218680ce1a5375c6b5331bf1a383d4b85ba10d9e1808eb8ad28d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for iron-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.