Overview
The agent lifecycle represents the complete flow of an AI agent from initialization through execution, with Fabraix providing security and observability at each step.Lifecycle Diagram
The diagram below shows how Fabraix integrates into a typical agent workflow:Integration Points
Fabraix integrates at two critical points in your agent’s lifecycle:1. Event Submission (Asynchronous)
POST /event
Log key steps in the agent loop asynchronously. These don’t block your agent’s execution.
- User inputs - What the user asks
- Model inputs - What’s sent to the LLM
- Model outputs - LLM responses
- Tool calls - Function executions
- Memory operations - Read/write to agent memory
- Environment changes - External system updates
2. Action Checking (Synchronous)
POST /check
Validate critical actions before execution. This is a blocking call that prevents unsafe actions.
- Financial transactions - Money transfers, purchases
- Data modifications - Database updates, file deletions
- External communications - Emails, API calls
- Code execution - Running scripts or commands
- Permission changes - Access control modifications
Lifecycle Phases
1
Initialization
Register a new agent run to get a trace_id:
2
Input Processing
Log user input and prepare for LLM:
3
LLM Processing
The LLM processes input and may interact with tools/memory:
4
Action Execution
Execute approved actions and update environment:
5
Response & Loop
Return response to user and potentially continue:
Real-World Example
Here’s a complete example of an e-commerce agent handling a purchase request:Attack Prevention in Action
Here’s how Fabraix detects and prevents attacks during the lifecycle:Prompt Injection Attack
Memory Poisoning Attack
Performance Considerations
Asynchronous Event Logging
Events can be logged asynchronously to minimize latency:Batch Event Submission
For high-volume applications, batch events:Critical Path Optimization
Only check actions on the critical path:Debugging Tips
Trace ID Management
Trace ID Management
Store trace IDs for debugging:
Event Correlation
Event Correlation
Add correlation IDs to related events:
Testing Attack Scenarios
Testing Attack Scenarios
Test your integration against common attacks:

