Session resources
⚠️
Preview — this feature is being built; the design below is the spec.
A session often needs material to work on: a spreadsheet to analyse, a repository to change, a memory store about one customer. Session resources mount that material into the session’s environment, where the agent’s tools can read it as ordinary files.
Kinds
| Kind | What is mounted | Default path | Default mode |
|---|---|---|---|
file | A file from the Files API, purpose agent_input | /workspace/inputs/<filename> | read-only |
git_repository | A shallow clone of a branch, tag or commit | /workspace/<repo name> | writable |
memory_store | A memory store’s tools, for this session only | (no path) | as the store allows |
Adding resources
At creation:
{
"agent_id": "agt_01JC4R8W6Q2N9X3T5V7Y",
"resources": [
{ "kind": "file", "file_id": "file_01JC3D5F7H9K1M3P5R7T" },
{ "kind": "git_repository", "git": { "url": "https://git.example.com/acme/billing-service.git", "ref": "main", "vault_secret": "git-read-token" } }
]
}Or later, with Add a resource. The agent is told about each new mount with a resource.added event, so you do not need to explain paths in your message.
Private repositories
Put a read token in the session’s vault and name it in vault_secret. The token is used for the clone and for later fetches; it is not written into the repository’s config and is never visible to the model. To let the agent push, give the token write access and allow the Git host in the environment’s network allowlist.
Changing and removing
- Switch a repository to another ref with Update a resource; uncommitted changes are discarded.
- Remove a resource unmounts it. The underlying file or repository is untouched.
Limits
| Limit | Value |
|---|---|
| Resources per session | 50 |
| Size of one file | 500 MB |
| Clone time | 120 seconds, depth 50 |
| Total mounted size | The environment’s disk_mb |
Was this page helpful?