argos-sdk / argos-php
argos Security SDK for PHP
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- laravel/framework: ^9.0|^10.0|^11.0
- phpunit/phpunit: ^9.0
Suggests
- laravel/framework: For Laravel middleware support
This package is not auto-updated.
Last update: 2026-05-16 10:05:42 UTC
README
argos is a production-grade security SDK for PHP, designed for real-time threat detection, fraud prevention, and automated response. It monitors incoming requests, scores risk using advanced ML models, and enables you to block threats instantly.
✨ Key Features
- 🚀 High Leverage: Zero-config initialization with
initialize()for environment auto-detection. - ⚡ Smart Batching: Automatic event queuing and background flushing via shutdown hooks.
- 🛡️ Framework First: Native support for Laravel, WordPress, and Plain PHP applications.
- 🔄 Resilience Built-in: Circuit breakers, exponential backoff, and TTL-based blocklist caching.
- 🧩 Deep Locality: Centralized IP extraction and packet normalization.
📦 Installation
composer require argos-sdk/argos-php
🚀 Quick Start
1. Basic Ingestion
The simplest way to start monitoring events.
use Argos\Client\ArgosClient;
use Argos\Client\ArgosConfig;
$config = new ArgosConfig(
apiKey: 'your-api-key',
autoBlockOnBlock: true
);
$client = new ArgosClient($config);
$client->initialize(); // Auto-detects environment ID
// Ingest an event
$client->ingest([
'event_type' => 'login',
'user_id' => 'user_123',
'status' => 'success'
]);
2. Using Middleware (The Recommended Way)
Drop argos into your application for instant protection.
Laravel Example
Register the middleware in your Kernel.php or route files:
// In a route group
Route::middleware([\Argos\Middleware\Laravel\ArgosMiddleware::class])->group(function () {
Route::get('/secure-data', function () {
return response()->json(['message' => 'Secure!']);
});
});
Plain PHP Example
$middleware = new \Argos\Middleware\PlainPHP\ArgosMiddleware($client);
$middleware->run(function() {
// Your application logic here
echo "Processing request...";
});
🛠️ Middleware Support
| Platform | Middleware / Plugin |
|---|---|
| Laravel | Argos\Middleware\Laravel\ArgosMiddleware |
| WordPress | Argos\Middleware\WordPress\ArgosMiddleware |
| Plain PHP | Argos\Middleware\PlainPHP\ArgosMiddleware |
⚙️ Configuration Options
| Option | Default | Description |
|---|---|---|
apiKey | Required | Your Argos API key. |
environmentId | Auto | Set manually or let initialize() detect it. |
autoBlockOnBlock | false | Automatically block IPs that return a BLOCK verdict. |
flushInterval | 5s | Interval for automatic background event flushing. |
batchSize | 50 | Max events per batch flush. |
blocklistCacheTTL | 60s | TTL for in-memory blocklist check cache. |
timeout | 30s | Request timeout for API calls. |
🤝 Contributing
We welcome contributions! Please see our CONTRIBUTORS.md for our coding philosophy and standards.
To run the test suite:
vendor/bin/phpunit
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright © 2026 Tachyonix Security. All rights reserved.