Skip to main content
PraisonAI includes a comprehensive set of advanced features for production-grade AI agent development. These features provide enhanced control, safety, and developer experience. The user runs a production agent; advanced features handle summarisation, queuing, safe execution, and tool filtering automatically.

How It Works

The agent applies the advanced feature transparently, then returns the result to the user.

Quick Start

1

Auto-summarisation

2

MCP tool filtering


Core SDK Features

Auto-Summarization

Automatically summarize conversations when the context window fills up, preserving important context while reducing token usage.
Model-specific configuration:

Message Queue

Priority-based message queue for agent prompts with thread-safe operations.
Async support:

MCP Tool Filtering

Filter MCP tools with disabled lists or allowlists.

Permission Allowlist

Persistent permission allowlist for pre-approving tools and paths.

CLI Features

Safe Shell Execution

Execute shell commands safely with banned command detection.
SafeShellHandler for custom configurations:

File History & Undo

Track file changes and enable undo operations.

Hierarchical Configuration

Load configuration from multiple sources with precedence — project config is discovered by walking up from the current directory to the git root.
walk_up: bool = True — when enabled, _find_project_config() walks parent directories from project_dir toward the filesystem root, stopping at the first directory containing a .git marker (or after 10 ancestor levels if no git root is found). The nearest config wins. See Hierarchical Configuration for the full walk-up diagram, decision flow, and monorepo patterns. Example .praison.json:

Output Modes

Control CLI output verbosity.

Logs Command

View and follow log files.

Git Commit Attribution

Add AI attribution to git commits.
Attribution styles:
  • assisted-by - “Assisted-by: …”
  • co-authored-by - “Co-Authored-By: …”
  • none - No attribution

Tools

Sourcegraph Integration

Search code across repositories.

Enhanced Download Tool

Download files with approval and progress tracking.

Implementation Notes

DRY Reuse

All features are designed to reuse existing PraisonAI components:
  • Token tracking → Uses telemetry/token_collector.py
  • Permissions → Extends approval.py
  • File ops → Uses file_tools.py
  • Shell safety → Reuses sandbox_executor.py patterns

Thread Safety

All managers are thread-safe:

Async Compatibility

Async variants are provided where needed:

Configuration Reference

Environment Variables

VariableDescription
PRAISON_OUTPUT_MODESet output mode: compact, verbose, quiet
SOURCEGRAPH_URLSourcegraph API URL
SOURCEGRAPH_ACCESS_TOKENSourcegraph access token

Config Schema

Best Practices

Set the summarization threshold to 80% (threshold=0.8) for most models. Lower it to 70% for models with smaller context windows. Too low triggers excessive summarization; too high causes context overflow errors.
Assign URGENT priority to time-sensitive user messages and LOW priority to background tasks. This ensures critical prompts are processed first in high-concurrency scenarios.
Always set an explicit workspace path when using safe_execute. This prevents agents from executing commands outside the intended directory.
Use MCP tool filtering to give each agent only the tools it needs. Overly broad tool access increases attack surface and LLM confusion about which tool to choose.

Context Compression

Automatic context window management

MCP Tool Filtering

Restrict which MCP tools an agent can access