Console Agent Pipeline
The console routes agent interactions through/api/ai/agent-chat, streaming responses via Server-Sent Events (SSE).
Pipeline Steps
- Validate the user session with
requireAuth(). - Verify chat ownership for the org.
- Resolve sandbox auth context and credentials.
- Load chat context and recent messages.
- Run the agent in the sandbox runtime.
- Stream events and results over SSE.
Guardrails
- Sensitive tools trigger confirmation events
- Tool calls are validated against policy and guardrails
- Confirmation tokens are required for write actions