ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

API Management: Standardizing key usage

Aperta
#1,113 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
18
Fork
10
Merge medio
2g 20h
PR unite (30g)
14

Descrizione

Is your feature request related to a problem?
OpenAI API keys are dispersed across individual developer accounts, leading to unreliable cost attribution and making it difficult to track usage. The absence of a naming and ownership convention results in many keys that are hard to identify, further complicating management.

Describe the solution you'd like

  1. Inventory

    • Export all active API keys across Kaapi (id, project, creation date, creator, last used, spend over the last 6 months).
    • Map each key to a use case and a current owner.
    • Flag keys with no identifiable owner or no usage in the last 90 days.
  2. Clean up

    • Revoke unused and orphaned keys.
    • Create replacements for in-use keys under the shared account, rotate the consuming services, then revoke originals.
    • Verify nothing breaks post-rotation (staging first).
  3. Standardise

    • Document key creation convention from the shared account, not personal accounts.
    • Use projects/service accounts for workload separation.
    • Establish a naming scheme (e.g., <service>-<env>-<purpose>).
    • Define ownership for key creation and revocation.
    • Add the convention to onboarding docs.
Original issue

Context

OpenAI API keys are currently spread across individual developer accounts rather
than the shared organisational account. Most keys appear to have been created
ad hoc by whoever needed one at the time, across a range of use cases (evals,
guardrails, feature work), so spend concentrates under a few personal accounts
and the shared account shows almost no usage.

There is also no naming or ownership convention, so it is hard to tell what any
given key is used for or whether it is still live. Several keys have been active
for a long time with no clear owner. This makes cost attribution unreliable and
the platform dashboard hard to read — pulling a six-month spend total currently
requires querying the usage API manually.

Scope

ONLY TOUCH KEYS USED BY KAAPI. DO NOT TOUCH OTHER KEYS (EG. GLIFIC BOTS, OTHER ORG KEYS)

1. Inventory

  • Export all active API keys across Kaapi (id, project, creation date, creator, last used, spend over the last 6 months)
  • Map each key to a use case and a current owner
  • Flag keys with no identifiable owner or no usage in the last 90 days

2. Clean up

  • Revoke unused and orphaned keys
  • For keys still in use, create replacements under the shared account, rotate the consuming services over, then revoke the originals
  • Verify nothing breaks post-rotation (staging first wherever a key backs a production path)

3. Standardise

  • Document the convention: keys for regular operational use are created from the shared account, never from personal accounts
  • Use projects / service accounts to separate workloads instead of separate personal keys, so usage is attributable by default
  • Agree a naming scheme, e.g. <service>-<env>-<purpose>
  • Define who owns key creation and revocation, and where the register of keys lives
  • Add the convention to onboarding docs

Acceptance criteria

  • No active keys remain under personal accounts for operational workloads
  • Every active key has a documented owner, purpose, and conventional name
  • Convention is written down and linked from onboarding

Notes

  • Rotation needs coordination with whoever owns each consuming service; worth
    identifying those owners during the inventory step rather than at rotation time.
  • Personal keys used purely for local experimentation can stay out of scope, but
    should be confirmed as non-production before being left alone.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Non vengono indicati file del repository, test o punti di ingresso del codice. Inizia seguendo l'ambito dell'inventario indicato in questo issue e la Usage API che identifica, quindi associa le key di proprietà di Kaapi ai relativi responsabili e servizi prima di pianificare la rotazione. Il lavoro è completato quando le key operative sono sotto l'account condiviso, ognuna ha un responsabile, uno scopo e un nome convenzionale, e la convenzione è collegata dalla documentazione di onboarding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
documentation, security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.