Repository navigation
Tell an agent what the window reaches, without handing it the key - #82
Merged
Merged
Conversation
An agent reading the window could not tell a local result from one that came over the network on the person's credentials, and could read a key typed into a query tab. `open --state` now lists S3's endpoint and attached databases as metadata, says how far each result reached, and withholds SQL that may hold a credential. Nothing here makes a network request. S3Config's debug print carried the secret, so it no longer does. Failures to reach a remote source now say what to do next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #72 and #64. This leaves #72 open: see "What's left".
Why
An agent reading
ducklocal open --statecouldn't tell a local result from one that came over the network on the person's credentials. It could also read a key typed into a query tab, which #72 says must never happen.What
open --stategains two things, both additive withinschema_version1:It also keeps keys out:
sql_withheld: trueon the tabconnections,reachandattachedS3Config'sDebugoutput, which printed the secretNo network, and the window doesn't wait. The list comes from
duckdb_databases(), which is local, unlikeload_catalog. If a query holds the connection,databasesisnullinstead of the window blocking.Recovery hints: CLI errors for an unreachable source now say to check the address and to
DETACHandATTACHagain. A 401 or 403 says to have the person check the key, and never to put one in SQL.Decisions to review
withheldreuses the session's word list, so a column calledaccess_keyortokenhides that tab's SQL from the agent. That's common in security logs, and Walk a made-up CloudTrail incident from first query to reviewed report #81 ran into the same cost in a session file. I kept it because the failure is asking the person rather than leaking a key, but it's the choice most likely to annoy.reach: "local"means nothing it names is remote. It's read from the SQL alone, so a local view over remote data reads as local. The docs and the skill say so.unknowncovers what can't be told, including a bare table name while a remote database is attached.connectionsandreachare outside the revision, likelimits. Otherwise a query holding the connection would change the revision with nothing on screen changing.What's left on #72
location: "remote"says where a database is and not that it answers.docs/network-and-privacy.mdalready says it keeps your SQL, but a typedCREATE SECRETlands there.Testing
the_state_says_what_it_reaches_and_no_keyruns in a test window with S3 configured and a key typed into a tab, then asserts the key appears nowhere in the state and that it fits the schema.connections.rsunit tests cover classifying databases, reach and address cleaning.cargo test --locked -- --skip perf_probe::on Windows passes before the final edits: 493 unit, 40 CLI, 3 example, 8 LSP and 4 network-path tests. After them I reran the affected tests; clippy and fmt are clean.quackandhttpfsaren't installed on this machine, and installing them changes the shared extension folder. So the address format a real Quack attach reports, and the exact wording of the connection errors the hints match, are assumptions. If a wording differs, the error simply has no hint. If Quack's kind differs fromquack, it reads as local, but Refresh a quack attach's catalog before listing tables #58 already relies on that kind inschema.rs.🤖 Generated with Claude Code