AIToolAuthorization

data class AIToolAuthorization(val kind: AIToolAuthorization.Kind = Kind.OAuth, val provider: String, val providerName: String? = null, val title: String, val message: String? = null, val url: String, val handoffToken: String? = null, val expiresAt: Date? = null, val status: AIToolAuthorization.Status? = null)

A sign-in a tool call waits for, such as "Connect Linear", and how it ended.

The agent's backend writes it on the call's ai_tool_call step, which waits with status awaiting_authorization, and holds the call until the person signs in at the provider in a browser. Once they connect, the call goes on. When the sign-in is declined, expires or fails, the call is cancelled and never runs. The step holds no credential, since url is the agent's own sign-in page and the provider hands what it grants to the agent's backend, never to the app.

Parameters

kind

How the person signs in. Defaults to Kind.OAuth when the agent sends none.

provider

The provider, such as linear.

providerName

What people call the provider, such as "Linear".

title

The question, such as "Connect Linear".

message

What signing in means for the person.

url

The sign-in page to open: an https URL, or an http one on this device itself (localhost or a loopback address), as a router run locally serves. Open launchUrl, which carries the handoffToken.

handoffToken

What binds the sign-in to the first browser that opens it. It goes in the page's fragment, which no server sees. Gone once the sign-in is over.

expiresAt

When the sign-in expires.

status

How it ended, once it did.

Constructors

Link copied to clipboard
constructor(kind: AIToolAuthorization.Kind = Kind.OAuth, provider: String, providerName: String? = null, title: String, message: String? = null, url: String, handoffToken: String? = null, expiresAt: Date? = null, status: AIToolAuthorization.Status? = null)

Types

Link copied to clipboard
value class Kind(val rawValue: String)

How the person signs in. An open set: compare against the kinds you know.

Link copied to clipboard
value class Status(val rawValue: String)

How a sign-in ended. An open set: compare against the statuses you know.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The page to open in a browser, which is url with the handoffToken in its fragment.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: String

Functions

Link copied to clipboard
open override fun toString(): String

The sign-in with its handoffToken masked, so logging it, or a part that carries it, doesn't leak a live token.