relay events emitted during a chat session.
Path Parameters
The relay ID from the
relay event’s id field.Request Body
The session ID from the initial
connected event.The permission decision.
Example Request (Approve)
Example Request (Approve Always)
Example Request (Deny)
Response
Always
true when the relay is successfully resolved.Example Response
Error Responses
400 Bad Request
Returned when required fields are missing:404 Not Found
Returned when the session or relay ID is not found:- The session ID is invalid or expired
- The chat stream has already closed
- The relay ID is invalid
- The relay was already resolved
- The relay expired
Workflow
- Client initiates a chat via
POST /chat - Client receives a
connectedevent withsessionId - During execution, agent may emit a
relayevent with permission request - Client extracts
id(relay ID),tool, andparamsfrom the relay event - Client presents permission request to user or policy engine
- Client sends approval/denial to
POST /chat/relay/:relayId - Agent continues execution based on the response
Example Relay Event
Notes
- Relay events are emitted when a tool execution requires permission
- This occurs when the tool doesn’t match any rule in the
permissions.allowlist - Sessions are maintained only while the SSE connection is active
- Once a relay is resolved, the agent continues processing
- If approved with
always: true, future calls to that tool with matching parameters will be automatically approved - Relay responses must be sent before the session times out or the connection closes
