Introduction
The permission layer for AI agents β like Auth0, but for LLMs.
AgentSudo is a lightweight permission engine for AI agents. Enforce scopes, approvals, and safe tool use across LangChain, LlamaIndex, FastAPI, and custom agents.
Think of it as Auth0 for AI agents β simple today, extensible tomorrow.
The Problem
AI agents are becoming powerful, but most run with zero permission controlβthey can call any tool, access any API, and do unexpected things. This creates risks:
- Security - An agent could access sensitive data or perform destructive actions
- Compliance - No audit trail of what agents did and why
- Control - No way to limit agent capabilities based on context
The Solution
AgentSudo adds a lightweight, framework-agnostic permission engine that enforces scopes, rate limits, and human approvals:
- Scoped Permissions - Define exactly what each agent can do
- Session Management - Time-limited access with automatic expiry
- Audit Trails - Track every permission check
- Easy Integration - Simple decorator-based API
Quick Example
from agentsudo import Agent, sudo
# Create an agent with specific permissions
support_bot = Agent(
name="SupportBot",
scopes=["read:orders", "write:refunds"]
)
# Protect functions with the @sudo decorator
@sudo(scope="write:refunds")
def process_refund(order_id: str, amount: float):
# Only agents with write:refunds can call this
print(f"Processing refund of ${amount}")
# Use the agent in a session
with support_bot.start_session():
process_refund("order_123", 50.00) # β
Allowed
Key Features
| Feature | Description |
|---|---|
| Framework-agnostic | Works with any Python codeβLangChain, LlamaIndex, CrewAI, or custom |
| Fine-grained scopes | Control access at the function level |
| Hierarchical permissions | Use wildcards like read:* |
| Session management | Automatic expiry and context tracking |
| Local audit logging | Full trail of all permission checks (works offline) |
| Dashboard (optional) | Visual management and monitoring |
AgentSudo works completely offline. The SDK provides full permission control and JSON audit logging without any external dependencies. The cloud dashboard is an optional add-on for teams who want visual monitoring and analytics.
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Agent A β β Agent B β β Agent C β β
β β read:orders β β read:* β β * β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
β β β β β
β ββββββββββββββββββββΌβββββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β AgentSudo β β
β β Permission β β
β β Engine β β
β ββββββββββ¬βββββββββ β
β β β
β ββββββββββββββββββββΌβββββββββββββββββββ β
β β β β β
β ββββββββΌβββββββ ββββββββΌβββββββ ββββββββΌβββββββ β
β β @sudo β β @sudo β β @sudo β β
β β read:orders β β write:data β β admin:* β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Next Steps
- Getting Started - Install and set up AgentSudo
- Agents - Learn about creating and managing agents
- Scopes - Understand the permission system
- Framework Integrations - Use with LangChain, LlamaIndex, etc.
- Dashboard - Visual management interface