Skip to main content

A decentralized marketplace for agent capabilities - The Hands of AI Agents

Project description

ATR - Agent Tool Registry

PyPI version License: MIT Build Status

A type-safe, decentralized tool registry for autonomous agents. Part of the Agent OS ecosystem.


Why This Exists

Most agent frameworks hardcode tools directly into their runtimes. This creates tight coupling: add a new capability, restart the entire system. Change a function signature, update dozens of agents. Scale by addition leads to fragility.

We built atr because tool registration should not require restarting your infrastructure.

The Agent Tool Registry decouples tool providers from tool consumers. Agents discover capabilities at runtime through a standardized interface. We subtract the dependency between agent logic and tool implementation to add scale.

This is Scale by Subtraction applied to the agent capability layer.


Installation

pip install agent-tool-registry

For sandboxed execution with Docker:

pip install agent-tool-registry[sandbox]

Quick Start

Register a tool in 5 lines:

import atr

@atr.register(name="calculator", tags=["math"])
def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b

Discover and execute:

tool = atr.get_tool("calculator")
schema = tool.to_openai_function_schema()  # OpenAI-compatible
func = atr.get_callable("calculator")
result = func(a=5, b=3)  # Returns 8

# Or use sandboxed execution (recommended for untrusted code)
from atr import DockerExecutor
docker_exec = DockerExecutor()
result = atr.execute_tool("calculator", {"a": 5, "b": 3}, executor=docker_exec)

Sandboxed Execution

NEW: ATR now supports sandboxed execution using Docker containers. This is essential for running untrusted or agent-generated code safely.

Why Sandboxed Execution?

SDLC agents and LLMs may generate Python or Bash scripts that you cannot safely run directly on your host machine. Sandboxed execution provides:

  • Isolation: Code runs in ephemeral containers, completely isolated from your host
  • Security: No network access, memory limits, automatic cleanup
  • Safety: Protects against malicious code, resource exhaustion, and unintended side effects

Usage

import atr
from atr import DockerExecutor

# Register a tool
@atr.register(name="processor", tags=["data"])
def process_data(numbers: list) -> int:
    """Process data safely in a sandbox."""
    return sum(numbers)

# Option 1: Direct execution (NOT sandboxed - trusted code only)
result = atr.execute_tool("processor", {"numbers": [1, 2, 3, 4]})

# Option 2: Sandboxed execution (RECOMMENDED for untrusted code)
docker_exec = DockerExecutor()
result = atr.execute_tool(
    "processor",
    {"numbers": [1, 2, 3, 4]},
    executor=docker_exec,
    timeout=30
)

Execution Modes

Feature LocalExecutor DockerExecutor
Speed Fast Slower
Security No isolation Full isolation
Network Full access Disabled
Use Case Trusted code Untrusted code

See examples/sandbox_demo.py for complete examples.


Architecture

atr sits in Layer 2 (Infrastructure) of the Agent OS stack.

Responsibility: Tool registration, discovery, and schema generation.
Not responsible for: Tool execution (handled by the Agent Control Plane).

Design

  • Registry: In-memory dictionary-based lookup (local or distributed).
  • Decorator: @atr.register() extracts type signatures and validates strict typing.
  • Spec: Pydantic schema enforcing inputs, outputs, side effects, and metadata.
  • Schema Export: Converts to OpenAI, Anthropic, and other LLM function-calling formats.

The registry stores specifications, not callables. Execution happens in the control plane with proper error handling and observability.


The Ecosystem Map

ATR is one component in a modular Agent OS. Each layer solves a specific problem:

Primitives (Layer 1)

  • caas - Context-as-a-Service: Manages agent memory and state.
  • cmvk - Context Merkle Verification Kit: Cryptographic verification of context integrity.
  • emk - Episodic Memory Kit: Long-term memory storage and retrieval.

Infrastructure (Layer 2)

  • iatp - Inter-Agent Trust Protocol: Secure message authentication.
  • amb - Agent Message Bus: Decoupled event transport.
  • atr - Agent Tool Registry: Tool discovery and schema generation (you are here).

Framework (Layer 3)

  • agent-control-plane - The Core: Agent orchestration and lifecycle management.
  • scak - Self-Correction Agent Kit: Automated error recovery and learning.

Citation

If you use ATR in research, please cite:

@software{atr2024,
  title={ATR: Agent Tool Registry},
  author={Siddique, Imran},
  year={2024},
  url={https://github.com/imran-siddique/atr},
  note={Part of the Agent OS ecosystem}
}

License

MIT License - See LICENSE for details.


Repository: https://github.com/imran-siddique/atr
Documentation: https://github.com/imran-siddique/atr#readme
Issues: https://github.com/imran-siddique/atr/issues

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

agent_tool_registry-0.2.0.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

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

agent_tool_registry-0.2.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file agent_tool_registry-0.2.0.tar.gz.

File metadata

  • Download URL: agent_tool_registry-0.2.0.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for agent_tool_registry-0.2.0.tar.gz
Algorithm Hash digest
SHA256 472c9e9211beed3ede919dae8f0485b4379341b4c9e74494e2a5a302179246b4
MD5 a4c812f5917fd96d14b43539dfdf415b
BLAKE2b-256 8676b1c09a688784fc6c45e97f4d00d6770dda87b37f7118666a607b4939d57e

See more details on using hashes here.

File details

Details for the file agent_tool_registry-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_tool_registry-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e18d258eaff8b023c8dd69c21d37557cc487b0a5ab3bb260b1ae58ef9bafb5b0
MD5 d858ce8bf60a12a0030f6f5301bc97ed
BLAKE2b-256 a0848c2a89af3cabb2a947534c4fcd1b177de568b4df08921700f49596040e49

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