> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Console Agent Pipeline

> How agent requests are processed and streamed via SSE.

# Console Agent Pipeline

The console routes agent interactions through `/api/ai/agent-chat`, streaming responses via Server-Sent Events (SSE).

## Pipeline Steps

1. Validate the user session with `requireAuth()`.
2. Verify chat ownership for the org.
3. Resolve sandbox auth context and credentials.
4. Load chat context and recent messages.
5. Run the agent in the sandbox runtime.
6. 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

## Related Documentation

* [Console Architecture](/stateset-console/architecture)
* [Autonomous CX Test Case](/stateset-console/autonomous-cx-test-case)
