Cred AutoGen integration — credential delegation FunctionTool for Microsoft AutoGen agents
Project description
cred-autogen
Microsoft AutoGen integration for Cred. OAuth2 credential delegation for AI agents.
Install
pip install cred-autogen
Quick Start
import os
from cred_autogen import cred_delegate_tool
tool = cred_delegate_tool(
agent_token=os.environ["CRED_AGENT_TOKEN"],
user_id="user_123",
app_client_id="my_app_client_id",
)
# Register with an AutoGen AssistantAgent
from autogen_agentchat.agents import AssistantAgent
agent = AssistantAgent(
name="assistant",
tools=[tool],
)
Tool Schema
The cred_delegate tool accepts:
| Parameter | Type | Description |
|---|---|---|
service |
string |
Service slug (e.g. google, github) |
scopes |
string[] |
OAuth scopes to request |
user_id and app_client_id are pre-configured at factory time, not agent-controlled.
Handling Consent
When the user hasn't connected the service, the tool raises ConsentRequiredError.
The error's consent_url attribute contains the URL to redirect the user.
from cred import ConsentRequiredError
try:
result = await tool.run_json(
{"service": "google", "scopes": ["calendar.readonly"]},
cancellation_token,
)
except ConsentRequiredError as e:
print(f"Redirect user to: {e.consent_url}")
Cred Cloud (Coming Soon)
Managed cloud delegation is coming. Join the waitlist.
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 cred_autogen-1.0.0.tar.gz.
File metadata
- Download URL: cred_autogen-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57521324ec667b97d6d849387dc081cc1fded7b198c85853685c2bc3b888133c
|
|
| MD5 |
a84034708e0a0c67712f7ee7517956ad
|
|
| BLAKE2b-256 |
cf24f0b2fc2f0955bc43f74db86765facb769fa3d1bcc099833e6f3873554b01
|
File details
Details for the file cred_autogen-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cred_autogen-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3ed939d6827f94a128ade218b55c5f8a620ca5cbed05087ada3cc477c79bc11
|
|
| MD5 |
763648d7ddb1050f315d14614acb3327
|
|
| BLAKE2b-256 |
687fcf817d810f84d5c4b47185d799bcaf5ea7874cafef6946708fba6e039586
|