Skip to content

feat(agents): agents read and edit their customer's identity and start verification - #1186

Merged
kphurley7 merged 1 commit into
mainfrom
kph/muse-spec-h-agent-identity
Oct 16, 2026
Merged

kphurley7 merged 1 commit into
mainfrom
kph/muse-spec-h-agent-identity

Conversation

@kphurley7

Copy link
Copy Markdown
Contributor

Agents read and edit their customer's identity and start verification.

  • New GET/PATCH /agents/me/customer, POST /agents/me/verifications and POST /agents/me/kyc-link, using the existing IndividualCustomer, Verification and KYC-link schemas.
  • New agent permission MANAGE_IDENTITY.
  • Stainless maps the three operations under agents.me.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
grid-cards-demo Ignored Ignored Preview Oct 16, 2026 4:45pm UTC
grid-flow-builder Ignored Ignored Preview Oct 16, 2026 4:45pm UTC
grid-wallet-demo Ignored Ignored Preview Oct 16, 2026 4:45pm UTC

Request Review

content:
application/json:
schema:
$ref: ../../components/schemas/customers/IndividualCustomerUpdateRequest.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reuses IndividualCustomerUpdateRequest, so email/phoneNumber/kycStatus/currencies all look settable and then 400. an AgentCustomerUpdateRequest like AgentQuoteRequest in 1183 would be cleaner. also the backend ignores unknown keys instead of 400ing (quotes reject them)

content:
application/json:
schema:
$ref: ../../components/schemas/customers/KycLinkCreateRequest.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backend only accepts redirectUri if it exactly matches one global return URL (connect.lightspark.com in prod, nothing elsewhere), which makes sense for the leaked-token case. but the spec reuses KycLinkCreateRequest, which says any https uri works. maybe drop the body here? and since it's one global URL, another platform's customers would land on connect. probably wants to be a platform setting before anyone else uses this

@ls-bolt

ls-bolt Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦣 Congratulations @k15z - your substantive review earned a Giant short-faced kangaroo! (rare)

Forward-facing eyes and a single large toe distinguished Australia's largest known kangaroo.

View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/k15z?section=ice-age

@kphurley7
kphurley7 force-pushed the kph/muse-spec-h-agent-identity branch from 3eb56eb to d028cfa Compare October 14, 2026 18:13
@kphurley7
kphurley7 force-pushed the kph/muse-spec-h-agent-identity branch from d028cfa to 2e74999 Compare October 15, 2026 04:32
@kphurley7
kphurley7 added this pull request to stack #1188 October 15, 2026 18:49
@kphurley7
kphurley7 force-pushed the kph/muse-spec-h-agent-identity branch 2 times, most recently from 2cffddb to ba3ae44 Compare October 16, 2026 15:19
@kphurley7
kphurley7 marked this pull request as ready for review October 16, 2026 15:20
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[High impact] The PR gives authorized agents new access to customer identity and KYC workflows.

Fix the identity update request schema before merging; the hosted KYC description also needs a small clarification.

Findings

  1. P1 Update fields contradict endpoint rules ▶
  2. P2 KYC prerequisite is unexplained ▶
Fix with agent prompt
### Issue 1
openapi/paths/agents/agents_me_customer.yaml:59
`PATCH /agents/me/customer` uses `IndividualCustomerUpdateRequest`, which requires `customerType` and offers fields such as `email`, `phoneNumber`, and `currencies`. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.

### Issue 2
openapi/paths/agents/agents_me_kyc-link.yaml:46
The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be `VERIFIED` first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds four agent operations for reading and updating customer identity, submitting verification, and generating a hosted KYC link.

  • Agents can read and edit their customer's identity.
  • Agents can submit their customer for KYC verification.
  • Agents can create a hosted KYC link for their customer.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Agent with MANAGE_IDENTITY] --> B[Read customer]
  B --> C[Update identity fields]
  C --> D[Submit verification]
  D --> E{Missing fields?}
  E -->|Yes| C
  E -->|No| F[Follow verification status]
  A --> G[Generate hosted KYC link]
  G --> H[Customer completes hosted flow]
Loading

Reviews (1) · Last reviewed commit: "feat(agents): agents read and edit their..." · Reviewed by Greptile

content:
application/json:
schema:
$ref: ../../components/schemas/customers/IndividualCustomerUpdateRequest.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Update fields contradict endpoint rules

PATCH /agents/me/customer uses IndividualCustomerUpdateRequest, which requires customerType and offers fields such as email, phoneNumber, and currencies. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/agents/agents_me_customer.yaml
Line: 59

Comment:
**Update fields contradict endpoint rules**

`PATCH /agents/me/customer` uses `IndividualCustomerUpdateRequest`, which requires `customerType` and offers fields such as `email`, `phoneNumber`, and `currencies`. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The operation now takes a new AgentCustomerUpdateRequest with only the identity fields an agent may change (fullName, birthDate, nationality, address, idType, identifier, countryOfIssuance and the EDD fields), and no customerType. Anything else, including email, phoneNumber and currencies, is still documented as a 400.

schema:
$ref: ../../components/schemas/errors/Error403.yaml
'409':
description: Customer is not ready to begin hosted KYC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 KYC prerequisite is unexplained

The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be VERIFIED first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.

Knowledge Base Used: Customers and accounts API

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/agents/agents_me_kyc-link.yaml
Line: 46

Comment:
**KYC prerequisite is unexplained**

The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be `VERIFIED` first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.

**Knowledge Base Used:** [Customers and accounts API](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/customers-and-accounts-api.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. The 409 now matches the customer KYC-link endpoint: when the provider requires contact verification, the customer's email and phone must both be VERIFIED, and the platform must finish verify-email and verify-phone before the agent retries.

@kphurley7
kphurley7 force-pushed the kph/muse-spec-h-agent-identity branch from ba3ae44 to 215ec56 Compare October 16, 2026 15:42
Base automatically changed from kph/muse-spec-g-agent-approvals to main October 16, 2026 15:47
@mintlify

mintlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Grid 🟢 Ready View Preview Oct 16, 2026, 4:45 PM

…t verification

GET/PATCH /agents/me/customer, POST /agents/me/verifications and
POST /agents/me/kyc-link let an agent with the new MANAGE_IDENTITY
permission read and correct its own individual customer's identity, submit
it for verification and mint a hosted KYC link, so a consumer agent can
finish KYC for its user. The PATCH takes AgentCustomerUpdateRequest, which
holds only the identity fields an agent may change, and the KYC link's 409
states the contact-verification prerequisite. Stainless maps the three
operations under agents.me.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwZPrRKwG5naDdwrPjXyQJ
@kphurley7
kphurley7 force-pushed the kph/muse-spec-h-agent-identity branch from 09230c3 to a26acea Compare October 16, 2026 16:45
@github-actions github-actions Bot removed the breaking-change Introduces a breaking change to the OpenAPI spec label Oct 16, 2026
@kphurley7
kphurley7 merged commit ae41408 into main Oct 16, 2026
10 checks passed
@kphurley7
kphurley7 deleted the kph/muse-spec-h-agent-identity branch October 16, 2026 16:47

This branch was successfully deployed

1 active deployment
staging - mintlify — a26acea9 Deployed Oct 16, 2026 by mintlify[bot]
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.

2 participants