Documentation Index Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Typed configuration classes provide type safety and validation for networking and package management in managed environments.
Quick Start
NetworkingConfig Usage
Configure network access with type safety. from praisonai import ManagedConfig , NetworkingConfig , NetworkingType
# Unrestricted networking (default)
config = ManagedConfig (
networking = NetworkingConfig (
type = NetworkingType . UNRESTRICTED
)
)
# Limited networking with allowed hosts
config = ManagedConfig (
networking = NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[ " api.openai.com " , " github.com " ],
allow_mcp_servers = True ,
allow_package_managers = False
)
)
PackagesConfig Usage
Configure package dependencies for all supported managers. from praisonai import ManagedConfig , PackagesConfig
config = ManagedConfig (
packages = PackagesConfig (
pip =[ " pandas " , " numpy " , " matplotlib " ],
npm =[ " express " , " lodash " ],
apt =[ " curl " , " git " , " vim " ],
cargo =[ " serde " , " tokio " ],
gem =[ " rails " , " sinatra " ],
go =[ " github.com/gin-gonic/gin " ]
)
)
# Convert to dict for API serialization
packages_dict = config . packages . to_dict ()
# Result: {"pip": ["pandas", "numpy", "matplotlib"], "npm": ["express", "lodash"], ...}
How It Works
NetworkingConfig
Configuration Options
Option Type Default Description typeNetworkingTypeUNRESTRICTEDNetwork access level allowed_hostsOptional[List[str]]NonePermitted hostnames for LIMITED type allow_mcp_serversboolTrueAllow MCP server connections allow_package_managersboolTrueAllow package manager access
NetworkingType Enum
from praisonai import NetworkingType
# Available types
NetworkingType . UNRESTRICTED # Full internet access
NetworkingType . LIMITED # Restricted to allowed_hosts
Examples
# Unrestricted networking
net = NetworkingConfig ( type = NetworkingType . UNRESTRICTED )
# Production-safe limited networking
net = NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[
" api.openai.com " ,
" api.anthropic.com " ,
" github.com " ,
" pypi.org "
],
allow_mcp_servers = True ,
allow_package_managers = True
)
# Minimal networking (MCP and packages only)
net = NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[],
allow_mcp_servers = True ,
allow_package_managers = True
)
PackagesConfig
Configuration Options
Package Manager Type Default Description pipOptional[List[str]]NonePython packages npmOptional[List[str]]NoneNode.js packages aptOptional[List[str]]NoneDebian/Ubuntu system packages cargoOptional[List[str]]NoneRust packages gemOptional[List[str]]NoneRuby packages goOptional[List[str]]NoneGo modules
Examples
# Data science environment
pkg = PackagesConfig (
pip =[ " pandas " , " numpy " , " scikit-learn " , " jupyter " ],
apt =[ " build-essential " , " git " ]
)
# Full-stack development
pkg = PackagesConfig (
pip =[ " flask " , " requests " ],
npm =[ " express " , " react " , " typescript " ],
apt =[ " curl " , " git " , " nginx " ]
)
# Multi-language project
pkg = PackagesConfig (
pip =[ " requests " ],
npm =[ " lodash " ],
cargo =[ " serde " ],
gem =[ " rails " ],
go =[ " github.com/gin-gonic/gin " ],
apt =[ " git " , " build-essential " ]
)
# Serialize for API
api_dict = pkg . to_dict ()
Common Patterns
Migration from Dict Config
# Old dict-based config (still works)
config_old = ManagedConfig (
networking ={ " type " : " limited " , " allowed_hosts " : [ " api.openai.com " ]},
packages ={ " pip " : [ " pandas " ], " npm " : [ " express " ]}
)
# New typed config (recommended)
config_new = ManagedConfig (
networking = NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[ " api.openai.com " ]
),
packages = PackagesConfig (
pip =[ " pandas " ],
npm =[ " express " ]
)
)
Environment-Specific Configurations
def get_networking_config ( env : str ) -> NetworkingConfig :
if env == " production " :
return NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[ " api.company.com " ],
allow_mcp_servers = False
)
elif env == " staging " :
return NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[ " api.company.com " , " staging.api.com " ],
allow_mcp_servers = True
)
else : # development
return NetworkingConfig ( type = NetworkingType . UNRESTRICTED )
# Use in config
config = ManagedConfig (
networking = get_networking_config ( " production " )
)
Package Templates
class PackageTemplates :
@ staticmethod
def data_science () -> PackagesConfig :
return PackagesConfig (
pip =[ " pandas " , " numpy " , " matplotlib " , " seaborn " , " jupyter " ],
apt =[ " build-essential " ]
)
@ staticmethod
def web_development () -> PackagesConfig :
return PackagesConfig (
npm =[ " express " , " react " , " typescript " ],
pip =[ " flask " , " requests " ],
apt =[ " nginx " , " curl " ]
)
@ staticmethod
def machine_learning () -> PackagesConfig :
return PackagesConfig (
pip =[ " torch " , " transformers " , " scikit-learn " , " datasets " ],
apt =[ " build-essential " , " git-lfs " ]
)
# Use templates
config = ManagedConfig (
packages = PackageTemplates . data_science ()
)
Best Practices
Use LIMITED networking in production environments: # Production: Restrictive networking
prod_net = NetworkingConfig (
type = NetworkingType . LIMITED ,
allowed_hosts =[ " essential-api.com " ],
allow_mcp_servers = False , # Disable if not needed
allow_package_managers = True # Keep for dependency installation
)
Organize packages logically and minimize dependencies: # Good: Minimal, specific packages
pkg = PackagesConfig (
pip =[ " requests " , " pydantic " ], # Only what's needed
apt =[ " git " ] # Essential tools only
)
# Avoid: Large, unfocused package lists
# pkg = PackagesConfig(pip=["pandas", "torch", "flask", ...]) # Too broad
Both dict and typed configs work seamlessly: # Legacy dict format still supported
config = ManagedConfig (
networking ={ " type " : " unrestricted " },
packages ={ " pip " : [ " pandas " ]}
)
# Typed format provides better IDE support and validation
config = ManagedConfig (
networking = NetworkingConfig ( type = NetworkingType . UNRESTRICTED ),
packages = PackagesConfig ( pip =[ " pandas " ])
)
IDE Support : Auto-completion and type checking
Runtime Validation : Early error detection
API Compatibility : Seamless serialization with to_dict()
Documentation : Self-documenting configuration structure
Managed Vault OAuth credentials management for managed agents
Sandboxed Agent Local agent loop with configurable tool sandboxing