Can files carry over between turns?

Williams, Paula 0 Reputation points
2026-12-01T17:28:21.6766667+00:00

In an Agent Builder agent with Code Interpreter, can a file created in one turn (for example, an .xlsx workbook) be read and updated in a later turn of the same conversation without the user re-attaching it? If yes, how long does the file stay available?

Microsoft Copilot | Microsoft 365 Copilot | Development

1 answer

Sort by: Most helpful
  1. AI answer

    2026-12-01T17:28:51.7833333+00:00

    Yes—an Agent Builder agent can read a file it created earlier and produce an updated version in a later turn of the same conversation, without the user reattaching it.

    • Refer to the file naturally, for example: “Update the workbook you created earlier by adding a quarterly totals sheet.”
    • The agent can retrieve the previously created .xlsx, process it, and return the updated workbook as a new created-file card.
    • Created files remain available for 28 days after the last activity in that conversation. Activity resets that inactivity period.
    • After the retention window expires, the files are deleted and cannot be referenced.
    • Each agent-created file is limited to 10 MB; larger output should be split into multiple files.
    • This created-files capability is currently documented as preview and is subject to change. ^1^

    This persistence belongs to the conversation, not to Code Interpreter’s runtime disk. Code Interpreter starts a fresh isolated virtual machine whenever it runs code and destroys that VM when the session ends; files and data on that VM are not persisted. ^2^ The conversation-level file service is what makes the created workbook available to a later turn.

    The carryover therefore does not apply when:

    • A new or different conversation is started.
    • The original conversation is reset.
    • More than 28 days pass without activity.
    • The file was not successfully surfaced in the original response—for example, because it exceeded the 10 MB created-file limit.

    For long-term storage or reuse across different conversations, download the workbook and store it in a persistent location such as OneDrive or SharePoint; conversation file retention should not be treated as permanent storage.


    References

    1. Files the agent creates (Microsoft Copilot) (preview)
    2. Code interpreter security architecture
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.