Skip to content

REMOTE-1601 Add named agent API key support behind FeatureFlag::NamedAgents - #10390

Merged
jasonkeung merged 15 commits into
masterfrom
jason/oz-agent-api-keys
May 8, 2026
Merged

REMOTE-1601 Add named agent API key support behind FeatureFlag::NamedAgents#10390
jasonkeung merged 15 commits into
masterfrom
jason/oz-agent-api-keys

Conversation

@jasonkeung

@jasonkeung jasonkeung commented May 7, 2026

Copy link
Copy Markdown
Contributor

Description

Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind FeatureFlag::NamedAgents (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via GET /api/v1/agent/identities. If no agents exist, an empty state links to oz.warp.dev/agents to create one.

Changes

  • crates/warp_features: Add FeatureFlag::NamedAgents to dogfood
  • crates/warp_graphql_schema + crates/graphql: Add agentUid: ID to GenerateApiKeyInput
  • app/src/server/server_api/auth.rs: Add AgentIdentity type, list_agent_identities(), and agent_uid param to create_api_key()
  • app/src/settings_view/platform/create_api_key_modal.rs: Agent type selector, dropdown, empty state, create flow
  • app/src/settings_view/platform_page.rs: Scope column displays "Agent" when flag is on

Oz conversation · Plan

Linked Issue

Testing

Feature is behind FeatureFlag::NamedAgents (dogfood only). Verified compilation of warp_features and warp_graphql crates. Full app compilation blocked by pre-existing http_client error unrelated to this change.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz oz-agent@warp.dev

jasonkeung and others added 9 commits May 5, 2026 11:56
- Add taskGitCredentials types to schema.graphql (verified against staging)
  and add to clientQueries allowlist in client-schema.ts
- Add task_git_credentials.rs GraphQL query file (cynic) following the
  task_secrets pattern
- Add GitCredential struct and get_task_git_credentials to AIClient
  trait with a ServerApi implementation

Co-Authored-By: Oz <oz-agent@warp.dev>
- Add driver/git_credentials.rs: atomic writes to ~/.git-credentials
  and ~/.config/gh/hosts.yaml, one-time git config setup (credential.helper
  store, url.insteadOf), git identity configuration, and refresh_loop()
  which re-fetches credentials every 50 minutes
- Extend fetch_secrets_and_attachments to call taskGitCredentials in
  parallel at startup; writes credential files and git config
- Add futures::select! refresh loop in run_internal, racing the harness
  execution against the infinite refresh loop for both Oz and ThirdParty
  harnesses

Co-Authored-By: Oz <oz-agent@warp.dev>
- Write ~/.git-credentials and ~/.config/gh/hosts.yaml temp files with
  0600 permissions (mode + set_permissions) matching the existing pattern
  in write_codex_auth_json, preventing other users from reading tokens
- Add run_git_config_add (--add flag) so multi-value insteadOf entries
  coexist instead of the second overwriting the first
- Derive SSH→HTTPS URL rewrites from credential hosts rather than
  hardcoding github.com, using --add for both scp-style and ssh:// forms
  per host

Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
On transient failure, retry up to 3 times with 1min, 2min, 4min delays,
keeping all retries within the ~10-minute buffer before token expiry.

Co-Authored-By: Oz <oz-agent@warp.dev>
When enabled, the API key creation modal replaces the Team option with
Agent, letting users select a named agent identity to scope the key to.
Agents are fetched from GET /api/v1/agent/identities and the selected
agent UID is sent via the existing agentUid field on GenerateApiKeyInput.

Changes:
- Add FeatureFlag::NamedAgents (dogfood-enabled)
- Add agentUid to GraphQL schema and codegen GenerateApiKeyInput
- Add AgentIdentity type and list_agent_identities to AuthClient
- Add agent_uid parameter to create_api_key
- Update CreateApiKeyModal with agent dropdown and empty-state linking
  to oz.warp.dev/agents
- Show Scope column as Agent (not Team) when flag is enabled

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 7, 2026
@jasonkeung
jasonkeung marked this pull request as ready for review May 7, 2026 19:17
@oz-for-oss

oz-for-oss Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

@jasonkeung

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds named-agent API key UI/API plumbing, but the diff also includes new cloud git credential management code. The changed Rust currently has compile errors, and there are correctness issues in the settings UI around API-key scope labeling and agent-list failures.

Concerns

  • The new git credential fetch code calls Duration::from_mins, which is not available on std::time::Duration, in two changed files.
  • Existing team-owned API keys are shown as Agent whenever FeatureFlag::NamedAgents is enabled because the UI maps every OwnerType::Team to ApiKeyScope::Agent.
  • Agent identity load failures are swallowed, so users see a no-agents empty state and disabled create flow instead of a load error or retry path.
  • Manual testing is required for changes that can be manually tested. Please include screenshots or a screen recording that show the API key modal/list changes working end to end, or justify why manual testing is not possible.

Verdict

Found: 2 critical, 3 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/ai/agent_sdk/mod.rs
Comment thread app/src/ai/agent_sdk/driver/git_credentials.rs Outdated
Comment thread app/src/settings_view/platform_page.rs Outdated
Comment thread app/src/settings_view/platform/create_api_key_modal.rs Outdated
jasonkeung and others added 4 commits May 7, 2026 17:15
- Fix Duration::from_mins (doesn't exist) to Duration::from_secs(5 * 60)
- Always map Team-owned API keys to Team scope, not Agent
- Surface error toast on failed list_agent_identities instead of silently ignoring

Co-Authored-By: Oz <oz-agent@warp.dev>
…nt-api-keys

# Conflicts:
#	app/src/ai/agent_sdk/driver/git_credentials.rs
#	app/src/ai/agent_sdk/mod.rs
…n Agent variant

Co-Authored-By: Oz <oz-agent@warp.dev>
@jasonkeung
jasonkeung requested a review from ianhodge May 7, 2026 23:16
@jasonkeung jasonkeung changed the title Add named agent API key support behind FeatureFlag::NamedAgents REMOTE-1601 Add named agent API key support behind FeatureFlag::NamedAgents May 7, 2026

Copy link
Copy Markdown
Contributor Author

@oz-agent fix conflicts

@oz-for-oss

oz-for-oss Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

@jasonkeung

I'm working on changes requested in this PR (responding to a PR conversation comment).

You can view the conversation on Warp.

I pushed changes to this PR based on the comment.

Next steps:

  • Review the changes pushed to this PR.
  • Follow up with another comment if further adjustments are needed.

Powered by Oz

@ianhodge

ianhodge commented May 7, 2026

Copy link
Copy Markdown
Member

Nice! Could we also update the list view to have the name of the agent that the key is associated with as a part of this PR? Might need to consult design about it

@jasonkeung

jasonkeung commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Nice! Could we also update the list view to have the name of the agent that the key is associated with as a part of this PR? Might need to consult design about it

@ianhodge Currently the server API for these keys only returns them as team or personal, so to do that, we'd need to make some api and server changes to resolve the service account to an agent and change the response.

I thought about doing that, but do you think it could wait to be with the rest of the named agents work? or would the time to do this be now

@ianhodge

ianhodge commented May 7, 2026

Copy link
Copy Markdown
Member

makes sense, let's land this for now but we should def try and get that change in before launch if possible

right now it's kinda confusing to know the association for the keys

@jasonkeung
jasonkeung enabled auto-merge (squash) May 8, 2026 04:36
@jasonkeung
jasonkeung marked this pull request as draft May 8, 2026 04:45
auto-merge was automatically disabled May 8, 2026 04:45

Pull request was converted to draft

@jasonkeung
jasonkeung marked this pull request as ready for review May 8, 2026 04:45
@oz-for-oss

oz-for-oss Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

@jasonkeung

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds the named-agent API key creation path behind FeatureFlag::NamedAgents, including API/schema plumbing, fetching agent identities, and new modal UI.

Concerns

  • Agent-scoped keys are not actually represented in the settings table because ApiKeyScope::Agent is added only as a dead-code display variant; newly created and fetched keys still map scope from owner_type, which the PR notes does not distinguish agents from teams.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

enum ApiKeyScope {
Personal,
Team,
/// Not yet constructed — the server doesn't distinguish agent-scoped keys

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] ApiKeyScope::Agent is never constructed: both fetched keys and the just-created key still derive scope from owner_type, which this comment says the server reports as team, so agent-scoped keys will render as Team instead of Agent. Pass the selected key type through the create event or add server-provided agent scope before showing the Scope column as agent-aware.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above convo, we will aim to land the server side change before launch

@jasonkeung
jasonkeung enabled auto-merge (squash) May 8, 2026 15:23
@jasonkeung
jasonkeung merged commit 7f5a689 into master May 8, 2026
25 checks passed
@jasonkeung
jasonkeung deleted the jason/oz-agent-api-keys branch May 8, 2026 15:35
trungtai1805 pushed a commit to trungtai1805/warp that referenced this pull request May 9, 2026
…Agents (warpdotdev#10390)

## Description
Add support for creating API keys scoped to named agent identities in
the Oz Cloud API Keys settings page, gated behind
`FeatureFlag::NamedAgents` (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is
replaced with "Agent". Users can select which named agent the key
authenticates as from a dropdown populated via `GET
/api/v1/agent/identities`. If no agents exist, an empty state links to
`oz.warp.dev/agents` to create one.


### Changes
- **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood
- **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add
`agentUid: ID` to `GenerateApiKeyInput`
- **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type,
`list_agent_identities()`, and `agent_uid` param to `create_api_key()`
- **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent
type selector, dropdown, empty state, create flow
- **`app/src/settings_view/platform_page.rs`**: Scope column displays
"Agent" when flag is on

[Oz
conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e)
· [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6)

## Linked Issue
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
https://www.loom.com/share/636237a795c34e1ca1806761b5018160

## Testing
Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified
compilation of `warp_features` and `warp_graphql` crates. Full app
compilation blocked by pre-existing `http_client` error unrelated to
this change.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
tungd pushed a commit to tungd/warp that referenced this pull request May 11, 2026
…Agents (warpdotdev#10390)

## Description
Add support for creating API keys scoped to named agent identities in
the Oz Cloud API Keys settings page, gated behind
`FeatureFlag::NamedAgents` (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is
replaced with "Agent". Users can select which named agent the key
authenticates as from a dropdown populated via `GET
/api/v1/agent/identities`. If no agents exist, an empty state links to
`oz.warp.dev/agents` to create one.


### Changes
- **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood
- **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add
`agentUid: ID` to `GenerateApiKeyInput`
- **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type,
`list_agent_identities()`, and `agent_uid` param to `create_api_key()`
- **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent
type selector, dropdown, empty state, create flow
- **`app/src/settings_view/platform_page.rs`**: Scope column displays
"Agent" when flag is on

[Oz
conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e)
· [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6)

## Linked Issue
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
https://www.loom.com/share/636237a795c34e1ca1806761b5018160

## Testing
Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified
compilation of `warp_features` and `warp_graphql` crates. Full app
compilation blocked by pre-existing `http_client` error unrelated to
this change.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
lawsmd pushed a commit to lawsmd/cortex that referenced this pull request May 22, 2026
…Agents (warpdotdev#10390)

## Description
Add support for creating API keys scoped to named agent identities in
the Oz Cloud API Keys settings page, gated behind
`FeatureFlag::NamedAgents` (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is
replaced with "Agent". Users can select which named agent the key
authenticates as from a dropdown populated via `GET
/api/v1/agent/identities`. If no agents exist, an empty state links to
`oz.warp.dev/agents` to create one.


### Changes
- **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood
- **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add
`agentUid: ID` to `GenerateApiKeyInput`
- **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type,
`list_agent_identities()`, and `agent_uid` param to `create_api_key()`
- **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent
type selector, dropdown, empty state, create flow
- **`app/src/settings_view/platform_page.rs`**: Scope column displays
"Agent" when flag is on

[Oz
conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e)
· [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6)

## Linked Issue
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
https://www.loom.com/share/636237a795c34e1ca1806761b5018160

## Testing
Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified
compilation of `warp_features` and `warp_graphql` crates. Full app
compilation blocked by pre-existing `http_client` error unrelated to
this change.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Stoica-Mihai pushed a commit to Stoica-Mihai/warp that referenced this pull request Jun 5, 2026
…Agents (warpdotdev#10390)

## Description
Add support for creating API keys scoped to named agent identities in
the Oz Cloud API Keys settings page, gated behind
`FeatureFlag::NamedAgents` (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is
replaced with "Agent". Users can select which named agent the key
authenticates as from a dropdown populated via `GET
/api/v1/agent/identities`. If no agents exist, an empty state links to
`oz.warp.dev/agents` to create one.


### Changes
- **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood
- **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add
`agentUid: ID` to `GenerateApiKeyInput`
- **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type,
`list_agent_identities()`, and `agent_uid` param to `create_api_key()`
- **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent
type selector, dropdown, empty state, create flow
- **`app/src/settings_view/platform_page.rs`**: Scope column displays
"Agent" when flag is on

[Oz
conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e)
· [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6)

## Linked Issue
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
https://www.loom.com/share/636237a795c34e1ca1806761b5018160

## Testing
Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified
compilation of `warp_features` and `warp_graphql` crates. Full app
compilation blocked by pre-existing `http_client` error unrelated to
this change.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Zollicoff pushed a commit to Zollicoff/warp that referenced this pull request Jul 2, 2026
…Agents (warpdotdev#10390)

## Description
Add support for creating API keys scoped to named agent identities in
the Oz Cloud API Keys settings page, gated behind
`FeatureFlag::NamedAgents` (dogfood-enabled).

When the flag is enabled, the "Team" option in the key-type selector is
replaced with "Agent". Users can select which named agent the key
authenticates as from a dropdown populated via `GET
/api/v1/agent/identities`. If no agents exist, an empty state links to
`oz.warp.dev/agents` to create one.


### Changes
- **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood
- **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add
`agentUid: ID` to `GenerateApiKeyInput`
- **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type,
`list_agent_identities()`, and `agent_uid` param to `create_api_key()`
- **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent
type selector, dropdown, empty state, create flow
- **`app/src/settings_view/platform_page.rs`**: Scope column displays
"Agent" when flag is on

[Oz
conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e)
· [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6)

## Linked Issue
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
https://www.loom.com/share/636237a795c34e1ca1806761b5018160

## Testing
Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified
compilation of `warp_features` and `warp_graphql` crates. Full app
compilation blocked by pre-existing `http_client` error unrelated to
this change.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants