ms-tau-sdk 2.0.7.dev41__tar.gz → 2.0.7.dev42__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/CHANGELOG.md +5 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/PKG-INFO +1 -1
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/pyproject.toml +1 -1
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/agent_skills/tau_project_customization/SKILL.md +3 -0
- ms_tau_sdk-2.0.7.dev42/src/ms_tau_sdk/agent_skills/tau_security_and_access/SKILL.md +244 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/.gitignore +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/README.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/app.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/cli.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/config.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/env_file.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/logs.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/proxy.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/state.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/BULMA-LICENSE.txt +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/app.js +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/board.css +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/bulma.min.css +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/index.html +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/agent_skills/tau_a2a_runtime_adapter/SKILL.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/agent_skills/tau_local_development/SKILL.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/agent_skills/tau_repository_integration/SKILL.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/a2a.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/chat.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/conversations.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/dependencies.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/health.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/inspection.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/local_chat.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/models.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/request_identity.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/api/sessions.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/app.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/application.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/assertions.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/auth.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/client.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/local.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/mcp.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/models.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/backend/routes.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/cli.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/errors.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/logging.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/a2a_failure.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/a2a_message.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/a2a_roles.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/assistant_ui.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/chat_history.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/protocols/strict_json.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/providers/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/providers/definitions.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/providers/factory.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/providers/tau_compat.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/resources/SYSTEM.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/resources/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/resources/loader.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/resources/prompts/review-code-repository.md +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/deployment_health.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/events.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/extensions.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/failures.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/live_turns.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/manager.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/observability.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/provenance.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/requester.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/session.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/snapshots.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/task_context.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/sessions/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/sessions/storage.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/settings.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/skills.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/__init__.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/mainsequence_mcp.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/mcp_applications.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/mcp_connection.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/skill_read.py +0 -0
- {ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/tools/task_control.py +0 -0
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
- The SDK no longer hides the withdrawn private Secret entry operations, and the local health
|
|
29
29
|
field `mcp_session_proof_limited_tool_count` is removed.
|
|
30
30
|
|
|
31
|
+
- A new packaged skill, `tau_security_and_access`, teaches building project tools that act for the
|
|
32
|
+
person a turn serves: which delegation each tool should use, a worked example of tools that use
|
|
33
|
+
a person's own Secret without exposing it to the model, and how sharing decides what a delegated
|
|
34
|
+
call can reach. `ms-tau skills sync` now installs five skills.
|
|
35
|
+
|
|
31
36
|
- Documentation now distinguishes requester-bound reads and supported writes from workload grants,
|
|
32
37
|
states the write risk and platform rollout requirements, and includes conversation/Task
|
|
33
38
|
permissions and denial recovery. The Security and access guide keeps its `security-model.md`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ms-tau-sdk
|
|
3
|
-
Version: 2.0.7.
|
|
3
|
+
Version: 2.0.7.dev42
|
|
4
4
|
Summary: Workspace-bound Tau application primitives for Main Sequence projects
|
|
5
5
|
Project-URL: Changelog, https://github.com/mainsequence-sdk/ms-tau-sdk/blob/development/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://github.com/mainsequence-sdk/ms-tau-sdk/tree/development/docs
|
|
@@ -175,6 +175,9 @@ separate authority. Prompt injection can cause unintended changes, sharing, or d
|
|
|
175
175
|
person's permissions, and completed writes can outlast the delegation. Only Organization admins
|
|
176
176
|
enable this authority.
|
|
177
177
|
|
|
178
|
+
For a complete example, a tool that uses a person's Secret without exposing it, and how sharing
|
|
179
|
+
decides what a delegated call can reach, use `tau_security_and_access`.
|
|
180
|
+
|
|
178
181
|
## Validation
|
|
179
182
|
|
|
180
183
|
Verify each project-owned capability through its observable interface and focused tests. Check
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tau-security-and-access
|
|
3
|
+
description: Build and review project tools that call the platform or other applications for the person a turn serves, including tools that use a person's Secret without exposing it, and explain how delegation and sharing decide what those tools can reach.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TAU Security and Access
|
|
7
|
+
|
|
8
|
+
Use this skill when a project tool under `.tau/extensions/` calls the platform or another
|
|
9
|
+
platform application, uses a Secret, or must answer each person with their own data. Extension
|
|
10
|
+
mechanics are in `tau_project_customization`. The full model, with the administrator setup, is in
|
|
11
|
+
the SDK's Security and access guide (`docs/reference/security-model.md`). Sharing itself is in
|
|
12
|
+
`.agents/skills/mainsequence/platform_operations/access_control_and_sharing/SKILL.md`.
|
|
13
|
+
|
|
14
|
+
## Who a call acts as
|
|
15
|
+
|
|
16
|
+
Every call a tool makes through `platform_client()` follows one rule:
|
|
17
|
+
|
|
18
|
+
| The call carries | Permissions used |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| No delegation | The caller's own: the Agent's workload grants, or in local mode your own login. |
|
|
21
|
+
| A valid delegation | The person the turn serves, with their ordinary permissions, including administrative ones. |
|
|
22
|
+
| A delegation that ended or is invalid | None. The call is refused with a `PermissionError` and is never retried as the Agent. |
|
|
23
|
+
|
|
24
|
+
- The platform names the person when the turn starts, and `current_requester()` returns them. It
|
|
25
|
+
returns `None` when the Agent is not enabled to act for people (only an Organization admin can
|
|
26
|
+
enable it, with `acts_for_requester`), for work no person asked for, in local mode and outside a
|
|
27
|
+
turn.
|
|
28
|
+
- The operation or application that receives the call decides what it may do. No list says which
|
|
29
|
+
operations accept a delegation. Read access never implies edit, run, share or delete.
|
|
30
|
+
- The call stays the Agent's call, made for the person. It is not impersonation: the platform
|
|
31
|
+
checks it on every call, only while the turn or Task serving the person runs, for at most 24
|
|
32
|
+
hours after their request, and only in the Agent's Environment.
|
|
33
|
+
|
|
34
|
+
## Choose the delegation for each tool
|
|
35
|
+
|
|
36
|
+
| The tool | `delegation` |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Answers each person with their own data, or uses their credentials | `"required"` |
|
|
39
|
+
| Works for anyone, for the person when the turn serves one | `"auto"` (the default) |
|
|
40
|
+
| Uses only the Agent's own resources, the same for everyone | `"none"` |
|
|
41
|
+
|
|
42
|
+
With `"required"`, a turn that serves nobody raises a `PermissionError` before anything is sent.
|
|
43
|
+
With `"auto"`, the same tool reaches different things for different people, and the Agent's own
|
|
44
|
+
grants when nobody is served: make sure both are what you intend. Local turns serve nobody, so a
|
|
45
|
+
`"required"` tool refuses in local mode; test it with fakes (see [Testing](#testing)).
|
|
46
|
+
|
|
47
|
+
## Example: a tool that uses a person's own Secret
|
|
48
|
+
|
|
49
|
+
A person stores an API key for an outside data provider, and the Agent uses it for them without
|
|
50
|
+
ever seeing it:
|
|
51
|
+
|
|
52
|
+
1. The person creates the Secret themselves. The Agent never asks for the value or accepts it.
|
|
53
|
+
2. The tool that calls the provider reads the Secret as the person, inside that same call.
|
|
54
|
+
3. The tool uses the value and returns only the result.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
"""Quotes from an outside provider, with each person's own API key."""
|
|
58
|
+
|
|
59
|
+
import json
|
|
60
|
+
|
|
61
|
+
import httpx
|
|
62
|
+
from tau_agent.messages import TextContent
|
|
63
|
+
from tau_agent.tools import AgentTool, AgentToolResult
|
|
64
|
+
|
|
65
|
+
from ms_tau_sdk import current_requester, platform_client
|
|
66
|
+
|
|
67
|
+
PROVIDER_URL = "https://quotes.example.test/v1/latest"
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _text(message):
|
|
71
|
+
return AgentToolResult(content=[TextContent(text=message)])
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _secret_name():
|
|
75
|
+
# The name comes from the person the platform named, never from the model.
|
|
76
|
+
person = current_requester()
|
|
77
|
+
return None if person is None else f"QUOTES_API_KEY__{person.uid}"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
async def _secret_uid(client, name):
|
|
81
|
+
# Listing returns names and UIDs, never values. Names are unique in the Agent's Environment.
|
|
82
|
+
answer = await client.request("GET", "/api/v1/secrets/", params={"name": name})
|
|
83
|
+
if answer.status_code != 200:
|
|
84
|
+
return None
|
|
85
|
+
found = answer.json()["results"]
|
|
86
|
+
return found[0]["uid"] if found else None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
async def connect_quotes(tool_call_id, arguments, signal=None, on_update=None):
|
|
90
|
+
name = _secret_name()
|
|
91
|
+
if name is None:
|
|
92
|
+
return _text("I can set up your key only while answering your own request.")
|
|
93
|
+
try:
|
|
94
|
+
uid = await _secret_uid(platform_client(delegation="required"), name)
|
|
95
|
+
except PermissionError:
|
|
96
|
+
return _text("Your access for this request ended. Please ask again.")
|
|
97
|
+
if uid is not None:
|
|
98
|
+
return _text(f"Your key is stored as the Secret {name}.")
|
|
99
|
+
return _text(
|
|
100
|
+
f"Create a Secret named {name} with your API key, in the Environment this Agent runs in: "
|
|
101
|
+
f"on the Secrets page in Command Center, or with `mainsequence secrets create {name}`, "
|
|
102
|
+
"which asks for the value without showing it. Never paste the key into this chat."
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
async def latest_quote(tool_call_id, arguments, signal=None, on_update=None):
|
|
107
|
+
name = _secret_name()
|
|
108
|
+
if name is None:
|
|
109
|
+
return _text("I can use your key only while answering your own request.")
|
|
110
|
+
client = platform_client(delegation="required")
|
|
111
|
+
try:
|
|
112
|
+
uid = await _secret_uid(client, name)
|
|
113
|
+
if uid is None:
|
|
114
|
+
return _text(f"First create the Secret {name}. Ask me how.")
|
|
115
|
+
secret = await client.request("GET", f"/api/v1/secrets/{uid}/")
|
|
116
|
+
except PermissionError:
|
|
117
|
+
return _text("Your access for this request ended. Please ask again.")
|
|
118
|
+
if secret.status_code != 200:
|
|
119
|
+
return _text("I could not read your key.")
|
|
120
|
+
try:
|
|
121
|
+
async with httpx.AsyncClient(timeout=10.0) as http:
|
|
122
|
+
quote = await http.get(
|
|
123
|
+
PROVIDER_URL,
|
|
124
|
+
params={"symbol": arguments["symbol"]},
|
|
125
|
+
headers={"Authorization": f"Bearer {secret.json()['value']}"},
|
|
126
|
+
)
|
|
127
|
+
except httpx.HTTPError:
|
|
128
|
+
# The error can carry the request with its headers: never show it.
|
|
129
|
+
return _text("The quotes provider did not answer.")
|
|
130
|
+
if quote.status_code != 200:
|
|
131
|
+
return _text(f"The quotes provider answered {quote.status_code}.")
|
|
132
|
+
data = quote.json()
|
|
133
|
+
return _text(json.dumps({"symbol": data["symbol"], "price": data["price"]}))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def setup(tau):
|
|
137
|
+
tau.register_tool(
|
|
138
|
+
AgentTool(
|
|
139
|
+
name="connect_quotes",
|
|
140
|
+
label="Connect Quotes",
|
|
141
|
+
description="Check or explain how to store your quotes API key as your own Secret.",
|
|
142
|
+
parameters={"type": "object", "properties": {}, "additionalProperties": False},
|
|
143
|
+
execute_fn=connect_quotes,
|
|
144
|
+
)
|
|
145
|
+
)
|
|
146
|
+
tau.register_tool(
|
|
147
|
+
AgentTool(
|
|
148
|
+
name="latest_quote",
|
|
149
|
+
label="Latest Quote",
|
|
150
|
+
description="Get the latest quote for a symbol with your own quotes API key.",
|
|
151
|
+
parameters={
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {"symbol": {"type": "string"}},
|
|
154
|
+
"required": ["symbol"],
|
|
155
|
+
"additionalProperties": False,
|
|
156
|
+
},
|
|
157
|
+
execute_fn=latest_quote,
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
What makes it safe:
|
|
163
|
+
|
|
164
|
+
- No tool takes a Secret value or a Secret name from the model. The name is built from
|
|
165
|
+
`current_requester().uid`, so prompt injection cannot point the tool at another Secret.
|
|
166
|
+
- `delegation="required"` reads the Secret as the person. The platform returns it only if the
|
|
167
|
+
person can view it; the name is a lookup key, not the protection.
|
|
168
|
+
- The value exists only inside one call. It never goes into the result, `details`, a log, an
|
|
169
|
+
exception message, a file or a cache for the next turn. It travels in a header, never in a URL,
|
|
170
|
+
because URLs reach logs. Errors from the outside call are caught, and the provider's raw body is
|
|
171
|
+
never returned.
|
|
172
|
+
- There is no tool that returns a Secret value, and no tool that calls any platform path the model
|
|
173
|
+
chooses. With the delegation, such a tool would let the model read every Secret the person can.
|
|
174
|
+
- The Agent's own workload holds no grant on these Secrets, so a call without the person reaches
|
|
175
|
+
none of them.
|
|
176
|
+
|
|
177
|
+
## Sharing decides what a delegated call can reach
|
|
178
|
+
|
|
179
|
+
A delegated read returns anything the person can view in the Agent's Environment: what they
|
|
180
|
+
created and what others shared with them, directly or through a team. This holds for Secrets and
|
|
181
|
+
every other object. The platform enforces sharing; which of those objects a tool uses is part of
|
|
182
|
+
the tool's design. For Secrets, the naming convention states that design:
|
|
183
|
+
|
|
184
|
+
- **A personal credential:** a name tied to the person, such as `QUOTES_API_KEY__<person uid>`.
|
|
185
|
+
The person decides whether to share it.
|
|
186
|
+
- **A team credential:** a name the team agrees on, shared with the team for view. The tool reads
|
|
187
|
+
it for any member.
|
|
188
|
+
- **Someone else's Secret shared with the person:** valid whenever the tool is meant to use it.
|
|
189
|
+
|
|
190
|
+
Whoever can edit a Secret decides its value, so the tool uses whatever value they set. Granting or
|
|
191
|
+
accepting edit on a Secret means trusting that person with what the tool does with it. That is a
|
|
192
|
+
decision people make through sharing, not one the platform makes for them.
|
|
193
|
+
|
|
194
|
+
How sharing works:
|
|
195
|
+
|
|
196
|
+
- The creator of a Secret can always view and edit it, and cannot be removed from it. People who
|
|
197
|
+
can edit a Secret can share it, for view or for edit, with people and teams.
|
|
198
|
+
- Most people can share only within the teams they belong to; Organization admins can share
|
|
199
|
+
across their Organization.
|
|
200
|
+
- `GET /api/v1/secrets/<uid>/can-view/` and `can-edit/` list the people and teams with access. A
|
|
201
|
+
tool can use them when its design needs to, for example to refuse a team key where it expects a
|
|
202
|
+
personal one. That is a choice of the tool, not a platform rule.
|
|
203
|
+
|
|
204
|
+
## What never reaches the model
|
|
205
|
+
|
|
206
|
+
Tool results, their `details`, and errors can reach the model provider and the session history.
|
|
207
|
+
Never return a Secret value, a token, a proof, an assertion, a response object, its headers or a
|
|
208
|
+
raw error body. Return business results: rows, numbers, names, and plain messages. The SDK already
|
|
209
|
+
keeps its own credentials out of that path and never lets a tool set `Authorization` or an
|
|
210
|
+
`X-MainSequence-*` header.
|
|
211
|
+
|
|
212
|
+
## Limits
|
|
213
|
+
|
|
214
|
+
- This works in the Agent's own project tools. An application that receives a delegated call
|
|
215
|
+
learns the person with `User.get_requester()`, but it cannot call the platform as that person.
|
|
216
|
+
- The delegation ends with the turn. A task the tool leaves running acts as the Agent afterwards,
|
|
217
|
+
and nothing read for one person may be kept for another turn or another person.
|
|
218
|
+
- When the person's access ends (the turn is over, the access was removed, 24 hours passed, or
|
|
219
|
+
the Agent is not enabled), calls raise a `PermissionError` whose `code` is
|
|
220
|
+
`requester_binding_invalid` or starts with `runtime_lease_`. Say in plain words that the request
|
|
221
|
+
cannot be served, and never retry it as the Agent.
|
|
222
|
+
- Every other answer, such as `403` or `404` for an object the person cannot see, is returned as
|
|
223
|
+
it is: check the status before using the body.
|
|
224
|
+
|
|
225
|
+
## Testing
|
|
226
|
+
|
|
227
|
+
Patch the extension module's `current_requester` and `platform_client` with fakes, and test:
|
|
228
|
+
|
|
229
|
+
- with a person and the Secret: the result holds only business fields, and the value appears in no
|
|
230
|
+
result text, `details`, log record or exception;
|
|
231
|
+
- with a person and no Secret: the tool explains how to create it and sends no provider call;
|
|
232
|
+
- with nobody: the tool refuses and sends nothing;
|
|
233
|
+
- a `PermissionError` from the client: a plain message, and no second call;
|
|
234
|
+
- a failing or erroring provider: a plain message without the provider's body or the request.
|
|
235
|
+
|
|
236
|
+
## Review checklist
|
|
237
|
+
|
|
238
|
+
- Each tool has a deliberate `delegation`: `"required"` for a person's own data or credentials.
|
|
239
|
+
- No person's UID, Secret name or Secret value comes from tool arguments, the prompt or history.
|
|
240
|
+
- No tool returns a credential or calls a platform path the model chooses.
|
|
241
|
+
- Secret values stay inside one call, in headers, never in results, logs, errors, URLs or caches.
|
|
242
|
+
- The naming convention says whose Secrets the tool uses, and the people sharing them know it.
|
|
243
|
+
- A refused delegated call is reported, never retried as the Agent.
|
|
244
|
+
- The Agent's workload holds no grants it does not need, and none on people's Secrets.
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/__init__.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/app.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/cli.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/config.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/env_file.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/logs.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/proxy.py
RENAMED
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/state.py
RENAMED
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/packages/tau-board/src/ms_tau_board/static/app.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_tau_sdk-2.0.7.dev41 → ms_tau_sdk-2.0.7.dev42}/src/ms_tau_sdk/runtime/deployment_health.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|