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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentgraph_bridge_autogen-0.1.0.tar.gz.
File metadata
- Download URL: agentgraph_bridge_autogen-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90c7e245cf6c6797a4acbe48e40698798ee706fed2b25e3396f82bda2e8644e0
|
|
| MD5 |
5893bd5cce231de1d49bcdf7af0a42da
|
|
| BLAKE2b-256 |
7fa6f00a733de4e902c1acefda7c2b12362ba40cab38710a92fd1c5ca6d8b787
|
File details
Details for the file agentgraph_bridge_autogen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentgraph_bridge_autogen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f92df0331945255d6412a262c6de30c02d509d279cc5a29257f972d918b0829
|
|
| MD5 |
c7b0ae3db02c7153ccb4e525d961fdf6
|
|
| BLAKE2b-256 |
acaaabb9ab8dcdf39a172cc2e5c202a7940958d781b3e7366d0583c3f2fe93c7
|