Skip to main content

AgentGraph bridge for Microsoft AutoGen — trust-gated tools and agent registration for the AgentGraph trust network

Project description

agentgraph-bridge-autogen

Trust-gated AutoGen tools for the AgentGraph trust network

Status: Early Development — feedback welcome

Install

pip install agentgraph-bridge-autogen

# With AutoGen support:
pip install agentgraph-bridge-autogen[autogen]

Trust-Gated Tools

Wrap any function with an AgentGraph trust check before registering it with AutoGen. The wrapper will verify the trust score of the underlying repo/package before every execution.

from agentgraph_bridge_autogen import trust_gated_tool

def search(query: str) -> str:
    """Search the web for information."""
    return f"Results for {query}"

# Wrap with trust gate
safe_search = trust_gated_tool(search, "owner/repo")

# Register with AutoGen
from autogen import register_function
register_function(
    safe_search,
    caller=assistant,
    executor=user_proxy,
    description="Search the web",
)

Decorator syntax

from agentgraph_bridge_autogen import trust_gated_function

@trust_gated_function("owner/repo", min_tier="trusted")
def calculator(expression: str) -> str:
    """Evaluate a math expression."""
    return str(eval(expression))

# Register directly with AutoGen
register_function(
    calculator,
    caller=assistant,
    executor=user_proxy,
    description="Evaluate math expressions",
)

Custom trust thresholds

from agentgraph_bridge_autogen import TrustGuard, trust_gated_tool

guard = TrustGuard(min_tier="trusted")  # stricter than "standard"
safe_tool = trust_gated_tool(my_func, "owner/repo", guard=guard)

Quick trust check (no tool wrapping)

from agentgraph_bridge_autogen import check_trust

result = await check_trust("microsoft/autogen")
print(f"{result.grade} ({result.score}/100) -- {result.reason}")
if result.allowed:
    # proceed
    ...

Full AutoGen example

from autogen import AssistantAgent, UserProxyAgent, register_function
from agentgraph_bridge_autogen import trust_gated_tool, TrustGuard

# Create agents
assistant = AssistantAgent(
    name="assistant",
    llm_config={"model": "gpt-4"},
)
user_proxy = UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
)

# Define and gate tools
def web_search(query: str) -> str:
    """Search the web."""
    return f"Results for {query}"

guard = TrustGuard(min_tier="standard")
safe_search = trust_gated_tool(web_search, "owner/search-lib", guard=guard)

# Register the trust-gated tool
register_function(
    safe_search,
    caller=assistant,
    executor=user_proxy,
    description="Search the web (trust-verified)",
)

# Start conversation -- tools will be trust-checked before execution
user_proxy.initiate_chat(assistant, message="Search for AI agent frameworks")

What This Does

This bridge provides trust-gated execution for AutoGen tool functions. It wraps callable functions so they check AgentGraph trust scores before running. If a tool's repo falls below your minimum trust tier, execution is blocked with a clear error message.

Works with AutoGen's register_function pattern -- wrap your functions before registration and trust checks happen transparently on every call.

Trust Tiers

From most to least trusted: verified > trusted > standard > minimal > restricted > blocked

Set min_tier to control the minimum acceptable level. Default is "standard".

Documentation

Full docs at agentgraph.co/docs

Contributing

This package is in early development. We welcome issues, feedback, and PRs.

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

agentgraph_bridge_autogen-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

agentgraph_bridge_autogen-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file agentgraph_bridge_autogen-0.1.0.tar.gz.

File metadata

File hashes

Hashes for agentgraph_bridge_autogen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90c7e245cf6c6797a4acbe48e40698798ee706fed2b25e3396f82bda2e8644e0
MD5 5893bd5cce231de1d49bcdf7af0a42da
BLAKE2b-256 7fa6f00a733de4e902c1acefda7c2b12362ba40cab38710a92fd1c5ca6d8b787

See more details on using hashes here.

File details

Details for the file agentgraph_bridge_autogen-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentgraph_bridge_autogen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f92df0331945255d6412a262c6de30c02d509d279cc5a29257f972d918b0829
MD5 c7b0ae3db02c7153ccb4e525d961fdf6
BLAKE2b-256 acaaabb9ab8dcdf39a172cc2e5c202a7940958d781b3e7366d0583c3f2fe93c7

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