Skip to content

[Feature]: safely import Cockpit Tools Google Antigravity accounts #1076

Description

@agentHits

Area

Authentication and account pool

Goal

Allow users to import existing Google Antigravity accounts exported by Cockpit Tools instead of repeating interactive browser OAuth for every account.

Imported refresh tokens are credentials and must remain inside OpenCodex's normal credential-storage boundary.

This issue tracks the Cockpit Tools → Google Antigravity import contract only.

Current status

Implementation is in progress in:

#1357
feat(auth): import Cockpit Tools accounts through safe adapters

The earlier #1077 approach was superseded.

The current implementation direction deliberately avoids accepting credentials through command-line arguments or ordinary configuration.

This issue should remain open until the accepted implementation lands on dev.

Supported v1 input

The supported v1 format is a Cockpit Tools Google Antigravity export containing one or more records conceptually shaped like:

[
  {
    "email": "user@example.com",
    "refresh_token": "<redacted>"
  }
]

Examples, screenshots, logs, tests, and issue comments must use placeholders only.

No real refresh token belongs in repository content or normal diagnostic output.

Supported surfaces

Dashboard

Provide the import action under:

Providers
  → Google Antigravity
    → Accounts
      → Import Accounts

The Dashboard should use a local file picker.

It must not:

  • redisplay the file contents;
  • redisplay refresh tokens;
  • place credentials into persistent frontend state;
  • return credentials after processing.

Only safe result information should be shown.

CLI

CLI import must accept credential material through:

ocx account import google-antigravity --format cockpit-tools --file <path>

or:

cat accounts.json | ocx account import google-antigravity --format cockpit-tools --stdin

Credential JSON must not be accepted as a positional/argv value.

Command arguments can be retained in:

  • shell history;
  • process listings;
  • diagnostics;
  • terminal transcripts.

File/stdin-only admission avoids that unnecessary exposure.

Import validation

For each record:

  1. parse the supported Cockpit Tools format;
  2. require the fields needed by the format;
  3. reject malformed or unsupported entries;
  4. use the refresh token to perform the provider validation required by the Antigravity account path;
  5. derive authoritative account identity from the provider rather than trusting arbitrary caller-supplied identity;
  6. verify any claimed email against the provider-derived identity where applicable;
  7. resolve/validate the required Cloud Code Assist project;
  8. only then persist the account through the normal Antigravity credential store.

An imported credential must not be marked healthy merely because the JSON parsed.

Duplicate handling

Imports must be deterministic.

If the provider-derived account identity already exists, the import should safely update/upsert that identity rather than creating duplicate pool entries.

Duplicate detection must be based on authoritative account identity rather than trusting only the email text supplied by the export.

Batch behavior

A Cockpit Tools export may contain multiple accounts.

The import result may report bounded aggregate/status information such as:

imported
updated
failed
unsupported

or equivalent fixed result codes.

Do not include:

  • refresh tokens;
  • access tokens;
  • account IDs that are not already safe public identifiers;
  • raw provider errors;
  • raw import records.

Malformed successful responses from internal import components must fail closed rather than accidentally projecting unexpected data.

Credential handling

Imported refresh tokens must use the same protected credential-storage path as interactively authenticated Google Antigravity accounts.

The implementation must not place refresh tokens in:

  • ordinary config.json provider configuration;
  • request/history logs;
  • usage records;
  • telemetry;
  • diagnostics;
  • management API responses;
  • Dashboard result objects;
  • screenshots;
  • error messages.

Raw import payloads should not be retained after processing.

Security boundaries

The import adapter must be explicitly allowlisted.

For v1:

provider = google-antigravity
format   = cockpit-tools

must be the proven contract.

Do not interpret this feature as generic arbitrary OAuth credential import.

Other Cockpit Tools provider formats should remain unsupported until their credential and validation contracts are separately established.

The import parser should also be bounded so an untrusted local export cannot cause unbounded parsing or processing.

Failure behavior

One bad record should not expose or corrupt other credentials.

Failures should use safe, bounded result codes and counts.

A failure to:

  • refresh;
  • derive identity;
  • validate claimed identity;
  • resolve the Cloud Code Assist project;
  • persist the account;

must leave that record unavailable for routing.

Normal account import failure must not damage existing healthy Antigravity accounts.

After successful import

Successfully imported accounts should immediately become ordinary Google Antigravity accounts available to the existing account-management and pool machinery.

Import itself does not define:

  • pool selection policy;
  • automatic failover;
  • quota aggregation;
  • quota/reset presentation.

Those remain separate concerns.

Related issues

#1062

Broader Google Antigravity account-pool and management UX.

#1082

Per-account Gem/Cla quota display.

#695

Generic OAuth account-pool selection/failover architecture.

#1077

Superseded earlier implementation attempt.

#1357

Current implementation PR for this issue.

Acceptance criteria

  • Cockpit Tools Google Antigravity exports can be imported from the Dashboard using a local file.
  • CLI accepts imports through file or stdin only.
  • Credential payloads cannot be supplied through argv.
  • Multiple accounts can be processed in one import.
  • Refresh tokens are never returned by management APIs.
  • Refresh tokens are never written to normal logs, diagnostics, usage records, or configuration.
  • Provider-derived identity is validated before persistence.
  • Claimed identity is checked where applicable.
  • Required Cloud Code Assist project state is validated.
  • Existing account identities are updated/upserted deterministically rather than duplicated.
  • Result projection contains only bounded safe status/count information.
  • Malformed internal responses fail closed.
  • Imported accounts become available through the normal Antigravity account-management path.
  • Secret-shaped canary tests verify that credentials do not leak.
  • Dashboard regression coverage exists.
  • CLI/API regression coverage exists.
  • Explicit maintainer security review is complete.
  • Accepted implementation is merged into dev.

Checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions