Skip to main content

Policy-enforced runtime for autonomous AI agents

Project description

Antraft

The Immune System for Agentic AI.

Antraft is an enterprise-grade runtime governance framework for AI agents. It serves as the Governance Layer that makes autonomous agents safe for production deployment.

Antraft acts as a middleware between your agent's "Brain" (LLM) and its "Hands" (Tools), enforcing specific policies, logging actions, and ensuring compliance. It is designed to be framework-agnostic, working seamlessly with LangChain, AutoGen, CrewAI, and custom implementations.

Antraft is the reference implementation of the MI9 Agent Intelligence Protocol.


Key Capabilities

1. Robust Governance

Secure your agents with deterministic rules.

  • Policy Enforcement: Approve, deny, or pause every action before execution.
  • Stateful Control: Enforce prerequisites (e.g., "Must authenticate before reading data").
  • Rich Logic Rules: define complex constraints like amount > 1000 and not user_verified.
  • Path Confinement: Restrict file access to specific directories.

2. Deep Observability

Complete visibility into agent behavior.

  • Session Recording: Capture full execution traces (Inputs, Thoughts, Actions, Outputs) for replay debugging.
  • PII Redaction: Automatically scrub sensitive data (Emails, SSNs) from logs.
  • Cognitive Telemetry: Log the agent's reasoning process, not just its actions.
  • Drift Detection: Identify anomalous behavior patterns (loops, spikes) in real-time.

4. Distributed Control

Manage fleets of agents at scale.

  • Swarm Protocol: Control thousands of agents across different servers from a central API.
  • Human-in-the-Loop: Pause high-risk actions and wait for human approval via API.
  • Dynamic Policies: Update agent permissions on-the-fly without restarting.

5. Universal Compatibility (MCP)

Antraft runs as a Model Context Protocol (MCP) server, making it instantly compatible with:

  • Claude Desktop
  • Cursor / Windsurf IDEs
  • Any MCP-compliant client

Installation

pip install antraft

Quick Start ("Fluent" SDK)

The Antraft SDK provides a fluent interface to secure ANY python agent in seconds.

import asyncio
from antraft import Antraft

# 1. Define your Agent & Tools
agent = MyAgent()
tools = {
    "search": google_search_tool,
    "shell": run_shell_tool
}

async def main():
    # 2. Wrap & Secure
    await Antraft.guard(agent, tools) \
        .allow(["search"]) \
        .deny(["shell"]) \
        .record_session("logs/session_01.jsonl", redact_pii=True) \
        .run()

if __name__ == "__main__":
    asyncio.run(main())

Advanced Usage

Defining Complex Policies (YAML)

For enterprise use cases, load policies from file.

# policy.yaml
allow:
  - read_file
rules:
  - trigger: "action:transfer_money"
    checks:
      - "amount > 10000"
    enforce: "pause"
    message: "High value transfer requires approval."
await Antraft.guard(agent, tools) \
    .load_policy("policy.yaml") \
    .run()

Swarm Mode (Remote Control)

Connect an agent to a central Control Plane.

1. Start the Server:

python -m antraft.cli.main serve

2. connect Agents:

await Antraft.guard(agent, tools) \
    .connect_swarm("http://localhost:8000") \
    .run()

Documentation

  • User Guide: Comprehensive "How-To".
  • Architecture: System design and components.
  • Threat Model: Security analysis.
  • Syntax Guide: Configuration reference.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

MIT License

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

antraft-1.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

antraft-1.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for antraft-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2b627523339dd539eccd95a8aaff339133191d3a59707d69f5295b98c2711266
MD5 e87cc19988b016c48d9c3865abea5702
BLAKE2b-256 bc01378a6bdc178ab217b8cd35e3b52dcc7a006a1572b048e287e7d088c9d0c8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for antraft-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22ff4b4826e09d38054e4ac5354039da09d0369c8396c695019a41ae80a23c31
MD5 144ec1ce7da7655f2ec7231260082de7
BLAKE2b-256 08aceedf29360e58bab2d1e74455a7b9265ee95647ed4e092122c318e6b54d8d

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