Git-Compatible Versioned Repositories: Namespaces, Authentication, Protocol, and Limits
How Cloudflare Artifacts stores code as Git repos: three APIs, repo-scoped tokens, namespaces, limits, and push-driven automation.
This page summarizes Cloudflare Artifacts documentation: versioned storage that speaks Git, aimed at platforms that need many small repositories—for example one repo per agent, session, user, or task—and standard git clone, fetch, pull, and push workflows alongside Workers and HTTP control planes.
Versioned storage that speaks Git.
— Cloudflare, Artifacts
Artifacts is available on the Workers Paid plan, not Workers Free. See Artifacts pricing for billing dimensions (operations and storage).
Artifacts repositories: what they are and when to use Git storage on the edge
Section titled “Artifacts repositories: what they are and when to use Git storage on the edge”An Artifacts repository is an isolated Git service with its own history, refs, remote URL, repo-scoped tokens, and durable state. Namespaces group repos; each repo name is unique inside one namespace.
Artifacts creates Git repos on demand. Each repo is an isolated Git service with its own remote URL, tokens, and durable state.
— Cloudflare, How Artifacts works
Use Artifacts when you want versioned file trees (not raw blobs), programmatic repo creation at scale, Git-aware agents or automation, or Worker deploys tied to repo pushes. Typical patterns from the docs include storing Worker source in Artifacts and connecting repos to Workers Builds, tracking agent sessions in separate repos or branches, and forking from a shared baseline.
The same repo is reachable through three interfaces—control plane vs data plane:
| Interface | Role | Typical use |
|---|---|---|
| Workers binding | Create, import, fork, inspect, mint tokens from Worker code | Edge orchestration, token vending, metadata reads |
| REST API | Same control operations from any HTTP client | Agents off Workers, dashboards, CI provisioning |
| Git protocol | Clone, fetch, pull, push contents | Local dev, sandboxes, standard Git tooling |
The Workers binding and the REST API are control-plane interfaces. Use them to manage repositories and tokens. The Git protocol is the data-plane interface.
— Cloudflare, Repositories
Namespaces and jurisdiction: how to partition repos and data location
Section titled “Namespaces and jurisdiction: how to partition repos and data location”Namespaces are top-level containers. If you create a repo under a name that does not exist yet, Artifacts creates the namespace implicitly; you can also create one explicitly via the REST API with an optional jurisdiction.
Artifacts uses namespaces as top-level containers for repositories. Use them to separate repositories by environment, such as prod, staging, and dev, by tenant, or shard.
— Cloudflare, Namespaces
Pick one stable namespace name (for example default, staging, or agents-realtime) and use it consistently in Wrangler bindings, REST base URLs, and Git remotes. When traffic or ownership boundaries grow, add namespaces rather than overloading one shared namespace—see Best practices for Artifacts for environment, team, and traffic isolation examples.
Data localization: when creating a namespace, you may set jurisdiction to eu or us so repo data is stored and processed only in that region. Jurisdiction cannot be changed after creation; omitting it creates an unrestricted namespace. Details: Data localization and the jurisdictions changelog.
Authentication: Workers binding vs REST API vs Git protocol
Section titled “Authentication: Workers binding vs REST API vs Git protocol”Artifacts uses a different authentication path for each interface. Cloudflare API tokens never substitute for Git access, and repo tokens never authenticate REST control routes.
| Interface | Authenticate with | Permissions / scopes | Use for |
|---|---|---|---|
| Workers binding | Configured artifacts binding in Wrangler |
Worker runtime; Wrangler login only for local dev / deploy |
env.ARTIFACTS in Worker code |
| REST API | Authorization: Bearer Cloudflare API token |
Artifacts > Read (read routes); Artifacts > Edit (write routes) | Control-plane HTTP |
| Git protocol | Repo-scoped Artifacts token | read: clone, fetch, pull; write: also push |
Git over HTTPS |
Cloudflare API tokens authenticate control-plane access. Repo-scoped Artifacts tokens authenticate Git access.
— Cloudflare, Authentication
Authenticate Git clone and push with repo-scoped tokens
Section titled “Authenticate Git clone and push with repo-scoped tokens”Mint tokens from the Workers binding, REST API, or Wrangler artifacts repos issue-token. Tokens look like art_v1_<40 hex>?expires=<unix_seconds>.
Recommended: pass the full token via Git’s http.extraHeader so credentials stay out of the remote URL:
git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-cloneFor short-lived one-off commands, Basic auth in the URL is supported; use the token secret (strip ?expires=…). See Git protocol → Authentication.
Create a repository: REST API, Workers binding, or Wrangler
Section titled “Create a repository: REST API, Workers binding, or Wrangler”Create via REST API and push the first commit
Section titled “Create via REST API and push the first commit”Follow Get started → REST API: set ARTIFACTS_BASE_URL under /accounts/$ACCOUNT_ID/artifacts/namespaces/$ARTIFACTS_NAMESPACE, POST to create a repo, then use result.remote and result.token for Git—not the REST hostname.
The create response includes both the Git remote and an initial token; recover metadata later with GET …/repos/:name, and mint a new Git token with POST …/tokens when needed (REST API).
Create via Workers binding
Section titled “Create via Workers binding”Add an [[artifacts]] binding in Wrangler (Authentication → Workers binding), then call env.ARTIFACTS.create(name) from a Worker. The Workers get started guide returns remote and token to a client for the first push.
Create via Wrangler CLI
Section titled “Create via Wrangler CLI”npx wrangler artifacts repos create <NAME> --namespace <NAMESPACE>Command reference: Wrangler Artifacts commands and Wrangler API.
Git remotes follow https://<ACCOUNT_ID>.artifacts.cloudflare.net/git/<namespace>/<repo>.git—always use the exact remote from create/get responses (Git protocol).
Git protocol limits: push size, protocol versions, and token scopes
Section titled “Git protocol limits: push size, protocol versions, and token scopes”| Topic | Behavior |
|---|---|
| Clone / fetch | Git protocol v1 and v2 (git-upload-pack) |
| Push | v1 git-receive-pack only; v2 receive-pack not supported |
Token read |
git clone, git fetch, git pull |
Token write |
above plus git push |
Full matrix: Git protocol → Protocol support.
Account and repo limits matter for design:
| Feature | Limit |
|---|---|
| Max storage per repository | 1 GB for repos created on or after 2026-09-29; earlier repos keep 10 GB |
| Max push size | 64 MiB per push (split large changes) |
| Max file size | 32 MiB per file |
| Control-plane rate | 2,000 requests / 10 s per namespace |
| Git rate | 2,000 requests / 10 s per artifact |
Source: Artifacts limits and 1 GB storage limit changelog.
Repository patterns for agents and automation
Section titled “Repository patterns for agents and automation”One repo per agent or session (not one shared queue repo)
Section titled “One repo per agent or session (not one shared queue repo)”Create one repo for each unit of autonomous work. If you have 10,000 agents, create 10,000 repos.
— Cloudflare, Best practices for Artifacts
Use branches only when collaborators share one lifecycle. Include stable IDs in repo names (${agentName}-${sessionId}-${repoName}) because names are unique per namespace.
Fork baselines and import public templates
Section titled “Fork baselines and import public templates”Fork reviewed starter repos for session work (fork example). Import public HTTPS remotes via REST or binding (Import repositories); imports may return before completion—retry on 409 Conflict.
Git notes for harness metadata
Section titled “Git notes for harness metadata”Attach prompts, model output, or run IDs with git notes without changing commits; sync refs/notes/* when moving metadata between systems (Best practices → git notes).
Large repos in sandboxes: ArtifactFS
Section titled “Large repos in sandboxes: ArtifactFS”ArtifactFS mounts a Git repo via FUSE with a blobless clone and on-demand hydration—useful for large Artifacts remotes in containers or VMs; smaller repos are usually simpler with a normal git clone.
Workers that must run Git inside the runtime without a git binary can use isomorphic-git with a binding for repo management and JavaScript for file trees.
Events and push-driven build/deploy (optional automation)
Section titled “Events and push-driven build/deploy (optional automation)”Artifacts emits lifecycle events (repo.created, repo.pushed, etc.) consumable from Workers—see Event subscriptions.
For CI on every push, either use the Workers Builds Artifacts integration for standard Worker deploys, or a custom Workflow triggered by cf.artifacts.repo.pushed and the @cloudflare/ci SDK (Build and deploy Artifacts repos, changelog).
Common mistakes when using Artifacts
Section titled “Common mistakes when using Artifacts”- Using a Cloudflare API token for
git pushinstead of a repo-scoped Artifacts token (Authentication). - Confusing REST API URLs with the Git
remotefromresult.remote(REST API get started). - One long-lived write token shared by every agent (Best practices).
- Pushes larger than 64 MiB or files above 32 MiB without splitting work (Limits).
- Assuming namespace jurisdiction can be changed later (Data localization).
- Putting Git tokens in sandbox-visible clone URLs when a Worker should inject credentials (clone a private repository pattern—relevant when combining sandboxes with remotes).
Manage namespaces, repos, and tokens in the dashboard under Storage & databases > Artifacts (dashboard management changelog). API surface overview: Artifacts API.
How to check this on your site
Section titled “How to check this on your site”-
Confirm your account is on Workers Paid and review Artifacts limits against expected repo count and push sizes.
-
Create or select a namespace and repo via the REST API get started flow or Wrangler artifacts commands, and verify
GETrepo metadata returns the sameremoteyou use locally. -
Mint a read token, run
git -c http.extraHeader="Authorization: Bearer …" cloneagainst that remote (Git client example), then push with a write token and confirmlast_push_atupdates via REST. -
In the Cloudflare dashboard, open Artifacts and confirm the repo, files, and token scopes match your intended read/write separation (Manage Artifacts from the dashboard).
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page disagrees with the linked Cloudflare docs or your setup, email yimasynthetic@gmail.com with the page URL and the exact statement you want clarified or corrected.