docs: document blank connector tokens and user_verify_url exchange failure - #819
docs: document blank connector tokens and user_verify_url exchange failure#819ekline[bot] wants to merge 3 commits into
Conversation
✅ Deploy Preview for scalekit-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ng page ekline[bot] <202747777+ekline[bot]@users.noreply.github.com>
|
|
||
| Scalekit does not return raw provider tokens in API responses by default. Exposing tokens in responses widens the surface for token theft, so token retrieval is disabled per account until you explicitly enable it. For most agents you never need the raw token: `execute_tool` / `executeTool` injects the current token for you, and Scalekit refreshes it automatically. Reach for raw tokens only when you call a provider API that AgentKit does not wrap. | ||
|
|
||
| If your integration must read the raw token, contact [support](mailto:support@scalekit.com) to enable token retrieval for your account. Include your account id and the connection name. Once enabled, the token fields populate on the connected account. |
There was a problem hiding this comment.
@AkshayParihar33 Please verify this content? My understanding is users' don't need to contact the scalekit support to enable token retrieval. Is that correct?
There was a problem hiding this comment.
@ekline i dont think we should even put it out that there is some flag which can be enabled and raw tokens can be shared. i feel its like announcing to attackers that we have an interface layer where tokens can be pulled in. can we make it something like this rather:
Scalekit does not return raw provider tokens in API responses by default. Exposing tokens in responses widens the surface for token theft, so token retrieval is not allowed to keep your connected accounts safe. Ideally your agents should never need the access to raw tokens: execute_tool / executeTool automatically injects the auth context during tool calling in a secure environment. If your agent's usecase must need access to raw token, contact support and can we remove this please?
cc: @AkshayParihar33
There was a problem hiding this comment.
Good call — agreed that documenting a per-account flag to pull raw tokens advertises an attackable interface. Reworded the scenario to your framing and pushed:
- Token retrieval is not allowed by default; raw tokens are not returned in API responses because that widens the surface for token theft.
- Agents should not need raw tokens —
execute_tool/executeToolinjects the auth context automatically during tool calling in a secure environment. - Genuine raw-token use cases just go to support, with no self-serve enablement steps, account id, or "once enabled the fields populate" mechanics documented.
- Removed the "Handle raw tokens as secrets" caution Aside.
Updated on e25d07c4. Preview: https://deploy-preview-819--scalekit-starlight.netlify.app/agentkit/authentication/troubleshooting/
There was a problem hiding this comment.
Done. The change is pushed to PR #819 and I replied to the reviewer inline.
What changed (PR #819)
The reviewer's concern was that documenting a per-account flag to pull raw tokens effectively advertises an attackable "tokens can be pulled here" interface. I reworked the "Connection returns an account id but tokens are blank" scenario to remove that:
Before — described a self-serve mechanism: "token retrieval is disabled per account until you explicitly enable it… contact support to enable token retrieval for your account. Include your account id and the connection name. Once enabled, the token fields populate." Plus a "Handle raw tokens as secrets" caution Aside.
After — adopts the reviewer's framing:
- Raw provider tokens are not returned by default, and token retrieval is not allowed, because exposing tokens widens the surface for token theft.
- Agents should not need raw tokens —
execute_tool/executeToolinjects the auth context automatically during tool calling in a secure environment. - Genuine cases just contact support, with no enablement steps, account-id instructions, or "once enabled the fields populate" mechanics.
- Removed the raw-tokens caution Aside, as requested.
Net diff: +3/−7 lines on agentkit/authentication/troubleshooting.mdx. The pre-commit style review ran clean and preserved the security framing (no Aside re-added).
- Commit:
e25d07c4ondocs/agentkit-connector-token-troubleshooting - Reply to reviewer: discussion_r3518571874
- Preview: https://deploy-preview-819--scalekit-starlight.netlify.app/agentkit/authentication/troubleshooting/
Repo is back on a clean main. One thing worth a heads-up for the team (not a docs change): the reviewer’s note implies the raw-token retrieval path should stay strictly a support-gated exception — if product ever exposes a self-serve toggle for it, the docs stance here (“not allowed”) would need revisiting.
Per reviewer: avoid describing a per-account flag that exposes raw provider tokens, which advertises an attackable interface. State that token retrieval is not returned by default, point agents to execute_tool/executeTool, and route genuine needs to support. Remove the raw-tokens caution Aside. ekline[bot] <202747777+ekline[bot]@users.noreply.github.com>

Problem
Developers integrating AgentKit outbound connectors hit three authorization failures that were under-documented in the troubleshooting guide:
failed_to_exchangewithuser_verify_url not configured for verification redirect. The troubleshooting page'sfailed_to_exchange_tokenscenario did not name user verification as a cause or link to the fix.ca_...) but empty access/refresh token fields. Not documented anywhere. Root cause: returning raw tokens in API responses is disabled by default for security and must be enabled per account by Scalekit.Audience
A developer integrating AgentKit outbound connectors (intermediate) whose agent connects to third-party tools (Airtable, ZoomInfo, Google Drive) on behalf of their own and their customers' end users. Goal: authorize outbound connectors for their own and external/customer accounts and actually receive tokens back.
Gravity
HIGH. 3 distinct customers, production, recurring. Category: mixed (docs gap + product).
Scrubbed customer quotes
Fix (this PR)
Edited the AgentKit connection troubleshooting page only:
failed_to_exchange_tokenscenario to name theuser_verify_url not configuredcause, state that user verification is a required security step enabled by default in production, and link to the user verification guide.execute_tool/executeToolinjects tokens automatically, and how to request token retrieval via support.Cross-account coverage already exists on the page, so it is left unchanged to keep the diff minimal.
Follow-ups / product (not docs-fixable)
client_idon Scalekit-provided connectors wrongly implies DCR is supported. Consider hiding/removing it or labeling it clearly. Customer quote: "can we please hide/remove the pre-filled Client ID?"Preview
https://deploy-preview-{PR_NUMBER}--scalekit-starlight.netlify.app/agentkit/authentication/troubleshooting/ekline[bot] <202747777+ekline[bot]@users.noreply.github.com>
📝 Created with EkLine · View session