Skip to content

Let createSessionOnMissing mint a sign_in session - #127

Merged
vvillait88 merged 2 commits into
mainfrom
session-kind
Sep 9, 2026
Merged

Let createSessionOnMissing mint a sign_in session#127
vvillait88 merged 2 commits into
mainfrom
session-kind

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

createSessionOnMissing gains an optional kind ('kyc' | 'sign_in') that rides through to POST /v1/sessions. A gate running an empty compliance policy that only needs an account to key durable state on (a prepaid balance, say) could previously auto-mint only the KYC kind, which asks the buyer for identity documents nothing in that merchant ever checks; sign_in is registration-only and still yields an operator token. When the kind is sign_in the minted denial's default error.message describes an account sign-in instead of the KYC copy, so a merchant using the default 403 body does not tell the agent something false. When kind is not set nothing changes: the body omits it and the API default applies. Takes @agent-score/sdk 2.7.10, which carries the option.

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

CreateSessionOnMissing.kind?: 'kyc' | 'sign_in' (new, optional). No migration for existing callers.

Test plan

tests/express.test.ts: a new case asserts the POST body carries kind: 'sign_in' and that the 403's error.message talks about signing in with an AgentScore account and not about KYC; the existing first-class-fields case is unchanged and still asserts the body has no extra keys when kind is unset. Locally: bun run lint, bun run typecheck (including examples), bun run test (119 files, 1825 passed, 4 skipped).

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.12.0; the tag follows the merge. The first consumer is the ScaleDown store, whose bare-call 401 will carry a sign-in session through this option.

🤖 Generated with Claude Code

vvillait88 and others added 2 commits September 8, 2026 19:20
A kind option on createSessionOnMissing rides through to POST /v1/sessions.
A gate running an empty compliance policy that only needs an account to key
state on could previously mint only the KYC kind, which asks the buyer for
documents nothing checks. For sign_in the denial's default message says what
the session actually asks for instead of the KYC copy. Needs @agent-score/sdk
2.7.10.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 2aa177d into main Sep 9, 2026
6 checks passed
@vvillait88
vvillait88 deleted the session-kind branch September 9, 2026 00:13
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