You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1f66aed
Browse filesBrowse the repository at this point in the historyBrowse files
Ask the user to approve CSP origins granted by agent tools
An allowed origin is a channel for data to leave a sandboxed app, so the
agent should not be able to add one silently. app_create now pauses with
context.ask_user() to list any requested csp_origins and what allowing
them means before the app is created, after the existing allow-list and
apps-set-csp checks. Declining leaves nothing created.
Adds an app_set_csp_origins tool so the agent can change the allowed
origins of an existing app, which previously required the edit page.
Newly added origins go through the same approval prompt; origins the app
already has may be kept even when outside the configured allow-list,
matching the edit page. Pure removals and no-op calls do not prompt.
The stored query and CSP flows share one _ask_approval helper.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AntsSDFjTehLtuZhQQPQyD
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,9 +73,9 @@ Stored query access is configured using a picker on the create and edit pages. T
73
73
74
74
### Agent tools
75
75
76
-
If [datasette-agent](https://github.com/datasette/datasette-agent) is installed, this plugin registers tools that let the agent build and edit stored apps: `app_list`, `app_create`, `app_view`, `app_str_replace`, `app_insert`, `app_edit`, `app_render`, `app_set_stored_queries`and `app_debug`. These respect the same `create-app` and `edit-app` permissions as the web interface.
76
+
If [datasette-agent](https://github.com/datasette/datasette-agent) is installed, this plugin registers tools that let the agent build and edit stored apps: `app_list`, `app_create`, `app_view`, `app_str_replace`, `app_insert`, `app_edit`, `app_render`, `app_set_stored_queries`, `app_set_csp_origins` and `app_debug`. These respect the same `create-app`, `edit-app` and `apps-set-csp` permissions as the web interface.
77
77
78
-
Allowing an app to call stored queries is a data access grant, so the agent cannot do it on its own. When `app_create` is called with `stored_queries`, or `app_set_stored_queries` adds a query an app did not already have, the agent pauses and asks you to approve the grant in the chat. The question shows each query's name, title, description, parameters, whether it is a write query and its full SQL, plus any queries that would lose access. Approving creates the app or records a new app revision; declining leaves things unchanged and tells the agent to check with you. Queries that do not exist or that you cannot view are rejected before you are asked, and removing queries from an app does not require approval.
78
+
Allowing an app to call stored queries or contact external origins is a data access grant, so the agent cannot do it on its own. When `app_create` is called with `stored_queries` or `csp_origins`, when `app_set_stored_queries` adds a query an app did not already have, or when `app_set_csp_origins` adds a new origin, the agent pauses and asks you to approve the grant in the chat. For stored queries the question shows each query's name, title, description, parameters, whether it is a write query and its full SQL. For origins it lists each new origin and explains that the app could send data it can read to them. Both questions also list any queries or origins that would lose access. Approving creates the app or records a new app revision; declining leaves things unchanged and tells the agent to check with you. Queries that do not exist or that you cannot view, and origins outside the allow-list for users without `apps-set-csp`, are rejected before you are asked. Removing queries or origins from an app does not require approval.
0 commit comments