Repository navigation
Conversation
…lake#871) Each claim asks Lake for credentials: by_reference, so no task credential reaches this shared process. The turn calls Lake (capability reads and writes, and the model gateway) with the agent's bus credential and the header X-Lake-Agent-Task: <task id>. A Lake from before lake#871 refuses the field before claiming; the claim is then asked again without it and the body's credential is used as before.
This was referenced Nov 15, 2026
Security: library agents hold live task credentials for every tenant they serve
oramasearch/lake#871
Open
Contributor
Author
|
Deferred on Steve's review (2026-11-16), not in this release: it is the by-reference-claims feature (lake#871), which needs the matching Lake change and was judged not low risk. |
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.
What: This agent now claims each bus task with
credentials: by_reference, so Lake never hands it the task's credential. Every call the turn makes to Lake carries the agent's own bus credential and the headerX-Lake-Agent-Task: <task id>.Why: The agents' half of oramasearch/lake#871: a library agent is one process serving every tenant, so a task credential in its memory could be taken elsewhere. Lake's half is oramasearch/lake#1304.
How:
lake_bus.pyasks forby_referenceand, when Lake answers that way, fills the turn's credential fields with the bus credential and addslake_headersnaming the task. The Lake client and the model gateway client send that header. A Lake without lake#1304 refuses the new field before claiming anything; the claim is then asked again without it and the body's own credential is used, as today.Tests not run: per Steve, 2026-11-14, tests run at review and release time. Tests were written (below).
The same change is in every library agent, from the shared
lake_bus.py(reference: oramasearch/agent-ask-orama#65).Changes
src/agent_experiments/lake_bus.py:claimaskscredentials: by_referenceand, oninvalid_inputnamingcredentials(a Lake from before lake#871), asks again without it. Any other refusal is not retried.task_credentialsfillslake_token/zetta_tokenwith the bus credential and setslake_headersonly when the claim answer sayscredentials: by_reference; otherwise the body is used as it came.task_headers(body)returns onlyX-Lake-Agent-Task. Bus calls (receive, claim, publish) never send the header, since Lake would then answer them as the task.src/agent_experiments/model.py:gateway_client(..., headers=)sends the header on every model call through Lake's gateway.src/agent_experiments/agent.py:Turn.lake_headers, sent by the turn'sLakeclient on every capability read and write.src/agent_experiments/service.py:run_turnfillsTurn.lake_headersfromlake_bus.task_headers(body)and passes it to the gateway client.README.md,docs/operations/service.md(No task credential reaches this process).Tests
tests/test_by_reference.py: the claim asksby_referenceand the turn holds the bus credential and the task header; a Lake that refuses the field is asked again and the body's credential is used with no header; another refusal is not retried;task_headerskeeps only the task header; the turn's model call and its Lake reads and writes send the bus credential andX-Lake-Agent-Task; an in-body turn sends no task header.tests/test_service.py,tests/test_turn_destinations.py: the patchedgateway_clientaccepts the newheaderskeyword.tests/test_lake_bus.py: the recording bus has atoken, whichrun_tasknow reads.Rolling
No roll order. This works against today's Lake (in-body, by the fallback) and against Lake with oramasearch/lake#1304 (by reference). oramasearch/lake#871 stays open: Lake removes the in-body mode once every library agent claims by reference.
Likely conflicts with open pull requests
src/agent_experiments/service.py(run_turn),README.mdanddocs/operations/service.md: textual conflicts nearrun_turn'sTurn(...)and the bus paragraph are likely.README.md(build section): a small textual conflict is possible.SECURITY.md.