Skip to content

Display Creating API Key Name in Sandbox Details & List #3131

@radisicc

Description

@radisicc

Display Creating API Key Name in Sandbox Details & List

Description

This feature adds visibility into the origin of a sandbox by displaying the name of the API Key used to create it within the Sandbox Details view. Additionally, it enables filtering the Sandbox List by API Key name.

Problem

In shared environments (e.g., a "Staging" organization used for both CI/CD and local development), multiple API keys often generate sandboxes simultaneously. Currently, there is no easy way to distinguish between sandboxes created by a specific automated process (CI/CD) versus those created by individual developers or other tools. This leads to:

  • Audit friction: Hard to trace "who" or "what" spun up a resource.
  • Cleanup difficulty: difficult to batch-delete sandboxes generated by a specific stale test run or automation script.
  • Ambiguity: "Did I create this, or was it the nightly build?"

Proposal

Backend:

  • Persist the api_key_name (and api_key_id for reference) as metadata on the Sandbox object at the time of creation.
  • Note: Storing the name at creation time is preferred so the record remains readable even if the API Key is later deleted.

Dashboard UI:

  1. Sandbox Details Pane: Add a new field Created By (or API Key) below the "Created at" timestamp.
    • Value: Display the API Key Name. If created via the UI (user session), display the User's Name.
  2. Sandbox List View: Add a filter option to the search/filter bar to select specific API Keys.

CLI:

  • Update daytona sandbox info [ID] to include a Created By row.
  • Update daytona sandbox list to support filtering, e.g., daytona sandbox list --created-by "CI-Pipeline-Key".

DX & UX Implementation:

  • Interface:
    • Dashboard: In the details pane (as shown in the user's screenshot), insert the field naturally into the existing grid of metadata.
    • List Filter: A dropdown multi-select in the web UI for "Creator/API Key".
  • Feedback:
    • If the API key was deleted, display the name with a subtle indicator, e.g., Staging-CI (Deleted).
    • If the sandbox was created manually by a user (no API key), display the user's avatar/name.

Acceptance Criteria

  • The "Sandbox Details" view in the Dashboard displays the name of the API Key that created the sandbox.
  • The Sandbox List view allows filtering by API Key Name.
  • daytona sandbox info CLI command outputs the creator/key name.
  • If an API key is deleted, the historical name is still preserved on the sandbox record.

Impact

  • Observability: drastically improves the ability to understand resource usage in shared organizations.
  • Debugging: Faster identification of rogue scripts or misconfigured CI jobs spawning excess sandboxes.
  • Management: Simplifies bulk management of resources tied to specific workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions