Taking agents into production invariably brings teams up against the wall of state management. Where and how should drafts generated by agents, code under edit, and logs of past decisions be stored? Simply dumping them into S3 leaves you without diffs or history, while managing them separately in PostgreSQL causes operational complexity to explode.
A new solution has arrived with Cloudflare's announcement of Cloudflare Artifacts. As a file system featuring Git-compatible versioning and RESTful APIs, it significantly streamlines deliverable management for AI agents. In this article, we outline design patterns for adopting Artifacts in custom development and implementation steps for migrating from existing storage.
Why a Git-compatible file system is necessary
When examining typical requirements for agent state management, they align almost exactly with Git features.
| Agent-side requirement | Equivalent Git feature |
|---|---|
| Roll back to earlier outputs | git checkout <commit> |
| Test multiple options in parallel | git branch |
| Human review of changes before and after | git diff |
| Merge only selected proposals into main | git merge |
| Track who changed what | git blame / git log |
Because Cloudflare Artifacts exposes these capabilities directly via REST APIs, it provides the fastest path to support the use case of "agents managing state in a Git-like manner."
As noted in our production operations guide for pgvector, agent platforms will fail in production unless designed with state management in mind from the start. Artifacts serves as a practical solution to manage state without having to build it all in-house.
Architectural positioning
We organize the role of Artifacts in agent infrastructure across four state layers.
- Conversation state: Recent interactions and reasoning steps → KV / Durable Objects
- Artifact state (focus of this article): Deliverables generated by agents → Cloudflare Artifacts
- Domain data: Core business data → Existing DBs (Postgres / enterprise systems)
- Knowledge base: Reference data for RAG → Vector DBs (pgvector / Vectorize)
Separating conversation history from deliverables is the first architectural step. Conversations are ephemeral and short-lived, whereas deliverables are reviewed by humans and retained long term—because their characteristics differ, their storage should be separated as well.
Frequent use cases in client projects
A. Document generation agents
Projects where agents author proposals, meeting minutes, and requirements specifications. By committing deliverables to Artifacts, teams can:
- Instantly revert to three versions earlier
- Create separate branches for parallel reviews by each stakeholder
- Merge only finalized versions into main
This enables workflows far more flexible than revision history in Word or Google Docs.
B. Code generation and internal tool builders
Use cases where agents build internal tools. Placing generated code in Artifacts allows humans to review and decide whether to commit or revert, dramatically reducing the risk of faulty code slipping into production.
C. Image and video workflows
Version control for images created by multimodal agents. Teams can generate A, B, and C variations of assets in parallel and merge only the selected option into main—making it ideal for creative pipelines.
Migration steps from existing storage
Here is the procedure for migrating projects storing agent deliverables in S3 or GCS over to Artifacts.
Step 1. Separate deliverables from one-off files
Storing everything in Artifacts drives up both costs and latency. Route only files where history and diffs provide clear value into Artifacts.
// 仕分けの判断ロジック例
function shouldUseArtifacts(file: GeneratedFile): boolean {
if (file.size > 100 * 1024 * 1024) return false; // 100MB 超は S3
if (file.type === "log") return false; // 単発ログは S3
if (file.lifecycle === "ephemeral") return false; // 一時生成物は KV
return true; // それ以外は Artifacts
}
Step 2. Repository granularity design
Like Git, Artifacts manages branches and histories at the repository level. The standard convention is to define boundaries along three axes: "Client × Project × Agent." Overly fine granularity impairs metrics aggregation, while overly coarse boundaries prevent proper permission isolation.
Step 3. Commit message design
Just like Git, commits require descriptions. Since agents generate these automatically, establishing templates improves searchability.
[agent:billing-summary] 顧客 #1234 の 2026-04 請求サマリ生成
- 元データ: invoices_2026_04.csv
- 判断: 期日超過 3 件を強調
- 信頼度: 0.92
Structuring metadata such as agent name, target data, decision rationale, and confidence score vastly increases audit value down the road.
Step 4. Integrating human review workflows
The greatest value of Artifacts lies in enabling humans to review diffs and merge changes. Build UI actions callable from Slack or internal portals to:
- Inspect diffs via
view diff <artifact_id> - Merge into main via
approve <artifact_id> - Roll back via
revert <artifact_id>
This applies the HITL principles from our design patterns for turning existing SaaS APIs into MCP servers to deliverable management.
Pitfall: Runaway agent commits
An issue frequently encountered early in implementations is agents firing off meaningless commits every second. This blows up token usage, storage, and review workloads. Two measures counter this:
- Commit rate limiting: Add logic on the agent side to append to the previous commit if within N seconds, creating a new commit only after N seconds elapse
- Significance threshold: Suppress commits if the number of changed lines or tokens falls below a set threshold
Summary — Agent history becomes a company asset
Deliverables and decision logs generated by agents represent genuine corporate knowledge assets. Accumulating them in a Git-compatible file system like Artifacts preserves them for search, fine-tuning, auditing, and continuous improvement.
However, as outlined above, deciding what belongs in Artifacts differs by project. Shifting any of the three prerequisites—the sorting criteria in Step 1, repository granularity in Step 2, or how deeply review UIs are developed—completely alters the required architecture and schedule. Starting points also differ depending on whether deliverables are already accumulating in S3/GCS or infrastructure is being built from scratch. In sectors like finance, healthcare, and legal, where organizations must trace and explain past agent decisions, audit logging must be planned from even earlier stages.
If you can share where your deliverables are currently stored and how far back decision explanations must reach, we can work backward to map out an architecture together. Please reach out via our contact form.









