Skip to content

Improvement: let admins see and end every API key that works in their organization, members' personal keys included #5045

Closed

Description

@yannickmonney

Summary

A pilot's admins report that Settings › API › REST does not show all the API keys made in their organization, and ask whether that is intended. It is, per APIKEY-R8: an Owner or Admin sees their own keys and the keys bound to the organization. A member's personal key, which "works in every organization you belong to", is listed only for its holder, and only the holder can end it. An organization that governs who may use its API is therefore left with keys acting in it that its admins can neither see nor stop, short of removing or disabling the member.

What main does

Observed at main a71d0d92e9.

  • Settings › API › REST is backed by listApiKeysForViewer (services/platform/backend/domains/api_keys/service.ts:561), which returns the admin's own keys plus the keys bound to the organization (APIKEY-R8, backend/domains/api_keys/spec.md:111-116).
  • Personal keys are made at Better Auth's /api/auth/api-key/create and ended by their holder at /api/auth/api-key/delete (backend/domains/api_keys/routes.ts:30-33).
  • The data already exists. The budget editor's admin-only GET /api/app/governance/api-keys lists every enabled key of the organization's members, masked, with the owner's name and email (backend/domains/governance/api-keys.ts:44-84, backend/domains/governance/routes.ts:271-279). It is used only as a picker for budget rules.

Proposed

  • A complete list. In Settings › API › REST, Owners and Admins get an "All keys in this organization" view that adds members' personal keys. Each row shows the masked key, name, holder (name and email), created, last used, expiry, and the fact that it is a personal key.
  • End here. An admin can stop a member's personal key in this organization without ending it in the holder's other organizations. This is a per-organization block, checked when the key authenticates. It is recorded in the audit log, the holder is notified, and the holder's own list shows the key as ended there.
  • Optional setting. "Members' personal keys work here" (on by default), so an organization can require keys it issues itself (keys made for a member, APIKEY-R2).
  • Update the spec (APIKEY-R8) and the docs (docs/*/platform/admin/api-keys.md).

Done when

  • An admin sees every key that can act in the organization, members' personal keys included, with holder and last use.
  • Ending a personal key in one organization refuses its next call there and leaves it working elsewhere. The audit log records it and the holder is notified.
  • Tests cover list visibility per role and the per-organization block.

Scope for parallel work

This touches the api_keys domain (listing and a block table), the key authentication path, and the Settings › API › REST UI. The decision in #5046 (whether a role in another organization may admit a key here) touches the same authentication path. Whichever lands second rebases on the first.

Activity

  1. added
    priority: medium
    improvement
    service: platform
    on Oct 23, 2026
  2. added
    agent-ready
    on Oct 29, 2026
  3. tale-review-bot commented on Oct 31, 2026

    @tale-review-bot
    Collaborator

    Decision: Owners and Admins see the members' personal API keys that work in their organization, may block one there and only there, and may refuse personal keys altogether. The issue is split into three changes; the list is the change on this task. TALE-224 (tale#5045).

    Question. Should Owners and Admins see members' personal API keys, and be able to block one in their organization? Either changes APIKEY-R8. (Triage's Needs a person: of 2026-10-29.)

    What I looked at. tale-project/tale main df6105cef08a78084439c029d5917611c4adcf54.

    • APIKEY-R8. "Everyone sees their own keys. An Owner or Admin also sees every key bound to the organization" (services/platform/backend/domains/api_keys/spec.md:111-116). A member's personal key works in every organization the holder belongs to. Short of removing or disabling the member, the admins of one of those organizations can neither see the key in Settings › API › REST nor stop it.
    • Admins already see those keys. The admin-only budget picker listOrgApiKeys (backend/domains/governance/api-keys.ts:44-84) returns every enabled, unexpired personal key of the organization's members: its name, its masked start, the holder's name and email, created and expiry. The list adds no new fact about a member.
    • Decision: should a role in one organization let a member create an API key that works in another? #5046 (open, needs discussion, security, not agent-ready) asks whether a role in one organization may let a member make a key that works in another. It touches the same authentication path.

    Options weighed.

    1. Keep APIKEY-R8. An organization keeps having keys act on its data that its admins cannot stop.
    2. Let admins end (delete) a member's personal key. That reaches into the holder's other organizations, which is wider than the organization's own data.
    3. See it, block it here only, and refuse personal keys by a setting. Each step narrows what a key may do in this organization and nothing else, and each is audited. This is the narrowest power that reaches the outcome.

    Decided: option 3, in three changes, each p2 (the issue's priority: medium), all Line: feature.

    1. This task: the list. In Settings › API › REST, Owners and Admins get "All keys in this organization". It adds the members' personal keys that work here to the keys they see today.
      • Each row: the masked key, its name, the holder (name and email), created, expiry, and a personal-key mark.
      • Last used: for a personal key, the row shows only its use in this organization. Where nothing records use per organization, it shows none: the key's global last use would tell the admins about the holder's work in other organizations.
      • Read-only: the list ends nothing.
      • Not listed: members see no one else's personal keys, and a former member's keys are not listed.
      • The spec and docs: APIKEY-R8 and docs/*/platform/admin/api-keys.md (en, de, fr) are updated.
      • Done: tests of list visibility per role. An Owner or Admin sees a member's personal key with its holder. A Member does not. A key of someone who is no longer a member, a disabled key and an expired key are not listed.
      • The Coder's choices: reusing or sharing the governance query, and the exact UI.
    2. Filed #5217: block a member's personal key in this organization only. It is checked when the key authenticates here, with an error code of its own. An Admin cannot block an Owner's key. The block and its lift are audited, the holder is notified, and their list shows the block. The key keeps working elsewhere.
    3. Filed #5218: "Members' personal keys work here", on by default. With it off, personal keys are refused here, and organization-bound keys and keys made for a member keep working. Each change is audited. It is on by default because turning it off breaks the members' integrations, and admins may reasonably want either.

    None of the three waits for #5046: whichever lands second rebases on the first, as the issue says.

    Squash message of this task ends with Closes #5045 (the first part of a split; the other parts are #5217 and #5218).

    What would change this decision. If #5046 is decided so that a personal key no longer works across organizations, #5217 and #5218 may be superseded. The next Lead run would then cancel them with that reason. A person's answer on the task or the issue wins over this decision.

    How this task lands now: branch from origin/<the train of its line>
    (train or feature-train) and record that commit as the base; open no pull
    request, and close one the task still has. Hand over on this task (train,
    branch, full head, base, the gate you ran, and the squash message ending with
    Closes #<n> or Refs #<n>), then move it to In review. The Lead's decision
    above settles what the task asked a person; a technical choice is yours to make
    and record in the plan (Development's "Who decides"). This replaces whatever an
    older copy of the instructions earlier in this task's conversation says.

  4. added
    feat
    and removed
    improvement
    on Oct 31, 2026
  5. tale-review-bot commented on Oct 31, 2026

    @tale-review-bot
    Collaborator

    Kind corrected (Lead, TALE-224, run of 2026-10-31 18:00 UTC): #5045 now carries feat instead of improvement.

    • Why. The change this issue asks for adds a capability Tale does not have: Owners and Admins see the members' personal API keys that work in their organization. That is feat ("add a capability Tale does not have"), not improvement ("improve what works"). Its two further parts, feat(platform): let admins block a member's personal API key in their organization only #5217 and feat(platform): let an organization refuse members' personal API keys #5218, already carry feat.
    • How it was missed. The Lead's decision on TALE-224 (the 2026-10-31 15:00 UTC run) split the issue and set the priority, but left the issue's kind as it was. Triage noticed this in its 17:20 UTC sweep.
    • What stays. The decision itself, p2 (the issue's priority: medium) and Line: feature. The squashed commit's type is feat. The issue's title still starts with "Improvement:", because editing titles is not among the Lead's GitHub writes.
  6. tale-review-bot commented on Nov 1, 2026

    @tale-review-bot
    Collaborator

    Decision: TALE-224 (#5045) goes back to To do. The Coder hands over the same change again from a run that settles, rebased onto today's feature-train. The Reviewer then reviews only what the rebase changed, and lands it.

    The question. The Reviewer asked this in comments 677d3676 and 260702b0. The review of TALE-224 cannot be decided because Tale captured no source for it. Should the task go back to To do for a fresh handover?

    What I checked (Lead, Decide run 3b9b3e7a, 2026-11-01 10:10Z):

    • The pending review cannot be decided.
      • It is approval 95bdf214-ab93-4e33-b580-4e6e274574cb, on run f564ce3c-b7ab-4aef-93cb-907701c91aaf.
      • Its evidenceRevision is null and its agentReviewBlockedReason is source_required.
      • The Coder's run f564ce3c handed over at 08:18:40Z and ended with harness_error at 08:18:45Z.
      • A verdict on it is refused, and nothing on the board will capture a source while the task stays In review.
    • The review found nothing to change.
      • Reviewer run 6b207c0e reviewed head 517939b289795b67ead26a110fe1e15f6f97730a on base 3fbbdced14f8660da08d13e9c3b105731c16e9ba.
      • The targeted tests passed: 38/38 server and 138/138 client.
      • The gate passed 24 of 26 tasks. The other two, @tale/web#build and @tale/cli#build, failed on the network only.
    • feature-train has moved, and the head no longer rebases cleanly.
      • feature-train is now 3cef7650e131b271cd02800963f71bbc6571ea20, which holds TALE-305: "let an organization refuse members' personal API keys" (feat(platform): let an organization refuse members' personal API keys #5218).
      • TALE-305 and the branch at 517939b2 change ten of the same files: rest.tsx, api_keys/spec.md, the en, de and fr admin docs and settings.yml, and the manual suite and its reference.

    Options weighed:

    1. To do, with a fresh handover. It costs the Coder one run: a rebase and its conflicts, and the gate again. It gives the review a captured source.
    2. Leave it In review. It costs nothing now, but nothing would ever unblock it.
    3. Land without a verdict. That would leave a landed task stuck In review, as the Reviewer said. Refused.

    Decided: option 1. A review is only as good as the source Tale captured for it. Here the only defect is that the source is missing, and only a new handover can supply it.

    What done means:

    1. Branch from origin/feature-train and record that commit as the base.
    2. Keep the change the review accepted. Resolve the overlap with TALE-305 so that both hold.
      • The all view follows the door, which is the rule this change already states: a member's personal key is listed while it can act here.
      • With TALE-305's personal_keys policy off, the door refuses every member's personal key. The all view must then not show any of them as working here.
      • While that policy cannot be read, the all view says so instead of guessing.
      • How the view shows this is the Coder's choice: no personal rows with a line naming the setting, or rows marked refused. Name the choice in the handover.
    3. Give the server and client tests a case for personal_keys off.
    4. Keep APIKEY-R8 pointing to APIKEY-R12. Keep the en, de and fr docs and the manual box in step with both changes.
    5. Hand over again with the full head, the base, the gate you ran and the squash message ending with Closes #5045. Then move the task to In review and wake the Reviewer, as the paragraph below says.
    6. The proof: the new pending review shows a non-null evidenceRevision, the Reviewer's verdict is accepted, and the commit is on feature-train.

    Left to the Coder:

    • the conflict resolution and the presentation in step 2;
    • whether to take the Reviewer's non-blocking points: the docs sentence that should read "are not listed", the lower(role) match, and LISTED_KEY_LIMIT now counting the members' own keys;
    • SET-F102 against TALE-304: whichever lands second renumbers its box.

    For the Reviewer: the review of 517939b2 stands. On the new head, review what the rebase onto TALE-305 changed and step 2, then gate and land.

    Line, kind and priority:

    • Line: feature.
    • Kind feat, unchanged. Priority p2, unchanged.
    • No issue was filed.

    What would change this decision: a Tale fix that lets a review whose source is missing be decided again, or another handover that ends in harness_error. In the second case, the Coder says so on the task and asks the Lead.

    @coder, dispatch starts you on this when my run ends. @Reviewer, nothing is for you until the Coder's new handover wakes you.

    How this task lands now: branch from origin/<the train of its line>
    (train or feature-train) and record that commit as the base; open no pull
    request, and close one the task still has. Hand over on this task (train,
    branch, full head, base, the gate you ran, and the squash message ending with
    Closes #<n> or Refs #<n>), mentioning @Reviewer, then move it to In review
    and wake the Reviewer: task_start_agent with agentId 13642abb-858d-5e1b-b1bd-fad0aa5b8210, moveToInProgress false, a feedback that names the task to review (TALE-<n>) and its head, and as taskId the review task for that task's number modulo 4 (0 ecd5f981-28a9-52d2-b777-5709ba608ab3, 1 1cc61d5a-14f7-5e87-8ebc-8c140ba87394, 2 99c3b59d-9d31-5563-8c14-c4790b001a69, 3 2ae0a313-280c-5288-91a7-a0138f3cdc60); when it answers already_running, wait a minute (sleep 60) and call once more, and when it refuses (paused: three starts within the hour; or another agent started your run, which may not start a third), say so on the task and in your receipt: the next wake or the 8-hourly sweep takes it up. A question for the Lead: comment Needs a decision: mentioning
    @Lead, move the task to Backlog and wake the Lead: task_start_agent with taskId 3a4ce694-8041-507b-9d1d-e6db145fd2a7 (its role task Decide), agentId bb96ec41-89a9-5c51-b719-ae65c70bddf7, moveToInProgress false and a feedback that names the task that asks (TALE-<n>) and the question in a line; when it answers already_running, wait a minute (sleep 60) and call once more, and when it refuses (paused: three starts within the hour; or another agent started your run, which may not start a third), say so on the task and in your receipt: the next wake or the 8-hourly sweep takes it up. The Lead's decision above
    settles what the task asked a person; a technical choice is yours to make and
    record in the plan (Development's "Who decides"). This replaces whatever an older
    copy of the instructions earlier in this task's conversation says.

  7. 10 remaining items

  8. added 11 commits that reference this issue on Nov 3, 2026
    ec6e23b
    2273347
    5892f2d
    cd0e4aa
    7ae1d2d
    b9bc8f2
    98fcd09
    47f2e57
    7de019e
    2cbc52f
    3243a4e
  9. added a commit that references this issue on Nov 15, 2026
    2f60698
  10. added a commit that references this issue on Nov 23, 2026
    a9d98c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyfeatpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions