agentavow-bridge-autogen
Formerly
agentgraph-bridge-autogen. This distribution is now published asagentavow-bridge-autogen. The import module is unchanged —import agentgraph_bridge_autogenstill works.
Trust-gated AutoGen tools for the AgentAvow trust network
Status: Early Development — feedback welcome
Install
pip install agentavow-bridge-autogen
# With AutoGen support:
pip install agentavow-bridge-autogen[autogen]
AutoGen version note. The examples below use the AutoGen 0.2 API (
from autogen import register_function, AssistantAgent, UserProxyAgent). The[autogen]extra pinsautogen-agentchat>=0.2.0, which today resolves to the 0.4+ line (import autogen_agentchat) whereimport autogenandregister_functionno longer exist. To run these examples as written, install the 0.2 API explicitly:pip install "autogen-agentchat<0.4"(or thepyautogen/ag2fork). On 0.4+, the trust gate itself still works —trust_gated_toolreturns a plain callable — so wrap the function inautogen_core.tools.FunctionTooland pass it to anautogen_agentchat.agents.AssistantAgent(tools=[...])instead ofregister_function.
Trust-Gated Tools
Wrap any function with an AgentAvow 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.score}/100 {result.tier} -- {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 AgentAvow 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 agentavow.com/docs
Contributing
This package is in early development. We welcome issues, feedback, and PRs.
Metadata
Release files for agentavow-bridge-autogen 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentavow_bridge_autogen-0.2.1.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentavow_bridge_autogen-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / agentavow_bridge_autogen-0.2.1.tar.gz
| Download URL | agentavow_bridge_autogen-0.2.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e98d1799ac1a491d8526d36fee7cd954ad3622e6461f1e5efdc2432d168c738
|
|
BLAKE2b-256 checksum How to use checksums |
b10c6102b38fe50c89ba21854bb7b2ed1075489a976b684944c089e8d7429b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / agentavow_bridge_autogen-0.2.1-py3-none-any.whl
| Download URL | agentavow_bridge_autogen-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26afbb20a39b25e9f5796c595674cc2b782b255f26dc8de0435b73001ce30bb7
|
|
BLAKE2b-256 checksum How to use checksums |
39a874048bfab374f4093d2faf13ca5b3575958aa0b331b03df0447ec9695f86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|