How phpclaw-php/phpclaw-cloud works
phpClaw Cloud is an optional transport and security extension for phpClaw agents. With a cloud key, CloudManager resolves the subscription manifest, then registers enabled lifecycle hooks and scan guards. Lifecycle events are converted into bounded, redacted payloads and sent asynchronously to Cloud; enabled prompt scans instead send messages for a verdict before the agent proceeds. Cloud capabilities include run tracing, model/tool monitoring, plan-based usage limits, feature opt-outs, and content hiding. The sampled source supports the manifest/cache, hook, payload, HTTP, and scan connections shown; broader dashboard behavior is documented but not implemented in this package.
Main entry points: CloudHttp.php Cloud HTTP client · CloudManager.php Cloud manager · CloudWebhookHook.php Cloud webhook hook · CloudScanGuard.php Cloud scan guard
Components 14
Cloud activation
- Cloud manager
src/CloudManager.php - Subscription manifest
src/CloudManifest.php - Manifest cache
src/CloudManager.php
Lifecycle telemetry
- Hook registry
- Lifecycle events
- Cloud webhook hook
src/CloudWebhookHook.php - Payload builder
src/CloudPayloadBuilder.php
Prompt security
- Guard registry
- Cloud scan guard
src/CloudScanGuard.php
Cloud service
- Cloud HTTP client
src/CloudHttp.php - phpClaw Cloud API
- Tracing and usage
Other components
- phpClaw application
- Agent prompt
Connections 21
- phpClaw application → Cloud manager: activates with key
- Cloud manager → Manifest cache: reads and writes
- Cloud manager → Cloud HTTP client: fetches manifest
- Cloud HTTP client → phpClaw Cloud API: GET manifest
- phpClaw Cloud API → Cloud HTTP client: returns manifest
- Cloud HTTP client → Cloud manager: returns response
- Cloud manager → Subscription manifest: resolves config
- Cloud manager → Hook registry: registers hooks
- Cloud manager → Guard registry: registers guards
- Lifecycle events → Hook registry: dispatches events
- Hook registry → Cloud webhook hook: invokes hook
- Cloud webhook hook → Payload builder: builds payload
- Cloud webhook hook → Cloud HTTP client: sends payload
- Cloud HTTP client → phpClaw Cloud API: POST run
- phpClaw Cloud API → Tracing and usage: provides tracing
- Agent prompt → Guard registry: checks prompt
- Guard registry → Cloud scan guard: invokes guard
- Cloud scan guard → Cloud HTTP client: requests scan
- Cloud HTTP client → phpClaw Cloud API: POST scan
- phpClaw Cloud API → Cloud HTTP client: returns verdict
- Cloud HTTP client → Cloud scan guard: returns response