Apps / S2

Agents can now sign in to s2.dev with AgentID

S2 is an API for durable streams. With Sign in with AgentID, agents can create and return to an S2 account using their AgentMail identity.

An agent might need to collect events from a background job, send updates to another agent, or build a dashboard that shows users what is happening. Those tasks need somewhere to store updates and make them available to readers. S2 provides that through an API for durable streams.

With Sign in with AgentID, agents can now create and return to an S2 account using their AgentMail identity. This makes it easier to get started, whether the agent is using S2 for its own work or building an application for someone else.

In short

  • S2 is a serverless API for durable streams: append records, read their history, and follow new records as they arrive.
  • Use streams for live progress, agent-to-agent communication, event collection, or the recorded history behind application state.
  • An agent can use S2 for its own tasks or as infrastructure for an application it is building.
  • AgentID makes account setup and return visits easier by letting the agent sign in with its AgentMail identity.
  • Stream operations use S2 access tokens, with permissions scoped to the resources and operations the application needs.

What is S2?

S2 stores data in durable, ordered streams. Append records as events happen, read from a retained position or timestamp, and keep reading as new records arrive. You can create a stream per session, job, device, or document. The hosted service manages the storage and serving infrastructure.

The stream can be where the data stays. Choose a retention period, including indefinite retention, and use the same read API to inspect old events and follow current activity. A browser, worker, or another agent can read independently using a scoped access token.

What could an agent use S2 for?

These patterns apply both to an agent carrying out a task and to an agent writing software for other people:

  • Show task progress. Append updates from a long-running job and let a dashboard follow them live. A reader that disconnects can catch up from its last position.
  • Communicate with another agent or worker. Use a stream as a durable channel. An acknowledged message remains available while retained, even if its recipient is offline; the recipient reads it when it runs. Every stream has its own URI (at s2://{basin}/{stream}), and can be accessed directly over HTTP.
  • Collect and keep events. Append observations, logs, or completed conversation turns as they arrive. Read the retained history later for investigation or processing, then follow new events through the same API.
  • Reconstruct session state. Record messages, tool results, and state changes. Application code can rebuild context from the log, optionally starting from a snapshot, when a new execution takes over.

How AgentID makes setup easier

AgentID is AgentMail's sign-in service for AI agents. It uses OpenID Connect, the same standard behind Sign in with Google, to supply a verified email address and a stable identifier associated with the agent's inbox. An agent can use that identity to create an S2 account and sign back in later.

Once signed in, the agent can obtain S2 access tokens and configure the streams its application needs. AgentID handles sign-in; the S2 API handles storing and reading data. The application still chooses how to organize its accounts, streams, and credentials.

The identity includes a working inbox, so the agent can receive and read account emails sent to that address.

Who controls what

StageAgentIDS2
Identity at sign-inSupplies verified agent email and stable identifier through OpenID ConnectAccepts the sign-in, creates the account
Streams and appendsNot involvedOwns the API, ordering, and durability
Access tokens for stream operationsNot involvedIssues tokens with caller-selected scopes
Quotas, retention, and cleanupNot involvedEnforces limits; applications configure retention and cleanup
Pricing and billingNot involvedControls both
Account emailProvides the inbox behind the identityDecides which messages it sends

Get started

  1. Open Sign in with AgentID on S2 and complete sign-in using your agent's AgentMail identity.
  2. Create an S2 access token in the dashboard and store it in the application's secret store.
  3. Follow the S2 quickstart to create a basin and stream, then append a record using the CLI or an SDK.
  4. Read the stream from another process. Read the existing records, then keep the read open to follow new updates.

For a small example, give a background task a stream such as jobs/report-123. Append status updates while it runs. A separate reader can display those updates, reconnect from its last position, and inspect the history after the task finishes.

The AgentID guide explains how to prepare an inbox identity and sign in from an assistant.

FAQ

Questions, answered.

Examples include conversation turns, tool results, task progress, collected events, and application state changes. A stream holds an ordered sequence of records; your application chooses what each record contains, how long to retain it, and how to use it.

S2 supplies the durable, ordered history. Your application decides what to record and implements the logic to reconstruct context or state, take snapshots, and continue work. Recording a log does not by itself replay external side effects or resume a process.

Sign-in opens the S2 account. Create the first API token in the S2 dashboard, then use that token for API operations. Tokens can be scoped to particular streams and operations, with optional expiry. Managing AgentID sign-in credentials and revoking S2 API tokens are separate actions. See access tokens.

Yes. Multiple agents can use separate streams and scoped access tokens within one S2 account. You can also use separate accounts where that suits your setup. A stream per session does not require an account per agent.

AgentID supplies a verified email address and a stable identifier through OpenID Connect. The inbox gives the service an address for account communications. S2 manages the account's resources, API permissions, usage limits, and billing.

Prompt

Give yourself access to AgentMail
by following the guide at:

https://docs.agentmail.to/agent-onboarding

and refer to:

https://docs.agentmail.to/llms.txt

for the documentation index.

Give your agent an identity of its own.

Create an AgentMail inbox and let your agent start signing in as a real user.