Skip to content

Commit 6032a0c

Browse files
feat: Inject auth secrets via ambient agent config.
1 parent a6d82f1 commit 6032a0c

File tree

5 files changed

+56
-46
lines changed

5 files changed

+56
-46
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-8f9c749573846b07a55a3131b66456f0a592838c6bfc986ab30948df66cd6f11.yml
3-
openapi_spec_hash: 59f1ac98ad6cf13b12c59196bcecffd7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-e84e9a84f73c707b6543dcb8052c7d6bec5a6dae80f1fe77aeedf9133e10a4b8.yml
3+
openapi_spec_hash: ba9556a8fa64b9d1e88a27a2d467b835
44
config_hash: 60052b2c1c0862014416821aba875574

src/oz_agent_sdk/types/ambient_agent_config.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .._models import BaseModel
99
from .mcp_server_config import McpServerConfig
1010

11-
__all__ = ["AmbientAgentConfig", "Harness"]
11+
__all__ = ["AmbientAgentConfig", "Harness", "HarnessAuthSecrets"]
1212

1313

1414
class Harness(BaseModel):
@@ -17,15 +17,6 @@ class Harness(BaseModel):
1717
Default (nil/empty) uses Warp's built-in harness.
1818
"""
1919

20-
auth_secret_name: Optional[str] = None
21-
"""Name of a managed secret to use as the authentication credential for the
22-
harness.
23-
24-
The secret must exist within the caller's personal or team scope. The
25-
environment variable injected into the agent is determined by the secret type
26-
(e.g. ANTHROPIC_API_KEY for anthropic_api_key secrets).
27-
"""
28-
2920
type: Optional[Literal["oz", "claude"]] = None
3021
"""The harness type identifier.
3122
@@ -34,6 +25,20 @@ class Harness(BaseModel):
3425
"""
3526

3627

28+
class HarnessAuthSecrets(BaseModel):
29+
"""
30+
Authentication secrets for third-party harnesses.
31+
Only the secret for the harness specified gets injected into the environment.
32+
"""
33+
34+
claude_auth_secret_name: Optional[str] = None
35+
"""
36+
Name of a managed secret for Claude Code harness authentication. The secret must
37+
exist within the caller's personal or team scope. Only applicable when harness
38+
type is "claude".
39+
"""
40+
41+
3742
class AmbientAgentConfig(BaseModel):
3843
"""Configuration for a cloud agent run"""
3944

@@ -55,6 +60,12 @@ class AmbientAgentConfig(BaseModel):
5560
uses Warp's built-in harness.
5661
"""
5762

63+
harness_auth_secrets: Optional[HarnessAuthSecrets] = None
64+
"""
65+
Authentication secrets for third-party harnesses. Only the secret for the
66+
harness specified gets injected into the environment.
67+
"""
68+
5869
idle_timeout_minutes: Optional[int] = None
5970
"""
6071
Number of minutes to keep the agent environment alive after task completion. If

src/oz_agent_sdk/types/ambient_agent_config_param.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .mcp_server_config_param import McpServerConfigParam
99

10-
__all__ = ["AmbientAgentConfigParam", "Harness"]
10+
__all__ = ["AmbientAgentConfigParam", "Harness", "HarnessAuthSecrets"]
1111

1212

1313
class Harness(TypedDict, total=False):
@@ -16,15 +16,6 @@ class Harness(TypedDict, total=False):
1616
Default (nil/empty) uses Warp's built-in harness.
1717
"""
1818

19-
auth_secret_name: str
20-
"""Name of a managed secret to use as the authentication credential for the
21-
harness.
22-
23-
The secret must exist within the caller's personal or team scope. The
24-
environment variable injected into the agent is determined by the secret type
25-
(e.g. ANTHROPIC_API_KEY for anthropic_api_key secrets).
26-
"""
27-
2819
type: Literal["oz", "claude"]
2920
"""The harness type identifier.
3021
@@ -33,6 +24,20 @@ class Harness(TypedDict, total=False):
3324
"""
3425

3526

27+
class HarnessAuthSecrets(TypedDict, total=False):
28+
"""
29+
Authentication secrets for third-party harnesses.
30+
Only the secret for the harness specified gets injected into the environment.
31+
"""
32+
33+
claude_auth_secret_name: str
34+
"""
35+
Name of a managed secret for Claude Code harness authentication. The secret must
36+
exist within the caller's personal or team scope. Only applicable when harness
37+
type is "claude".
38+
"""
39+
40+
3641
class AmbientAgentConfigParam(TypedDict, total=False):
3742
"""Configuration for a cloud agent run"""
3843

@@ -54,6 +59,12 @@ class AmbientAgentConfigParam(TypedDict, total=False):
5459
uses Warp's built-in harness.
5560
"""
5661

62+
harness_auth_secrets: HarnessAuthSecrets
63+
"""
64+
Authentication secrets for third-party harnesses. Only the secret for the
65+
harness specified gets injected into the environment.
66+
"""
67+
5768
idle_timeout_minutes: int
5869
"""
5970
Number of minutes to keep the agent environment alive after task completion. If

tests/api_resources/agent/test_schedules.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def test_method_create_with_all_params(self, client: OzAPI) -> None:
4040
"base_prompt": "base_prompt",
4141
"computer_use_enabled": True,
4242
"environment_id": "environment_id",
43-
"harness": {
44-
"auth_secret_name": "auth_secret_name",
45-
"type": "oz",
46-
},
43+
"harness": {"type": "oz"},
44+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
4745
"idle_timeout_minutes": 1,
4846
"mcp_servers": {
4947
"foo": {
@@ -159,10 +157,8 @@ def test_method_update_with_all_params(self, client: OzAPI) -> None:
159157
"base_prompt": "base_prompt",
160158
"computer_use_enabled": True,
161159
"environment_id": "environment_id",
162-
"harness": {
163-
"auth_secret_name": "auth_secret_name",
164-
"type": "oz",
165-
},
160+
"harness": {"type": "oz"},
161+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
166162
"idle_timeout_minutes": 1,
167163
"mcp_servers": {
168164
"foo": {
@@ -405,10 +401,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOzAPI) ->
405401
"base_prompt": "base_prompt",
406402
"computer_use_enabled": True,
407403
"environment_id": "environment_id",
408-
"harness": {
409-
"auth_secret_name": "auth_secret_name",
410-
"type": "oz",
411-
},
404+
"harness": {"type": "oz"},
405+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
412406
"idle_timeout_minutes": 1,
413407
"mcp_servers": {
414408
"foo": {
@@ -524,10 +518,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncOzAPI) ->
524518
"base_prompt": "base_prompt",
525519
"computer_use_enabled": True,
526520
"environment_id": "environment_id",
527-
"harness": {
528-
"auth_secret_name": "auth_secret_name",
529-
"type": "oz",
530-
},
521+
"harness": {"type": "oz"},
522+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
531523
"idle_timeout_minutes": 1,
532524
"mcp_servers": {
533525
"foo": {

tests/api_resources/test_agent.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,8 @@ def test_method_run_with_all_params(self, client: OzAPI) -> None:
124124
"base_prompt": "base_prompt",
125125
"computer_use_enabled": True,
126126
"environment_id": "environment_id",
127-
"harness": {
128-
"auth_secret_name": "auth_secret_name",
129-
"type": "oz",
130-
},
127+
"harness": {"type": "oz"},
128+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
131129
"idle_timeout_minutes": 1,
132130
"mcp_servers": {
133131
"foo": {
@@ -285,10 +283,8 @@ async def test_method_run_with_all_params(self, async_client: AsyncOzAPI) -> Non
285283
"base_prompt": "base_prompt",
286284
"computer_use_enabled": True,
287285
"environment_id": "environment_id",
288-
"harness": {
289-
"auth_secret_name": "auth_secret_name",
290-
"type": "oz",
291-
},
286+
"harness": {"type": "oz"},
287+
"harness_auth_secrets": {"claude_auth_secret_name": "claude_auth_secret_name"},
292288
"idle_timeout_minutes": 1,
293289
"mcp_servers": {
294290
"foo": {

0 commit comments

Comments
 (0)