Skip to main content
Managed Runtime Protocol defines the interface for remote agent execution where the entire agent loop runs on provider infrastructure.
The user delegates a task; the full agent loop executes on managed provider infrastructure via the runtime protocol.

Protocol Choice

Quick Start

1

Basic Lifecycle

Create agent, environment, session, then send events and stream responses.
2

With Advanced Configuration

Full configuration with packages, networking, and vaults.

How It Works


Protocol Methods

Agent Management

Environment Management

Session Management

Event Handling

Per-call execute() kwargs

AnthropicManagedAgent.execute() and LocalManagedAgent.execute() honour two per-call keyword arguments that ComputeManagedAgent has always honoured.
Fixed in PraisonAI PR #5774 (issue #5773). Before #5774, both execute() methods were one-liners of the shape await loop.run_in_executor(None, self._execute_sync, prompt), so every caller-supplied kwarg was silently discarded. ComputeManagedAgent honoured timeout, AnthropicManagedAgent used its instance-level self.timeout, and LocalManagedAgent was effectively unbounded. #5774 routes both through a shared ManagedBackendBase._execute_in_executor helper that honours stream_live and timeout and calls interrupt() on timeout. Unknown kwargs are still accepted (not raised as TypeError) to avoid breaking existing callers.
timeout= on execute() bounds the async wait, not the worker thread. On timeout the backend is interrupted (AnthropicManagedAgent.interrupt sends user.interrupt to the active session) but the Python thread already dispatched into _execute_sync cannot be killed.
Since PraisonAI PR #3908, agent.start(prompt, stream=True) yields chunks from backend.stream() as they arrive, on both async and sync callers. Earlier releases buffered the full response in the sync (no running event loop) path. See Streaming → Managed-backend streaming.

Common Patterns

Multi-Turn Conversation

Agent Version Pinning

Session Cleanup


Best Practices

Create agents and environments once, reuse across sessions:
Handle network failures and provider errors gracefully:
Handle different event types appropriately:
  • Reuse agent/environment definitions across sessions
  • Use appropriate session cleanup (archive vs delete)
  • Pin agent versions for consistent behavior
  • Filter list operations to reduce API calls

Sandboxed Agent

Local agent loop with optional tool sandboxing

Managed Agent Lifecycle

Complete CRUD operations for agents, environments, sessions

Streaming

How backend= streams each chunk incrementally from sync code