Agents
Understanding autonomous agents in FixPanic
An Agent is an autonomous software unit that runs on your infrastructure. Agents are the core of FixPanic's capabilities, enabling AI-powered diagnostics, monitoring, and incident response.
What is an Agent?
An agent is:
- Autonomous - Can operate independently on your servers
- AI-Powered - Understands natural language requests
- Sandboxed - Executes commands in a secure environment
- Connected - Maintains a persistent link to FixPanic
Agent Capabilities
System Diagnostics
Agents can investigate system state:
- Process monitoring (CPU, memory usage)
- Disk space and I/O analysis
- Network connectivity and traffic
- Service health and status
Log Analysis
Agents can analyze logs:
- Search for patterns and errors
- Correlate events across time
- Identify anomalies
- Summarize recent activity
Service Management
With approval, agents can:
- Check service status
- Restart services
- View container states
- Manage processes
Custom Commands
Agents can execute whitelisted commands:
- Run diagnostics scripts
- Execute health checks
- Gather metrics
- Perform routine maintenance
Agent Lifecycle
Agents go through distinct states:
| State | Description | Resource Usage |
|---|---|---|
| Created | Record exists, not deployed | None |
| Deploying | Installing on server | Temporary |
| Running | Active and connected | Normal |
| Paused | Suspended, config preserved | Minimal |
| Stopped | Terminated intentionally | None |
| Failed | Terminated due to error | None |
State Transitions
| From | To | How |
|---|---|---|
| Created | Deploying | Install command |
| Deploying | Running | Successful start |
| Deploying | Failed | Installation error |
| Running | Paused | Manual pause |
| Running | Stopped | Manual stop |
| Running | Failed | Runtime error |
| Paused | Running | Resume |
| Stopped | Running | Start |
Agent Architecture
Components
Each agent consists of:
Connection Model
Agents maintain a persistent TCP connection:
- Registration - Agent identifies itself with credentials
- Heartbeat - Every 30 seconds, confirms connectivity
- Commands - Receive and execute requests
- Responses - Stream results back to platform
MCP Shell Server
The Model Context Protocol (MCP) shell server provides:
- Tool interface for command execution
- Security validation before execution
- Resource management for processes
- Output capture for results
Agent Types
Different agents may have different capabilities:
| Type | Focus | Example Tools |
|---|---|---|
| System | OS-level diagnostics | ps, top, df, netstat |
| Database | Database operations | mysql, psql, redis-cli |
| Container | Container management | docker, kubectl |
| Custom | Specialized tasks | Your scripts |
Agent Communication
Protocol
Agents communicate using JSON over TCP:
{
"type": "COMMAND",
"agent_id": "agent_abc123",
"request_id": "req_xyz789",
"timestamp": "2024-01-15T10:30:00Z",
"payload": {
"command": "ps",
"args": ["aux", "--sort=-%cpu"]
}
}Message Types
| Type | Direction | Purpose |
|---|---|---|
REGISTER | Agent → Platform | Initial authentication |
HEARTBEAT | Both | Keep-alive signal |
COMMAND | Platform → Agent | Command request |
RESPONSE | Agent → Platform | Command result |
ERROR | Agent → Platform | Error notification |
Security
All communication is:
- Authenticated - Using API keys
- Validated - Request ID correlation
- Timestamped - Replay attack prevention
- Logged - Complete audit trail
Resource Usage
Typical agent resource consumption:
| Resource | Usage |
|---|---|
| Memory | 30-50 MB |
| CPU | < 1% (idle) |
| Network | Minimal (heartbeats) |
| Disk | Config + logs |
When executing commands, usage temporarily increases based on the command.
Best Practices
Naming
Use clear, descriptive names:
- Include environment:
prod-,staging-,dev- - Include role:
-web,-db,-worker - Include location:
-us-east,-eu-west
Example: prod-web-us-east-01
Monitoring
Keep agents healthy:
- Monitor connection status in dashboard
- Set up alerts for disconnections
- Review logs regularly
- Keep agents updated
Security
Protect your agents:
- Use unique API keys per cluster
- Rotate keys periodically
- Review audit logs
- Use minimal permissions
Troubleshooting Agents
Agent Not Connecting
- Check network connectivity to
socket.fixpanic.com:9000 - Verify credentials in configuration
- Check firewall rules
- Review agent logs
Agent Slow to Respond
- Check server resource utilization
- Verify network latency
- Review command complexity
- Check for competing processes
Agent Keeps Disconnecting
- Check network stability
- Verify firewall isn't terminating idle connections
- Review server logs for errors
- Check for resource exhaustion
Next Steps
- Clusters - Learn how to organize agents into clusters.
- Security - Understand the security model protecting agents.
- Managing Agents - Manage agents through the dashboard.