One complete integration

This example keeps one user’s AgentState in a store, exposes one narrow tool, emits progress, and commits only on success.

Why each choice exists

  • One server-owned model. Credentials and tool authority never touch browser state.
  • Explicit tools. Omitting tools would enable the default workspace tools; this product needs only service lookup.
  • Product vocabulary. decision matters here, so it is configured instead of allowing arbitrary semantic types.
  • Completion evidence off. The built-in policy targets coding work. Operational answers use product policy and tool evidence.
  • Compare-and-set. Two replicas cannot silently overwrite one session version.
  • Diagnostic failure path. Failed work is inspectable but not canonical.

Coding-agent variant

For workspace work, opt into scoped defaults and completion evidence:
Put sandboxPath inside a real filesystem and process sandbox when inputs are untrusted.

Test the causal contract

Use MockModel for deterministic tests and one real provider smoke test for action formatting and usage metadata. Next: Agent API.