Cloud Mode

Connect your SDK to the AgentSudo dashboard for real-time monitoring.

ℹ️

Coming Soon — Cloud Mode will connect to the hosted dashboard when it launches. For now, AgentSudo works 100% locally with full audit logging. See the preview to explore what's coming.

Cloud Mode will connect your Python SDK to the AgentSudo dashboard for real-time monitoring, analytics, and audit logs.

How It Will Work

1. Get your API Key from the Dashboard (coming soon)

2. Configure Cloud Mode:

import agentsudo

agentsudo.configure_cloud(api_key="as_your_api_key")

All permission checks will then appear in your dashboard.

Full Example

from agentsudo import Agent, sudo, configure_cloud

# Connect to dashboard
configure_cloud(api_key="as_your_api_key")

# Create an agent
support_bot = Agent(
    name="SupportBot",
    scopes=["read:customers", "read:orders"]
)

@sudo(scope="read:customers")
def get_customer(id: str):
    return {"id": id, "name": "John Doe"}

@sudo(scope="write:refunds")
def process_refund(id: str):
    return {"refunded": True}

# Run with session
with support_bot.start_session():
    get_customer("123")      # ✅ Allowed - green in dashboard
    
    try:
        process_refund("456")  # ❌ Denied - red in dashboard
    except PermissionError:
        pass

Configuration

agentsudo.configure_cloud(
    api_key="as_your_api_key",  # Required
    async_send=True              # Optional (default: True)
)
ParameterTypeDefaultDescription
api_keystr-Your project API key
async_sendboolTrueSend events in background thread

Using Environment Variables

export AGENTSUDO_API_KEY="as_your_api_key"
import os
import agentsudo

if api_key := os.environ.get("AGENTSUDO_API_KEY"):
    agentsudo.configure_cloud(api_key=api_key)

Privacy

⚠️

Only permission metadata is sent. No function arguments, return values, or user data leaves your system.

Each event contains:

  • Agent name
  • Scope checked
  • Allowed/denied result
  • Function name
  • Timestamp

Local-Only Mode

Without configure_cloud(), the SDK works fully offline:

from agentsudo import Agent, sudo

# No cloud = local only
agent = Agent(name="LocalBot", scopes=["read:data"])

with agent.start_session():
    # Works offline, logs to console
    pass

Current Recommendation

For now, use local-only mode. The SDK provides full functionality:

from agentsudo import Agent, sudo

agent = Agent(name="MyBot", scopes=["read:data", "write:data"])

@sudo(scope="read:data")
def get_data():
    return {"data": "value"}

with agent.start_session():
    get_data()  # Logs to console in JSON format
💡

Local mode is fully featured. Cloud mode will add team visibility when the hosted dashboard launches.