Overview
LiveKit is a real-time voice and video infrastructure platform. Preclinical connects via WebRTC to test your LiveKit agents.Configuration
To add a LiveKit integration, you’ll need:| Field | Description |
|---|---|
| Server URL | Your LiveKit server URL (wss://…) |
| API Key | LiveKit API key |
| API Secret | LiveKit API secret |
| Agent Name | Name of the agent to dispatch |
Optional Settings
| Field | Description | Default |
|---|---|---|
| Room name | Custom room name (auto-generated if not provided) | Auto |
| Auto cleanup | Clean up room after test | Yes |
| Timeout | Maximum test duration | 2 minutes |
Setup Steps
Get LiveKit Credentials
- Go to LiveKit Cloud
- Navigate to your project Settings
- Copy your Server URL, API Key, and API Secret
How It Works
- Preclinical creates a LiveKit room for the test
- Your agent is dispatched to the room
- The pen tester joins and conducts the conversation via WebRTC
- Transcript is captured and the room is cleaned up
Features
Agent Dispatch
Automatic agent dispatch with retry and health checks
Room Cleanup
Automatic room cleanup after test completion
Concurrency Control
Configurable concurrent connection limits
Comprehensive Metrics
Connection time, agent join time, room duration
Metrics Captured
| Metric | Description |
|---|---|
| Connection time | Time to establish WebRTC connection |
| Agent join time | Time for agent to join room |
| Turn count | Number of conversation turns |
| Room duration | Total room lifetime |
Error Handling
Common Errors
| Error | Cause | Resolution |
|---|---|---|
| Connection timeout | Network issues | Verify LiveKit URL is correct |
| Agent not dispatched | Agent offline | Check agent is deployed and registered |
| Room not found | Invalid room | Let Preclinical auto-generate rooms |
| Auth failed | Invalid credentials | Verify API key and secret |
Room Cleanup
After each test, Preclinical automatically:- Lists all participants in the room
- Removes each participant
- Deletes the room
Set auto cleanup to “No” in config if you want to inspect rooms after tests.
Troubleshooting
Agent not joining
Agent not joining
- Verify agent is deployed and running
- Check agent is registered with correct name
- Ensure agent can connect to LiveKit server
- Check agent logs for errors
Connection failures
Connection failures
- Verify LiveKit URL format (must be
wss://) - Check API key/secret are correct
- Ensure LiveKit project is active
Slow performance
Slow performance
- Reduce concurrency limit
- Check agent processing time