Skip to content

ROADMAP-11 — P1 — Run ownership/tenancy: any API key can read any run by id #103

Open

Description

@getdownandcode

Series: ROADMAP — filed from the 2026-10-27 whole-project assessment · Backlog task: M15-T04 · Priority: P1 · Effort: medium · Labels: security, enhancement

Problem

API_KEYS is a flat shared list and runs has no owner column. Any valid key can read any run's full goal + final answer (and once ROADMAP-08 lands, list other tenants' runs) by knowing or enumerating run UUIDs. Keys cannot be revoked per-consumer or attributed per-consumer.

Evidence

  • agentkit/config.py:247 — flat API_KEYS
  • agentkit/core/types.py / agentkit/db/models.py — no owner/tenant on runs
  • agentkit/api/auth.py — verification returns only the matched key string

Suggested fix / acceptance criteria

  • runs.owner_key column records a hash of the API key (never the key itself) at create_run
  • GET /runs/{id}, GET /runs/{id}/trace, DELETE, and the new GET /runs filter by owner
  • Migration backfills existing rows as NULL = admin-visible only (documented)
  • Unit + integration test: cross-tenant access yields 404

Suggested branch / commit

feat/run-ownership · feat(db): scope run reads/cancels/deletes to the owning API key

Activity

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

    enhancementNew feature or requestsecuritySecurity vulnerability or hardening item

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions