Prerequisites
- An API key with access to the workspace.
- The agent id you will run the task against.
- The file’s SHA-256 digest, in both hex and base64. You compute this before uploading; the object store verifies against it.
Choose an upload path
Both return a
ref of the form staging/{id}/{filename}, and the create-task
endpoint treats them identically.
Steps
PUT the bytes
The digest is bound into the signature, so the The object store rejects a body that does not hash to the declared digest, so a
truncated or swapped upload fails here rather than reaching the agent.Alternative — server-proxied upload. One call, no digest arithmetic:
x-amz-checksum-sha256 header is
mandatory and must carry the base64 digest. Content-Type must match what
you presigned with.Create the task with the ref
inputs/attachments/{filename}. The agent is told about the files by relative
path in its prompt, so it can read them without being asked to fetch anything.Two attachments with the same basename are disambiguated deterministically:
report.csv and report-1.csv.Verify
List the task’s files and confirm the attachment landed underinputs/attachments/:
Troubleshooting
403 or SignatureDoesNotMatch on the PUT
403 or SignatureDoesNotMatch on the PUT
The
x-amz-checksum-sha256 header was omitted, or carries hex instead of
base64, or the Content-Type sent differs from the one presigned. All three
are part of the signature. Re-mint the URL if you need to change the content
type.404 "attachment ref not found" at task creation
404 "attachment ref not found" at task creation
The presigned URL expired before the PUT completed (
expires_in is 3600
seconds), or the PUT failed and was not retried. Mint a fresh URL and upload
again — refs are not reusable across a failed upload.413 on upload or on task creation
413 on upload or on task creation
The per-file limit is 256 MiB, enforced at both the presign step and the
server-proxied upload. A 413 at task creation instead means the workspace’s
total quota would be exceeded by the attach.
422 "Invalid attachment ref"
422 "Invalid attachment ref"
Refs must begin with
staging/ . A workspace file path is not an attachment
ref; upload it with purpose=attachment to get one.The task dispatches but the agent says it cannot find the file
The task dispatches but the agent says it cannot find the file
Check that the descriptor path starts with
inputs/attachments/ in the
artifacts listing. The prompt only advertises attachments under that exact
prefix, so a file committed elsewhere in the workspace is present but not
announced.Related
Start a task
Launch an agent run over REST, the CLI, or A2A
Retrieve task artifacts
List the files a task produced and download them through the API
Artifacts
How files an agent produces become durable