feat(tools): the assistant reads the files of records; an answer keeps no address the application did not give #116
Open
james.maes
wants to merge 16 commits from
feat/read-file-contents into develop
pull from: feat/read-file-contents
merge into: QRun-IO:develop
QRun-IO:develop
QRun-IO:feat/compact-answers-and-output-ceiling
QRun-IO:feat/one-card-for-a-set
QRun-IO:fix/render-widget-follows-data-access
QRun-IO:fix/tool-call-admission-does-not-pin
QRun-IO:release/0.1
QRun-IO:rc/develop-into-release-0.1-registry
QRun-IO:feat/process-tools
QRun-IO:feat/writes-follow-the-person
QRun-IO:fix/atomic-confirm-and-closed-surface
QRun-IO:fix/tool-service-owns-policy-and-identity
QRun-IO:fix/tool-call-service-enforces-its-checks
QRun-IO:feat/tool-registry
QRun-IO:docs/actions-and-mcp-design
QRun-IO:rc/develop-into-release-0.1-everyone
QRun-IO:feat/store-reads-as-trusted-code
QRun-IO:rc/develop-into-release-0.1-weekly
QRun-IO:feat/weekly-budget
QRun-IO:rc/develop-into-release-0.1-save
QRun-IO:feat/save-and-schedule-analysis
QRun-IO:rc/develop-into-release-0.1-analyze
QRun-IO:feat/analyze-records
QRun-IO:fix/turn-watchdog-never-hangs-develop
QRun-IO:fix/turn-watchdog-never-hangs
QRun-IO:fix/live-thread-placeholders
QRun-IO:merge/develop-into-release-0.1
QRun-IO:automation/qbit-rc-pending
QRun-IO:fix/transcript-stored-before-message-end-develop
QRun-IO:fix/transcript-stored-before-message-end
QRun-IO:main
QRun-IO:archive/qrun-github-cutover-20261101/ca9212731dc2/develop
QRun-IO:feat/openai-compatible-provider
QRun-IO:dependabot/maven/develop/maven-minor-and-patch-634f43d868
QRun-IO:dependabot/github_actions/develop/github-actions-0fdda1077f
QRun-IO:feature/orb-0.8-track
QRun-IO:feature/orb-0.7.18
QRun-IO:feature/orb-0.7.17
QRun-IO:feature/orb-standardize-release-0.1
QRun-IO:feature/orb-main-standardization
QRun-IO:feature/shared-codeql
QRun-IO:feature/orb-0712-stable-gate
QRun-IO:feature/orb-rc-worker
QRun-IO:feature/orb-0.7.11
QRun-IO:feature/central-ci
QRun-IO:feature/conversation-management
QRun-IO:feature/starter-prompts-from-access
QRun-IO:feature/turns-not-jobs
QRun-IO:feature/assistant-attachments
QRun-IO:feature/assistant-optional-provider-health
QRun-IO:fix/assistant-health-tile-wording
QRun-IO:feature/fail-soft-renders
QRun-IO:fix/records-render-and-stream-context
QRun-IO:ci/release-rc-secrets-inherit
QRun-IO:feature/ui-api-1.6
QRun-IO:fix/shutdown-hook-weak-runtime
QRun-IO:fix/help-bundle-version
QRun-IO:feature/health-checks
QRun-IO:feature/jobs-tray
QRun-IO:feature/help-bundle
QRun-IO:feature/transcript-redaction
QRun-IO:feature/foreign-keys
QRun-IO:feature/schema-indexes
QRun-IO:fix/assistant-defaults-rollback
QRun-IO:feature/durable-turns
QRun-IO:fix/assistant-defaults-guards
QRun-IO:feature/tables-populated-defaults
QRun-IO:feature/provider-spi-package
QRun-IO:feature/email-api
QRun-IO:feature/orb-0.6.9
QRun-IO:feature/write-mode
QRun-IO:feature/x1-y1-channel-wall
QRun-IO:feature/email-qbit
QRun-IO:feature/spec-endpoints-core-invoker
QRun-IO:feature/provider-api-module
QRun-IO:feature/p7-scheduled-tasks
QRun-IO:feature/bulk-load-tools
QRun-IO:feature/p6-rag
QRun-IO:feature/presentation-demo-shots
QRun-IO:feature/answer-presentation
QRun-IO:fix/core-alerts-rc5
QRun-IO:feature/p5-routing-fallback
QRun-IO:feature/p4-budgets
QRun-IO:feature/p3-hipaa-routing
QRun-IO:feature/p2-bedrock-vertex
QRun-IO:feature/p1-provider-registry
QRun-IO:feature/spec-providers-write-mode-wall
QRun-IO:feature/demo-pending-card
QRun-IO:feature/release-rc-automation
QRun-IO:feature/demo-screens
QRun-IO:feature/profiles-skills-access
QRun-IO:feature/ui-api-tools
QRun-IO:feature/strict-tools-grammar-fix
QRun-IO:feature/app-home-settings
QRun-IO:feature/fix-rename-version-labels
QRun-IO:feature/note-burned-rc
QRun-IO:feature/assistant-record-screens
QRun-IO:feature/robustness-test-flake
QRun-IO:feature/ga-only-release-tags
QRun-IO:feature/snake-case-table-names
QRun-IO:chore/qrun-repo-standard
QRun-IO:feature/pom-revision-comment
QRun-IO:feature/phase-0-1-assistant
No Reviewers
Labels
Clear labels
architecture
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
release:rc
secuurity
ux
wontfix
Architecture review: coupling, cohesion, UI API
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update GitHub Actions code
Good for newcomers
Extra attention is needed
This doesn't seem right
Pull requests that update java code
Further information is requested
Merging this develop PR cuts the next release candidate
Admin UX / information architecture
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: QRun-IO/qbit-assistant#116
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
The assistant can read the content of a file a record holds, for a person who may open it, and an answer keeps no address the application did not give.
Design:
docs/file-contents-and-links.md(short; read it first).Stacked on #114 (which is stacked on #113, #112 and #115): merge those first; until then this diff shows their commits too.
Why
A person asked what was in a file attached to a record. The assistant found the row of the attachment (a text file of 58 KB), answered that it cannot read the content of files, and wrote an address for the row as plain text: an address it had composed itself.
The rule the assistant is held to: it can see what the signed-in person can see and do what they can do. The exceptions are secrets (credentials, tokens, keys, live sessions) and values masked for that person.
Reading a file:
read_filedescribe_tablelists a table's file fields. A host can say more for a table (withFileSource), and never has to for a file to be found.GET /table/{tableName}/{primaryKey}). A BLOB is downloaded with the application's own operation as the person (GET /table/{tableName}/{primaryKey}/{fieldName}/{filename}; newUiApiGateway.download, which streams at most the cap). No internal path.withFileUrlHosts, none by default): http or https, no credentials, no redirect. The address is never shown to the model.offsetreads on.trust="untrusted"; text in the file cannot close it), after a sentence that says it is a file's content and instructions in it are never followed. The system prompt has the same rule (20). The tool-call log keeps what was read, not the content.Links
AssistantFileSource.withAttachedTo) and the application, asked as the person, lists that record's table for them with read permission; otherwise the file's own record, which the person just read.AnswerLinks). Every path the model was given in a turn (tool results, the conversation so far, the page) is noted. A markdown link to a path of the application that was not given keeps its words and loses its target; a/app/...path written as plain text becomes "(link removed)"; the answer gets one notice. Streamed text that may become a link is held back until it is whole, so the person does not see the address either./app/{table}/{id}for every table the application lists for the person with read permission, in an app or not, so whether something opens is asked of the application, per person, not guessed from the metadata (design note, section 3). The links the record tools already gave are for tables they read as the person and are unchanged.What a host must declare
withFileUrlHosts("files.example.com").withFileSource(new AssistantFileSource("attachment").withFileNameField(...).withMediaTypeField(...).withSizeField(...).withAttachedTo("recordTable", "recordId")).No schema change, no permission, no API change. The tool set gains one tool and the system prompt one rule, so the cached request prefix changes once.
Not readable yet
Tests (fake model provider, real UI API server)
ReadFileTest:describe_tablelists the file fields;AnswerLinksTest: given and composed addresses in every form; what is held back while text streams.Changed tests: the expected tool lists gain
read_file(ToolRegistryTest,WritesFollowThePersonTest,ProcessToolsTest), andchat-tools-before-registry.txtgains its line in the five scenarios that allow every tool (added as text, documented inChatToolSetTest); the runtime-wiring allow-list ofToolCallArchitectureTestgainswithFileSettings.Build
./mvnw clean verifyon this head (77f2b75), nothing skipped: BUILD SUCCESS, 774 tests, 0 failures (651 inqbit-assistant: 645, and 3 each with one and with two processors; 16 provider API, 23 Anthropic, 53 OpenAI-compatible, 11 Bedrock, 12 Vertex, 8 pgvector), coverage checks met in every module.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.