Skip to content

Add the session kind option to create_session - #86

Merged
vvillait88 merged 1 commit into
mainfrom
session-kind
Sep 9, 2026
Merged

Add the session kind option to create_session#86
vvillait88 merged 1 commit into
mainfrom
session-kind

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

create_session and acreate_session gain an optional kind ("kyc" | "sign_in"). The API already accepts it on POST /v1/sessions: kyc (its default) runs identity verification, sign_in is registration-only (the buyer signs in with an AgentScore account, no identity documents) and mints a sign_in-scoped credential. Merchants that key durable state on the buyer's account without any compliance policy, such as a prepaid metered store, could not mint that kind through the SDK, so their identity bootstrap either did not exist or forced a KYC flow the merchant does not need. SessionCreateResponse also gains the optional kind the API echoes back. When kind is None the body omits it, so the API default is unchanged for every existing caller. Parity with the node SDK change of the same day.

Type of change

  • Bug fix (no breaking change)
  • New feature (no breaking change)
  • Breaking change (existing callers must update)
  • Docs, tests, or internal maintenance only

Public API

create_session(..., kind: Literal["kyc", "sign_in"] | None = None) and the same on acreate_session (new, optional, keyword). SessionCreateResponse.kind (new, optional). No migration.

Test plan

tests/test_client.py: the first-class-fields test now passes kind="sign_in" and asserts it lands in the body; the omit-none test asserts kind is absent when not passed. Locally: uv run ruff check, uv run ruff format --check, uv run ty check agentscore/, uv run pytest (183 passed, 8 skipped, 99.85% coverage against the 95% floor).

Checklist

  • Tests cover the new behavior, and the suite passes locally
  • Lint, format, and type checks pass
  • Docs and README examples updated if the public surface changed
  • No secrets, credentials, or personal data in the diff or the tests

Worked with Varun. Version bumped to 2.6.9; the tag follows the merge.

🤖 Generated with Claude Code

The API accepts kind on POST /v1/sessions: kyc runs identity verification,
sign_in is registration-only and mints a sign_in-scoped credential. Merchants
that key durable state on the account with no compliance policy need the
second kind and could not request it through the SDK. Omitted when None, so
existing callers keep the API default. Parity with the node SDK.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 9a3114b into main Sep 9, 2026
7 checks passed
@vvillait88
vvillait88 deleted the session-kind branch September 9, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant