Artificial Intelligence1 min read

Show HN: phpClaw – AI agent runtime for PHP with tools, memory and guards

By · Published by Everything Blog

In short

The software enables models to perform actions like database queries, codebase searches, file modifications, and shell operations within a controlled ReAct reasoning loop. Complex tasks are managed through native graph and pipeline architectures that support task fanning, branching, and human-in-the-loop pauses. To maintain operational safety, the package features eight default security guards and opt-in rate limiting. The engine also caps autonomous reasoning cycles at a default threshold of 20 iterations.

Key points

  • The default execution cycle limits model reasoning to twenty iterations to control automa…: The default execution cycle limits model reasoning to twenty iterations to control automated task progression.
  • Production safety is enforced using eight default guards covering prompt injection, destr…: Production safety is enforced using eight default guards covering prompt injection, destructive SQL, and personally identifiable information.
  • Tool operations feature built-in protections such as shell command allowlists, file sandb…: Tool operations feature built-in protections such as shell command allowlists, file sandboxing, and DNS-rebinding prevention.

Sources checked by our analysis pipeline: 1

Tools, memory, security, and a ReAct loop, already built. Zero framework dependencies in core. Any LLM provider.

Documentation · Adapters · Why phpClaw · Install · MCP · Security

composer require phpclaw/phpclaw

export ANTHROPIC_API_KEY="sk-ant-..."

$agent = PhpClaw\Claw::builder()->build();

echo $agent->send('What can you help me with?')->text;

One env var, one builder, one send()

. The builder checks ANTHROPIC_API_KEY

, then OPENAI_API_KEY

, GROQ_API_KEY

, GEMINI_API_KEY

, MISTRAL_API_KEY

, DEEPSEEK_API_KEY

, OLLAMA_HOST

, in that order, and uses whichever it finds first. No YAML, no agent framework to learn, no vendor lock-in.

An agent without tools can only talk. Register the ones your application needs and it starts doing real work:

use PhpClaw\Claw;

use PhpClaw\Tools\ShellTool;

use PhpClaw\Tools\HttpTool;

use PhpClaw\Tools\FileReadTool;

use PhpClaw\Tools\DatabaseQueryTool;

use PhpClaw\Tools\CodeSearchTool;

$agent = Claw::builder()

->tools([

new ShellTool(allowlist: ['ls', 'df', 'tail']),

new HttpTool(),

new FileReadTool(),

new DatabaseQueryTool($pdo),

new CodeSearchTool(),

])

->build();

> Check disk usage and tail the last 20 lines of the error log

> Is api.example.com responding right now?

> Run a read-only SELECT to count today's orders

> Find every place UserService is used in this codebase

The agent…

Artificial Intelligence