Skip to main content
The coding agent can search the codebase with wired-in grep / glob / ast_grep_search — no shelling out to raw grep -rn.
This uses the ripgrep-backed grep, glob, and structural ast_grep_search tools that ship in the default interactive toolset.

Overview

PraisonAI interactive modes (praisonai tui launch and praison "prompt") now include ACP (Agentic Change Plan), Edit (targeted/fuzzy edits), LSP (Language Server Protocol), and Search (ripgrep-backed grep/glob + structural ast_grep_search) tools by default. This enables agents to:
  • Create, edit, and delete files with plan/approve/apply/verify flow (ACP)
  • Precisely edit files with a targeted find-and-replace engine (edit_file) and atomic multi-file patches (apply_patch), backed by a 5-strategy fuzzy match ladder, SHA-256 staleness guard, BOM/CRLF preservation, and post-edit LSP/linter diagnostics. See File Editing for the engine details.
  • Analyze code with symbol listing, definition lookup, and reference finding (LSP)
  • Search the codebase with ripgrep-backed text/file search and structural AST search (Search)
  • Execute commands with safety guardrails
Backward compatible. Agents that pin --tools <list> or pass groups=[...] keep behaving exactly as before — the default union only changes what runs when nothing is pinned. The whole-file rewrite path (write_file, acp_create_file) is unchanged and still available. To restore the old default, set PRAISON_TOOLS_DISABLE=edit or ToolConfig(enable_edit=False).

Default Tool Groups

All groups are enabled by default in interactive modes; you can disable individual groups per Disabling Tool Groups below.

Quick Start

Disabling Tool Groups

CLI Flags

The --no-acp / --no-lsp flags disable those groups. There is no --no-edit flag and no --no-search flag — disable the edit or search group with the env var below or ToolConfig(enable_edit=False) / ToolConfig(enable_search=False) from Python.

Environment Variables

To disable per-invocation, prefer the env var above; ToolConfig(enable_edit=False) from Python has the same effect.

Tool Details

ACP Tools (Agentic Change Plan)

ACP tools route file operations through a plan/approve/apply/verify flow:
Safety Features:
  • All destructive operations require approval
  • Changes are tracked and can be verified
  • Workspace boundary enforcement

Edit Tools (targeted, atomic edits)

The edit group wires the core edit_file / apply_patch engine into the default interactive toolset. When they run:
  • approval_mode="auto" — context-approved (matching the ACP tools). No blocking console prompt. The loader merges edit_file/apply_patch into the YAML-approved set via add_yaml_approved_tools(...), so pre-existing approvals are preserved (never clobbered).
  • approval_mode="manual" / "scoped" — the normal HIGH-risk approval flow with diff preview still applies.
Fail-closed on workspace containment: If Workspace(root=<workspace>) cannot be built, edit_file/apply_patch are not exposed at all and a WARNING is logged. Combined with auto-approval, an unbounded workspace could let an absolute path (e.g. /etc/hosts) escape the configured directory, so the loader refuses to expose the tools rather than exposing them unsafely. You will see:
See File Editing for the full engine — fuzzy ladder, staleness guard, post-edit diagnostics and formatting, and the apply_patch grammar. That page also covers force=True and expected_hash=... for advanced use.

Which file-editing path fires by default?

Both ACP file tools and the targeted-edit tools are available by default. This is which one runs when you don’t pin anything:

LSP Tools (Code Intelligence)

LSP tools provide semantic code analysis: Fallback Behavior:
  • If LSP server is unavailable, tools fall back to regex-based extraction
  • Results include lsp_used flag to indicate which method was used

Search Tools

The search group wires the ripgrep-backed core search builtins into the default interactive toolset, so the agent no longer shells out to a raw grep -rn. These are the same tools documented at Search Tools and AST-Grep Agent.
code_intelligence search now routes through core grep first and only falls back to grep -rn as a last resort. Results honor the configured workspace root, not the process CWD.
Which search tool fires?

Basic Tools

Standard file and search tools:

Python API

Configuration

ToolConfig Options

Approval Modes

Important: When approval_mode=auto, write operations work even without ACP subsystem running. This enables seamless automation and testing. In auto mode the edit-tools loader also context-approves edit_file and apply_patch (via add_yaml_approved_tools(...), which merges rather than clobbers), so these HIGH-risk tools don’t block on a console prompt. In manual / scoped modes the normal HIGH-risk approval flow with diff preview still applies.

Environment Variables

Debug Logging

Enable debug logging to troubleshoot tool execution:
Debug logs are written to ~/.praisonai/async_tui_debug.log.

Architecture

Testing ACP/LSP Tools

The interactive test framework allows you to test ACP and LSP tools in isolation with full tracing and assertions.

Tool Tracing

When running tests, all tool calls are captured in a structured trace:

Testing Tool Calls

Use the CSV test runner to verify expected tool usage:
The expected_tools / forbidden_tools mechanism applies to edit_file and apply_patch too — assert the targeted-edit path fires instead of a whole-file write_file.

Tool Assertions

The test harness supports two types of tool assertions:
  1. Expected Tools: Tools that MUST be called
  2. Forbidden Tools: Tools that MUST NOT be called

Running Tool Tests

Inspecting Tool Traces

After running with --keep-artifacts, check the tool_trace.jsonl file:

Testing LSP Fallback

LSP tools gracefully fall back to regex when LSP server is unavailable:
The test will pass regardless of whether LSP or regex fallback is used, as long as results are returned.

Network-Enabled Testing

For tests that require network access (e.g., GitHub operations), use the PRAISON_LIVE_NETWORK environment variable:

Command Allowlist

When PRAISON_LIVE_NETWORK=1 is set, the following commands are allowed:

Blocked Commands

The following commands are always blocked for safety:

Secret Redaction

All artifacts automatically redact sensitive information:
  • GitHub tokens (ghp_*, gho_*, github_pat_*)
  • OpenAI keys (sk-*, sk-proj-*)
  • AWS credentials (AKIA*)
  • Bearer tokens
  • Passwords and secrets in config