Overview
This endpoint registers the start of a new agent interaction or “run”. It creates a new session with a uniquetrace_id that will be used to correlate all subsequent events for this specific agent session.
Always call this endpoint at the beginning of each new agent conversation or task to establish a tracking context.
Request
The unique identifier for your agent. This should be consistent across all runs of the same agent.Example:
"a1b2c3d4-e5f6-7890-1234-567890abcdef"The timestamp when the agent run is starting, in ISO 8601 format.Format:
YYYY-MM-DDTHH:mm:ss.sssZExample: "2024-01-15T14:30:45.123Z"The system prompt or initial instructions given to the agent for this session. This helps establish the agent’s intended behavior for security analysis.Example:
"You are a helpful customer service assistant. You should be polite and professional. Never share customer personal information."Response
The unique identifier for this agent session. Use this ID for all subsequent event logging and action checking within this session.Example:
"f4f4f4f4-f4f4-f4f4-f4f4-f4f4f4f4f4f4"The server timestamp when the session was registered, in ISO 8601 format.Example:
"2024-01-15T14:30:45.456Z"Examples
Response Examples
Success Response
Error Responses
Best Practices
Consistent Agent IDs
Consistent Agent IDs
Use the same
agent_id for all runs of the same agent type. This helps with:- Analytics and monitoring
- Identifying patterns across sessions
- Debugging and troubleshooting
Descriptive System Prompts
Descriptive System Prompts
Include clear constraints and objectives in your system prompt:
Session Management
Session Management
Store the
trace_id properly for the entire session:Error Handling
Error Handling
Implement proper retry logic for transient failures:
Use Cases
Multi-Turn Conversation
Task-Based Agent
Autonomous Agent
Related Endpoints
- POST /event - Log events after registering a run
- POST /check - Validate actions using the trace_id
FAQ
When should I create a new trace_id?
When should I create a new trace_id?
Create a new trace_id for:
- Each new conversation with a user
- Each distinct task or job
- When the agent’s context is reset
- After a significant time gap (e.g., new day)
Can I reuse a trace_id?
Can I reuse a trace_id?
No, trace_ids should be unique for each session. Reusing them will mix events from different sessions and compromise security analysis.
What happens if I don't register a run?
What happens if I don't register a run?
Events and checks submitted without a valid trace_id will be rejected with a 404 error. Always register a run first.
How long are trace_ids valid?
How long are trace_ids valid?
Trace_ids remain valid indefinitely for historical analysis, but should not be reused for new sessions after the original session ends.

