Feature: External Managed Agent Backends
Summary
Support external managed agent infrastructures as execution backends, starting with Anthropic's Managed Agents API. This follows the existing BaseCLIIntegration pattern in praisonai/integrations/.
Motivation
- Enable long-running tasks in managed infrastructure without local resource constraints
- Provide hybrid execution: local agents can delegate to managed backends
- Support use cases requiring secure sandboxed environments
Proposed Implementation
Location
praisonai/integrations/managed_agents.py following existing pattern:
praisonai/integrations/
├── base.py # Existing BaseCLIIntegration
├── claude_code.py # Existing
├── managed_agents.py # NEW - Generic managed agent backend
└── __init__.py
Core Design
class ManagedAgentIntegration(BaseCLIIntegration):
"""Generic integration for managed agent APIs."""
def __init__(
self,
provider: str, # "anthropic", etc.
api_key: str,
config: dict
):
self.provider = provider
self.client = self._create_client(provider, api_key)
self.config = config
async def execute(self, agent_id: str, environment_id: str, prompt: str) -> str:
"""Execute agent in managed infrastructure."""
session = await self.client.sessions.create(
agent=agent_id,
environment_id=environment_id
)
await self.client.sessions.events.send(
session.id,
events=[{"type": "user.message", "content": prompt}]
)
return await self._collect_response(session.id)
Integration with PraisonAI Agent
from praisonai import Agent
from praisonai.integrations import ManagedAgentIntegration
# Create managed backend
managed = ManagedAgentIntegration(
provider="anthropic",
api_key="...",
config={"model": "claude-sonnet-4-6"}
)
# Agent uses managed backend
agent = Agent(
name="coder",
instructions="You are a coding assistant.",
backend=managed # New: backend parameter
)
result = agent.start("Create a FastAPI app")
Minimal Viable Scope
- One file:
integrations/managed_agents.py (~300 lines)
- One protocol:
ManagedBackendProtocol in core SDK
- One config field:
Agent(backend=...) parameter
- Zero new dependencies: Use existing
aiohttp, pydantic
Reuses Existing Components
| Feature |
Already Exists |
Use Via |
| MCP servers |
✅ mcp/ module |
Passthrough to managed backend |
| Skills |
✅ skills/ module |
SKILL.md compatible |
| Tool execution |
✅ tools/ module |
Local tools for custom tool types |
| Event streaming |
✅ EventBus |
Bridge SSE to events |
| CLI pattern |
✅ BaseCLIIntegration |
Extend base class |
API Mapping (Anthropic as reference)
| Endpoint |
Purpose |
POST /v1/agents |
Create agent config |
POST /v1/environments |
Create container env |
POST /v1/sessions |
Start execution |
POST /v1/sessions/{id}/events |
Send messages |
GET /v1/sessions/{id}/stream |
SSE event stream |
Tool Mapping
Managed agent built-in tools map to PraisonAI tools:
bash → execute_command
read/write/edit → read_file/write_file/apply_diff
glob/grep → list_files/search_file
web_fetch/search → web_fetch/search_web
CLI Usage (Optional Phase 2)
# If we add CLI later
praisonai run agents.yaml --backend managed --provider anthropic
Timeline
- Week 1:
ManagedAgentIntegration class, Anthropic provider
- Week 2: Agent backend integration, tests
- Total: ~400 lines, 2 weeks
References
Feature: External Managed Agent Backends
Summary
Support external managed agent infrastructures as execution backends, starting with Anthropic's Managed Agents API. This follows the existing
BaseCLIIntegrationpattern inpraisonai/integrations/.Motivation
Proposed Implementation
Location
praisonai/integrations/managed_agents.pyfollowing existing pattern:Core Design
Integration with PraisonAI Agent
Minimal Viable Scope
integrations/managed_agents.py(~300 lines)ManagedBackendProtocolin core SDKAgent(backend=...)parameteraiohttp,pydanticReuses Existing Components
mcp/moduleskills/moduletools/moduleEventBusBaseCLIIntegrationAPI Mapping (Anthropic as reference)
POST /v1/agentsPOST /v1/environmentsPOST /v1/sessionsPOST /v1/sessions/{id}/eventsGET /v1/sessions/{id}/streamTool Mapping
Managed agent built-in tools map to PraisonAI tools:
bash→execute_commandread/write/edit→read_file/write_file/apply_diffglob/grep→list_files/search_fileweb_fetch/search→web_fetch/search_webCLI Usage (Optional Phase 2)
# If we add CLI later praisonai run agents.yaml --backend managed --provider anthropicTimeline
ManagedAgentIntegrationclass, Anthropic providerReferences
managed-agents-2026-04-01